]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
b19426b6a516305aa5a99358409a0a5f7b8fe1fb
[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 #pragma once
23
24 class BanCacheManager;
25 class BanItem;
26 class BufferedSocket;
27 class Channel;
28 class Command;
29 class ConfigReader;
30 class ConfigTag;
31 class DNSHeader;
32 class DNSRequest;
33 class Extensible;
34 class FakeUser;
35 class InspIRCd;
36 class Invitation;
37 class InviteBase;
38 class LocalUser;
39 class Membership;
40 class Module;
41 class OperInfo;
42 class RemoteUser;
43 class ServerConfig;
44 class ServerLimits;
45 class Thread;
46 class User;
47 class UserResolver;
48 class XLine;
49 class XLineManager;
50 class XLineFactory;
51 struct ConnectClass;
52 struct ModResult;
53 struct ResourceRecord;
54
55 #include "hashcomp.h"
56 #include "base.h"
57
58 typedef TR1NS::unordered_map<std::string, User*, irc::insensitive, irc::StrHashComp> user_hash;
59 typedef TR1NS::unordered_map<std::string, Channel*, irc::insensitive, irc::StrHashComp> chan_hash;
60
61 /** A list holding local users, this is the type of UserManager::local_users
62  */
63 typedef std::list<LocalUser*> LocalUserList;
64
65 /** A list of failed port bindings, used for informational purposes on startup */
66 typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
67
68 /** 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.
69  */
70 typedef std::vector<Invitation*> InviteList;
71
72 /** Holds a complete list of all allow and deny tags from the configuration file (connection classes)
73  */
74 typedef std::vector<reference<ConnectClass> > ClassVector;
75
76 /** Typedef for the list of user-channel records for a user
77  */
78 typedef std::set<Channel*> UserChanList;
79
80 /** Shorthand for an iterator into a UserChanList
81  */
82 typedef UserChanList::iterator UCListIter;
83
84 /** Holds a complete ban list
85  */
86 typedef std::vector<BanItem> BanList;
87
88 /** A list of custom modes parameters on a channel
89  */
90 typedef std::map<char,std::string> CustomModeList;
91
92 /** A cached text file stored with its contents as lines
93  */
94 typedef std::vector<std::string> file_cache;
95
96 /** A configuration key and value pair
97  */
98 typedef std::pair<std::string, std::string> KeyVal;
99
100 /** The entire configuration
101  */
102 typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash;
103
104 /** Iterator of ConfigDataHash */
105 typedef ConfigDataHash::const_iterator ConfigIter;
106 /** Iterator pair, used for tag-name ranges */
107 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
108
109 /** Index of valid oper blocks and types */
110 typedef std::map<std::string, reference<OperInfo> > OperIndex;
111
112 /** Files read by the configuration */
113 typedef std::map<std::string, file_cache> ConfigFileCache;
114
115 /** A hash of commands used by the core
116  */
117 typedef TR1NS::unordered_map<std::string, Command*> Commandtable;
118
119 /** Membership list of a channel */
120 typedef std::map<User*, Membership*> UserMembList;
121 /** Iterator of UserMembList */
122 typedef UserMembList::iterator UserMembIter;
123 /** const Iterator of UserMembList */
124 typedef UserMembList::const_iterator UserMembCIter;
125
126 /** Generic user list, used for exceptions */
127 typedef std::set<User*> CUList;
128
129 /** A set of strings.
130  */
131 typedef std::vector<std::string> string_list;
132
133 /** Contains an ident and host split into two strings
134  */
135 typedef std::pair<std::string, std::string> IdentHostPair;
136
137 /** A map of xline factories
138  */
139 typedef std::map<std::string, XLineFactory*> XLineFactMap;
140
141 /** A map of XLines indexed by string
142  */
143 typedef std::map<irc::string, XLine *> XLineLookup;
144
145 /** A map of XLineLookup maps indexed by string
146  */
147 typedef std::map<std::string, XLineLookup > XLineContainer;
148
149 /** An iterator in an XLineContainer
150  */
151 typedef XLineContainer::iterator ContainerIter;
152
153 /** An interator in an XLineLookup
154  */
155 typedef XLineLookup::iterator LookupIter;