1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
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. *
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. *
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 ***************************************************************************/
24 * This file contains the Tables class.
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.
38 class Tables
: public Singleton
<Tables
>
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 CHANNELLOGS
; /**< The logs of the channels, -not- a relational table! */
46 TableDefPtr CHARACTERACCOUNT
; /**< The Character - Accounts relational table. */
47 TableDefPtr CHARACTERBRANCH
; /**< The Character - Branch relational table. */
48 TableDefPtr CHARACTERCLUSTER
; /**< The Character - Cluster relational table. */
49 TableDefPtr CHARACTERSKILL
; /**< The Character - Skill relational table. */
50 TableDefPtr CHARACTERSTAT
; /**< The Character - Stat relational table. */
51 TableDefPtr CHARACTERTREE
; /**< The Character - Tree relational table. */
52 TableDefPtr CHUNKS
; /**< The Chunks table, part of the Room system. */
53 TableDefPtr CLUSTERS
; /**< The Clusters table, part of the Room system. */
54 TableDefPtr COLOURS
; /**< The Colours table, the colours are stored here. */
55 TableDefPtr COMMANDS
; /**< The Commands table, part of the Command system. */
56 TableDefPtr DETAILS
; /**< The Details table, part of the Room system. */
57 TableDefPtr DETAILAREA
; /**< The Detail - Area relational table, part of the Room system. */
58 TableDefPtr DETAILROOM
; /**< The Detail - Room relational table, part of the Room system. */
59 TableDefPtr DETAILCHUNK
; /**< The Detail - Chunk relational table, part of the Room system. */
60 TableDefPtr DETAILCHARACTER
; /**< The Detail - Character relational table, part of the Room system. */
61 TableDefPtr DETAILDETAIL
; /**< The Detail - Detail relational table, part of the Room system. */
62 TableDefPtr ECHOS
; /**< The Echos table, part of the Room system. */
63 TableDefPtr ENTITIES
; /**< The Entities table, all players, mobiles and objects are stored here. */
64 TableDefPtr EXITS
; /**< The Exits table, part of the Room system. */
65 TableDefPtr GRANTGROUPS
; /**< The Grantgroups table, part of the Command system. */
66 TableDefPtr LOGS
; /**< The Logs table, it contains all the logs. */
67 TableDefPtr PERMISSIONS
; /**< The Permissions table, part of the Command system. */
68 TableDefPtr RACES
; /**< The Races table, part of the Character system. */
69 TableDefPtr ROOMS
; /**< The Rooms table, part of the Room system. */
70 TableDefPtr SECTORS
; /**< The Sectors table, part of the Room system. */
71 TableDefPtr SKILLS
; /**< The Skills table, part of the Skill system. */
72 TableDefPtr STATS
; /**< The Skills table, part of the Skill system. */
73 TableDefPtr TRACES
; /**< The Traces table, part of the Trace system. */
74 TableDefPtr TRACECHUNK
; /**< The Trace - Chunk relational table, part of the Trace system. */
75 TableDefPtr TRACEDETAIL
; /**< The Trace - Detail relational table, part of the Trace system. */
76 TableDefPtr TRACEENTITY
; /**< The Trace - Entity relational table, part of the Trace system. */
77 TableDefPtr TRACEROOM
; /**< The Trace - Room relational table, part of the Trace system. */
78 TableDefPtr TREES
; /**< The Trees table, part of the Skill system. */
79 TableDefPtr VERSION
; /**< The Version table, it contains one row, the current version. */
81 /** Returns an iterator to the beginning of m_tables. */
82 TableDefVector::const_iterator
begin() const { return m_tables
.begin(); }
84 /** Returns an iterator to the end of m_tables. */
85 TableDefVector::const_iterator
end() const { return m_tables
.end(); }
88 friend class Singleton
<Tables
>;
90 /** This is a singleton class, use <code>Get</code> to get an instance. */
93 /** This is a singleton class, use <code>Free</code> to free the instance. */
96 TableDefVector m_tables
; /**< A member containing al the tables. */