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
virtual Track * newTrack()
Definition: factory.h:63
virtual ReleaseEvent * newReleaseEvent()
Definition: factory.h:67
virtual ArtistAlias * newArtistAlias()
Definition: factory.h:61
Represents an artist.
Definition: artist.h:46
virtual Label * newLabel()
Definition: factory.h:70
virtual Artist * newArtist()
Definition: factory.h:60
virtual ~IFactory()
Definition: factory.h:37
Represents an Audio CD.
Definition: disc.h:54
Represents a MusicBrainz user.
Definition: user.h:36
virtual Relation * newRelation()
Definition: factory.h:64
virtual Tag * newTag()
Definition: factory.h:69
Represents a track.
Definition: track.h:51
Definition: tag.h:35
virtual Disc * newDisc()
Definition: factory.h:62
virtual ReleaseGroup * newReleaseGroup()
Definition: factory.h:66
Represents a label alias.
Definition: labelalias.h:38
virtual Release * newRelease()
Definition: factory.h:65
Represents an artist alias.
Definition: artistalias.h:43
virtual User * newUser()
Definition: factory.h:68
Represents a Release Group.
Definition: releasegroup.h:40
A factory to instantiate classes from the domain model.
Definition: factory.h:57
Represents a relation between two Entities.
Definition: relation.h:46
Represents a record label.
Definition: label.h:38
A release event, indicating where and when a release took place.
Definition: releaseevent.h:39
#define MB_API
Definition: defines.h:40
Represents a Release.
Definition: release.h:47
A factory to instantiate classes from the domain model.
Definition: factory.h:34
virtual LabelAlias * newLabelAlias()
Definition: factory.h:71