Added count functionality in SavableManager.
[UnsignedByte.git] / src / DAL / Tables.h
blob8386c842cc357cdea7205f0266f2adf2758160a9
1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 /**
23 * @file Tables.h
24 * @brief This file contains the Tables class.
26 * @see Tables
27 */
29 #include "Types.h"
31 /**
32 * This class serves as a storage for pointers to all defined Tables.
34 * Since C++ does not offer reflection this class was added as a form of 'manual' reflection.
35 * By making use of the begin() and end() iterator the generator is able to iterate over all defined fiels.
36 * As such, when adding a table, you should add <code>m_tables.push_back(YOURTABLE)</code> at the bottom of the contructor.
37 */
38 class Tables : public Singleton<Tables>
40 public:
41 TableDefPtr ACCOUNTS; /**< The Accounts table. */
42 TableDefPtr AREAS; /**< The Areas table, part of the Room system. */
43 TableDefPtr BRANCHES; /**< The Branches table, part of the Skill system. */
44 TableDefPtr CHANNELS; /**< The Channels table, the communication channels are stored here. */
45 TableDefPtr CHARACTERACCOUNT; /**< The Character - Accounts relational table. */
46 TableDefPtr CHARACTERBRANCH; /**< The Character - Branch relational table. */
47 TableDefPtr CHARACTERCLUSTER; /**< The Character - Cluster relational table. */
48 TableDefPtr CHARACTERSKILL; /**< The Character - Skill relational table. */
49 TableDefPtr CHARACTERSTAT; /**< The Character - Stat relational table. */
50 TableDefPtr CHARACTERTREE; /**< The Character - Tree relational table. */
51 TableDefPtr CHUNKS; /**< The Chunks table, part of the Room system. */
52 TableDefPtr CLUSTERS; /**< The Clusters table, part of the Room system. */
53 TableDefPtr COLOURS; /**< The Colours table, the colours are stored here. */
54 TableDefPtr COMMANDS; /**< The Commands table, part of the Command system. */
55 TableDefPtr DETAILS; /**< The Details table, part of the Room system. */
56 TableDefPtr DETAILAREA; /**< The Detail - Area relational table, part of the Room system. */
57 TableDefPtr DETAILROOM; /**< The Detail - Room relational table, part of the Room system. */
58 TableDefPtr DETAILCHUNK; /**< The Detail - Chunk relational table, part of the Room system. */
59 TableDefPtr DETAILCHARACTER; /**< The Detail - Character relational table, part of the Room system. */
60 TableDefPtr DETAILDETAIL; /**< The Detail - Detail relational table, part of the Room system. */
61 TableDefPtr ECHOS; /**< The Echos table, part of the Room system. */
62 TableDefPtr ENTITIES; /**< The Entities table, all players, mobiles and objects are stored here. */
63 TableDefPtr EXITROOM; /**< The Exit - Room relational table, part of the Room system. */
64 TableDefPtr EXITS; /**< The Exits table, part of the Room system. */
65 TableDefPtr GRANTGROUPS; /**< The Grantgroups table, part of the Command system. */
66 TableDefPtr PERMISSIONS; /**< The Permissions table, part of the Command system. */
67 TableDefPtr RACES; /**< The Races table, part of the Character system. */
68 TableDefPtr ROOMS; /**< The Rooms table, part of the Room system. */
69 TableDefPtr SECTORS; /**< The Sectors table, part of the Room system. */
70 TableDefPtr SKILLS; /**< The Skills table, part of the Skill system. */
71 TableDefPtr STATS; /**< The Skills table, part of the Skill system. */
72 TableDefPtr TRACES; /**< The Traces table, part of the Trace system. */
73 TableDefPtr TRACECHUNK; /**< The Trace - Chunk relational table, part of the Trace system. */
74 TableDefPtr TRACEDETAIL; /**< The Trace - Detail relational table, part of the Trace system. */
75 TableDefPtr TRACEENTITY; /**< The Trace - Entity relational table, part of the Trace system. */
76 TableDefPtr TRACEROOM; /**< The Trace - Room relational table, part of the Trace system. */
77 TableDefPtr TREES; /**< The Trees table, part of the Skill system. */
78 TableDefPtr VERSION; /**< The Version table, it contains one row, the current version. */
80 /** @brief Returns an iterator to the beginning of m_tables. */
81 TableDefVector::const_iterator begin() const { return m_tables.begin(); }
83 /** @brief Returns an iterator to the end of m_tables. */
84 TableDefVector::const_iterator end() const { return m_tables.end(); }
86 private:
87 friend class Singleton<Tables>;
89 /** This is a singleton class, use <code>Get</code> to get an instance. */
90 Tables();
92 /** This is a singleton class, use <code>Free</code> to free the instance. */
93 ~Tables();
95 TableDefVector m_tables; /**< A member containing al the tables. */