libmusicbrainz3  3.0.2
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  * $Id: factory.h 9218 2007-06-25 20:11:09Z luks $
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 ReleaseEvent *newReleaseEvent() = 0;
00045         virtual User *newUser() = 0;
00046         virtual Tag *newTag() = 0;
00047         virtual Label *newLabel() = 0;
00048         virtual LabelAlias *newLabelAlias() = 0;
00049     };
00050     
00056     class MB_API DefaultFactory : public IFactory 
00057     {
00058     public:
00059         virtual Artist *newArtist() { return new Artist(); };
00060         virtual ArtistAlias *newArtistAlias() { return new ArtistAlias(); };
00061         virtual Disc *newDisc() { return new Disc(); };
00062         virtual Track *newTrack() { return new Track(); };
00063         virtual Relation *newRelation() { return new Relation(); };
00064         virtual Release *newRelease() { return new Release(); };
00065         virtual ReleaseEvent *newReleaseEvent() { return new ReleaseEvent(); };
00066         virtual User *newUser() { return new User(); };
00067         virtual Tag *newTag() { return new Tag(); };
00068         virtual Label *newLabel() { return new Label(); };
00069         virtual LabelAlias *newLabelAlias() { return new LabelAlias(); };
00070     };
00071     
00072 }
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines