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 8466 2006-09-05 08:59:44Z 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 }; 00047 00053 class MB_API DefaultFactory : public IFactory 00054 { 00055 public: 00056 virtual Artist *newArtist() { return new Artist(); }; 00057 virtual ArtistAlias *newArtistAlias() { return new ArtistAlias(); }; 00058 virtual Disc *newDisc() { return new Disc(); }; 00059 virtual Track *newTrack() { return new Track(); }; 00060 virtual Relation *newRelation() { return new Relation(); }; 00061 virtual Release *newRelease() { return new Release(); }; 00062 virtual ReleaseEvent *newReleaseEvent() { return new ReleaseEvent(); }; 00063 virtual User *newUser() { return new User(); }; 00064 }; 00065 00066 } 00067 00068 #endif