Re: metadatabase
"Kristian G. Kvilekval" <[email protected]>
| Newsgroups | gmane.comp.audio.zinf.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2003-10-15 at 11:01, David Vrabel wrote:
> > I think this direction is fine, in fact I have an initial version
> > with a vector like "playsheet" that is just a wrapper over
> > a vector<string> with some added functionality..
> >
> > class Playsheet {
> > public:
> > typedef std::vector<std::string> playlist_type;
> > .... other typedefs
> > public: // vector interface
> > iterator begin() { return m_urls.begin();}
> > iterator end() { return m_urls.end();}
> > ... other vector intrfaces
> >
> > public: //Extended interface
> > Playsheet();
> >
> > uint32_t find(const string&url);
> > void shuffle();
> >
> > ...
> > }
>
>
> There's no need for find(const string& url) and shuffle() to be part of
> a class. There's, probably, no need for the Playsheet class with it's
> extra functions at all in fact -- the Standard Library already has
> functions in <algorithm> for searching (find(), find_if() etc) and
> shuffling (random_shuffle()) and whole heaps of other stuff.
>
Absolutely, I use these algorithms quite a bit in mdb.
The wrapper class was just that .. a wrapper. You
could as easily have said typedef vector<string> playsheet_type;
However, I sometimes prefer wrappers classes when there is the
possibility that I might need to add fields.
--
email:[email protected] office:(805)893-4276 http://www.cs.ucsb.edu/~kris
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php