libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
factory.h
Go to the documentation of this file.
1 /*
2  * MusicBrainz -- The Internet music metadatabase
3  *
4  * Copyright (C) 2006 Lukas Lalinsky
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  *
21  */
22 
23 #ifndef __MUSICBRAINZ3_FACTORY_H__
24 #define __MUSICBRAINZ3_FACTORY_H__
25 
26 #include <musicbrainz3/model.h>
27 
28 namespace MusicBrainz
29 {
30 
35  {
36  public:
37  virtual ~IFactory() {};
38  virtual Artist *newArtist() = 0;
39  virtual ArtistAlias *newArtistAlias() = 0;
40  virtual Disc *newDisc() = 0;
41  virtual Track *newTrack() = 0;
42  virtual Relation *newRelation() = 0;
43  virtual Release *newRelease() = 0;
44  virtual ReleaseGroup *newReleaseGroup() = 0;
45  virtual ReleaseEvent *newReleaseEvent() = 0;
46  virtual User *newUser() = 0;
47  virtual Tag *newTag() = 0;
48  virtual Label *newLabel() = 0;
49  virtual LabelAlias *newLabelAlias() = 0;
50  };
51 
57  class MB_API DefaultFactory : public IFactory
58  {
59  public:
60  virtual Artist *newArtist() { return new Artist(); };
61  virtual ArtistAlias *newArtistAlias() { return new ArtistAlias(); };
62  virtual Disc *newDisc() { return new Disc(); };
63  virtual Track *newTrack() { return new Track(); };
64  virtual Relation *newRelation() { return new Relation(); };
65  virtual Release *newRelease() { return new Release(); };
66  virtual ReleaseGroup *newReleaseGroup() { return new ReleaseGroup(); };
67  virtual ReleaseEvent *newReleaseEvent() { return new ReleaseEvent(); };
68  virtual User *newUser() { return new User(); };
69  virtual Tag *newTag() { return new Tag(); };
70  virtual Label *newLabel() { return new Label(); };
71  virtual LabelAlias *newLabelAlias() { return new LabelAlias(); };
72  };
73 
74 }
75 
76 #endif