libmusicbrainz3 3.0.3

factory.h

Go to the documentation of this file.
00001 /*
00002  * MusicBrainz -- The Internet music metadatabase
00003  *
00004  * Copyright (C) 2006 Lukas Lalinsky
00005  *  
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * 
00021  */
00022  
00023 #ifndef __MUSICBRAINZ3_FACTORY_H__
00024 #define __MUSICBRAINZ3_FACTORY_H__
00025 
00026 #include <musicbrainz3/model.h>
00027 
00028 namespace MusicBrainz
00029 {
00030 
00034     class MB_API IFactory 
00035     {
00036     public:
00037         virtual ~IFactory() {};
00038         virtual Artist *newArtist() = 0;
00039         virtual ArtistAlias *newArtistAlias() = 0;
00040         virtual Disc *newDisc() = 0;
00041         virtual Track *newTrack() = 0;
00042         virtual Relation *newRelation() = 0;
00043         virtual Release *newRelease() = 0;
00044         virtual ReleaseGroup *newReleaseGroup() = 0;
00045         virtual ReleaseEvent *newReleaseEvent() = 0;
00046         virtual User *newUser() = 0;
00047         virtual Tag *newTag() = 0;
00048         virtual Label *newLabel() = 0;
00049         virtual LabelAlias *newLabelAlias() = 0;
00050     };
00051 
00057     class MB_API DefaultFactory : public IFactory 
00058     {
00059     public:
00060         virtual Artist *newArtist() { return new Artist(); };
00061         virtual ArtistAlias *newArtistAlias() { return new ArtistAlias(); };
00062         virtual Disc *newDisc() { return new Disc(); };
00063         virtual Track *newTrack() { return new Track(); };
00064         virtual Relation *newRelation() { return new Relation(); };
00065         virtual Release *newRelease() { return new Release(); };
00066         virtual ReleaseGroup *newReleaseGroup() { return new ReleaseGroup(); };
00067         virtual ReleaseEvent *newReleaseEvent() { return new ReleaseEvent(); };
00068         virtual User *newUser() { return new User(); };
00069         virtual Tag *newTag() { return new Tag(); };
00070         virtual Label *newLabel() { return new Label(); };
00071         virtual LabelAlias *newLabelAlias() { return new LabelAlias(); };
00072     };
00073     
00074 }
00075 
00076 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines