1 /***************************************************************************
2 Copyright (C) 2009 Robby Stephenson <robby@periapsis.org>
3 ***************************************************************************/
4
5 /***************************************************************************
6 * *
7 * This program is free software; you can redistribute it and/or *
8 * modify it under the terms of the GNU General Public License as *
9 * published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) version 3 or any later version *
11 * accepted by the membership of KDE e.V. (or its successor approved *
12 * by the membership of KDE e.V.), which shall act as a proxy *
13 * defined in Section 14 of version 3 of the license. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
22 * *
23 ***************************************************************************/
24
25 #include "collectioninitializer.h"
26 #include "../collectionfactory.h"
27 #include "bibtexcollection.h"
28 #include "boardgamecollection.h"
29 #include "bookcollection.h"
30 #include "cardcollection.h"
31 #include "coincollection.h"
32 #include "comicbookcollection.h"
33 #include "filecatalog.h"
34 #include "gamecollection.h"
35 #include "musiccollection.h"
36 #include "stampcollection.h"
37 #include "videocollection.h"
38 #include "winecollection.h"
39
40 /**
41 * Ideally, I'd like these initializations to be in each cpp file for each collection type
42 * but as a static variable, they weren't always being initialized, so do it the manual way.
43 *
44 * But, at the least, collectionfactory is not coupled to every single collection type
45 */
CollectionInitializer()46 Tellico::CollectionInitializer::CollectionInitializer() {
47 RegisterCollection<Data::Collection> registerBase(Data::Collection::Base, "entry");
48 RegisterCollection<Data::BibtexCollection> registerBibtex(Data::Collection::Bibtex, "bibtex");
49 RegisterCollection<Data::BoardGameCollection> registerBoardGame(Data::Collection::BoardGame, "boardgame");
50 RegisterCollection<Data::BookCollection> registerBook(Data::Collection::Book, "book");
51 RegisterCollection<Data::CardCollection> registerCard(Data::Collection::Card, "card");
52 RegisterCollection<Data::CoinCollection> registerCoin(Data::Collection::Coin, "coin");
53 RegisterCollection<Data::ComicBookCollection> registerComic(Data::Collection::ComicBook, "comic");
54 RegisterCollection<Data::FileCatalog> registerFile(Data::Collection::File, "file");
55 RegisterCollection<Data::GameCollection> registerGame(Data::Collection::Game, "game");
56 RegisterCollection<Data::MusicCollection> registerMusic(Data::Collection::Album, "album");
57 RegisterCollection<Data::StampCollection> registerStamp(Data::Collection::Stamp, "stamp");
58 RegisterCollection<Data::VideoCollection> registerVideo(Data::Collection::Video, "video");
59 RegisterCollection<Data::WineCollection> registerWine(Data::Collection::Wine, "wine");
60 }
61