]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
e737906671b1197346d32abb8e7804178bc68f61
[user/henk/code/inspircd.git] / include / typedefs.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5  *   Copyright (C) 2005, 2008 Craig Edwards <craigedwards@brainbox.cc>
6  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7  *
8  * This file is part of InspIRCd.  InspIRCd is free software: you can
9  * redistribute it and/or modify it under the terms of the GNU General Public
10  * License as published by the Free Software Foundation, version 2.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21
22 #ifndef TYPEDEFS_H
23 #define TYPEDEFS_H
24
25 class BanCacheManager;
26 class BanItem;
27 class BufferedSocket;
28 class Channel;
29 class Command;
30 class ConfigReader;
31 class ConfigTag;
32 class DNSHeader;
33 class DNSRequest;
34 class Extensible;
35 class FakeUser;
36 class InspIRCd;
37 class Invitation;
38 class InviteBase;
39 class LocalUser;
40 class Membership;
41 class Module;
42 class OperInfo;
43 class RemoteUser;
44 class ServerConfig;
45 class ServerLimits;
46 class Thread;
47 class User;
48 class UserResolver;
49 class XLine;
50 class XLineManager;
51 class XLineFactory;
52 struct ConnectClass;
53 struct ModResult;
54 struct ResourceRecord;
55
56 #include "hashcomp.h"
57 #include "base.h"
58
59 typedef std::tr1::unordered_map<std::string, User*, std::tr1::insensitive, irc::StrHashComp> user_hash;
60 typedef std::tr1::unordered_map<std::string, Channel*, std::tr1::insensitive, irc::StrHashComp> chan_hash;
61
62 /** A list holding local users, this is the type of UserManager::local_users
63  */
64 typedef std::list<LocalUser*> LocalUserList;
65
66 /** A list of failed port bindings, used for informational purposes on startup */
67 typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
68
69 /** Holds a complete list of all channels to which a user has been invited and has not yet joined, and the time at which they'll expire.
70  */
71 typedef std::vector<Invitation*> InviteList;
72
73 /** Holds a complete list of all allow and deny tags from the configuration file (connection classes)
74  */
75 typedef std::vector<reference<ConnectClass> > ClassVector;
76
77 /** Typedef for the list of user-channel records for a user
78  */
79 typedef std::set<Channel*> UserChanList;
80
81 /** Shorthand for an iterator into a UserChanList
82  */
83 typedef UserChanList::iterator UCListIter;
84
85 /** Holds a complete ban list
86  */
87 typedef std::vector<BanItem> BanList;
88
89 /** A list of custom modes parameters on a channel
90  */
91 typedef std::map<char,std::string> CustomModeList;
92
93 /** A cached text file stored with its contents as lines
94  */
95 typedef std::vector<std::string> file_cache;
96
97 /** A configuration key and value pair
98  */
99 typedef std::pair<std::string, std::string> KeyVal;
100
101 /** The entire configuration
102  */
103 typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash;
104
105 /** Iterator of ConfigDataHash */
106 typedef ConfigDataHash::const_iterator ConfigIter;
107 /** Iterator pair, used for tag-name ranges */
108 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
109
110 /** Index of valid oper blocks and types */
111 typedef std::map<std::string, reference<OperInfo> > OperIndex;
112
113 /** Files read by the configuration */
114 typedef std::map<std::string, file_cache> ConfigFileCache;
115
116 /** A hash of commands used by the core
117  */
118 typedef std::tr1::unordered_map<std::string,Command*> Commandtable;
119
120 /** Membership list of a channel */
121 typedef std::map<User*, Membership*> UserMembList;
122 /** Iterator of UserMembList */
123 typedef UserMembList::iterator UserMembIter;
124 /** const Iterator of UserMembList */
125 typedef UserMembList::const_iterator UserMembCIter;
126
127 /** Generic user list, used for exceptions */
128 typedef std::set<User*> CUList;
129
130 /** A set of strings.
131  */
132 typedef std::vector<std::string> string_list;
133
134 /** Contains an ident and host split into two strings
135  */
136 typedef std::pair<std::string, std::string> IdentHostPair;
137
138 /** A map of xline factories
139  */
140 typedef std::map<std::string, XLineFactory*> XLineFactMap;
141
142 /** A map of XLines indexed by string
143  */
144 typedef std::map<irc::string, XLine *> XLineLookup;
145
146 /** A map of XLineLookup maps indexed by string
147  */
148 typedef std::map<std::string, XLineLookup > XLineContainer;
149
150 /** An iterator in an XLineContainer
151  */
152 typedef XLineContainer::iterator ContainerIter;
153
154 /** An interator in an XLineLookup
155  */
156 typedef XLineLookup::iterator LookupIter;
157
158
159 #endif
160