Added a EditorSocial.
[UnsignedByte.git] / src / Resource / Types.h
blob2da2f57d3d88215fcc16561bbf415ca1d47b33f5
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 ***************************************************************************/
21 #pragma once
23 /**
24 * @file Types.h
25 * This file contains all type definitions.
26 */
28 //NOSORT
30 #include <string>
31 #include <vector>
32 #include <map>
33 #include <stdexcept>
34 #include <set>
36 #include <sqlite3.h>
38 /** The type used to store database keys. */
39 typedef unsigned long value_type;
41 /** The type to store multiple database keys with. */
42 typedef std::set<value_type> value_types;
44 /** The type of a constant string reference. */
45 typedef const std::string& cstring;
47 /** The type of multiple non-const strings. */
48 typedef std::vector<std::string> Strings;
50 #include "smart_ptr.h"
51 #include "singleton.h"
52 #include "Exceptions.h"
53 #include "Assert.h"
55 class Table;
56 typedef SmartPtr<Table> TablePtr; /**< The type of a pointer to a table. */
57 typedef std::vector<TablePtr> TableVector; /**< The type of multiple table pointers. */
59 class TableDef;
60 typedef SmartPtr<TableDef> TableDefPtr; /**< The type of a pointer to a table def. */
61 typedef std::vector<TableDefPtr> TableDefVector; /**< The type of multiple table def pointers. */
63 class TableImpl;
64 typedef SmartPtr<TableImpl> TableImplPtr; /**< The type of a pointer to a table impl. */
65 typedef std::vector<TableImplPtr> TableImplVector; /**< The type of multiple table impl pointers. */
67 class KeyDef;
68 typedef SmartPtr<KeyDef> KeyDefPtr; /**< The type of a pointer to a key def. */
69 typedef std::vector<KeyDefPtr> KeyDefs; /**< The type of multiple key def pointers. */
71 class KeyImpl;
72 typedef SmartPtr<KeyImpl> KeyImplPtr; /**< The type of a pointer to a key impl. */
73 typedef std::vector<KeyImplPtr> KeyImpls; /**< The type of multiple key impl pointers. */
75 class KeyValue;
76 typedef SmartPtr<KeyValue> KeyValuePtr; /**< The type of a pointer to a key value. */
78 class Field;
79 typedef SmartPtr<Field> FieldPtr; /**< The type of a pointer to a field. */
80 typedef std::vector<FieldPtr> FieldVector; /**< The type multiple field pointers. */
82 class FieldDef;
83 typedef SmartPtr<FieldDef> FieldDefPtr; /**< The type of a pointer to a field def. */
84 typedef std::vector<FieldDefPtr> FieldDefVector; /**< The type of multiple field def pointers. */
86 class FieldImpl;
87 typedef SmartPtr<FieldImpl> FieldImplPtr; /**< The type of a pointer to a field impl. */
88 typedef std::vector<FieldImplPtr> FieldImplVector; /**< The type of multiple field impl pointers. */
90 class FieldValue;
91 typedef SmartPtr<FieldValue> ValuePtr; /**< The type of a pointer to a value. */
92 typedef SmartPtr<FieldValue> FieldValuePtr; /**< A more descriptive name of of the type of a pointer to a value. */
95 /**
96 * The type of a map from foreign key name to Table.
98 * @deprecated Use KeyDefs instead.
99 * @see KeyDefs
101 typedef std::map<std::string, TablePtr> TableMap;
103 /** The type of a map from KeyImpl pointers to KeyValue pointers. */
104 typedef std::map<KeyImpl*, KeyValuePtr> KeyImplMap;
106 /** The type of a map from FieldImpl pointers to Value pointers. */
107 typedef std::map<FieldImpl*, ValuePtr> FieldValueMap;
109 /** The type of a map from FieldImpl poinntiers to Value pointers. */
110 typedef std::map<FieldImpl*, ValuePtr> ValueMap;
113 class Keys;
114 typedef SmartPtr<Keys> KeysPtr; /**< The type of a pointer to a keys bucket. */
116 class FieldValues;
117 typedef SmartPtr<FieldValues> ValuesPtr; /**< The type of a pointer to a values bucket. */
118 typedef SmartPtr<FieldValues> FieldValuesPtr; /**< A more precise name for the type of a pointer to a values bucket. */
120 class SavableManagers;
121 typedef SmartPtr<SavableManagers> SavableManagersPtr; /**< The type of a pointer to a savable managers bucket. */
124 class SavableManager;
125 typedef SmartPtr<SavableManager> SavableManagerPtr; /**< The type of a pointer to a savable manager. */
126 typedef std::vector<SavableManagerPtr> SavableManagerVector; /**< The type of multiple savable manager pointers. */
128 class SelectionMask;
129 typedef SmartPtr<SelectionMask> SelectionMaskPtr; /**< The type of a pointer to a selection mask. */
131 class Relation;
132 typedef SmartPtr<Relation> RelationPtr; /**< The type of a pointer to a relation. */
133 typedef std::vector<RelationPtr> Relations; /**< The type of multiple relation pointers. */
135 class Join;
136 typedef SmartPtr<Join> JoinPtr; /**< The type of a pointer to a join. */
137 typedef std::vector<JoinPtr> Joins; /**< The type of multiple join pointers. */
139 class Actor;
140 typedef SmartPtr<Actor> ActorPtr; /**< The type of a pointer to an actor. */
142 class UBSocket;
144 class Savable;
145 typedef SmartPtr<Savable> SavablePtr; /**< The type of a pointer to a Savable. */