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