]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
Merge branch 'insp20' into master.
[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 IOHookProvider;
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 namespace ClientProtocol
53 {
54         class Event;
55         class EventProvider;
56         class Message;
57         class MessageTagProvider;
58         class Serializer;
59
60         typedef std::vector<Message*> MessageList;
61         typedef std::vector<std::string> ParamList;
62         typedef std::string SerializedMessage;
63
64         struct MessageTagData
65         {
66                 MessageTagProvider* tagprov;
67                 std::string value;
68                 void* provdata;
69
70                 MessageTagData(MessageTagProvider* prov, const std::string& val, void* data = NULL);
71         };
72
73         /** Map of message tag values and providers keyed by their name.
74          * Sorted in descending order to ensure tag names beginning with symbols (such as '+') come later when iterating
75          * the container than tags with a normal name.
76          */
77         typedef insp::flat_map<std::string, MessageTagData, std::greater<std::string> > TagMap;
78 }
79
80 #include "hashcomp.h"
81 #include "base.h"
82
83 typedef TR1NS::unordered_map<std::string, User*, irc::insensitive, irc::StrHashComp> user_hash;
84 typedef TR1NS::unordered_map<std::string, Channel*, irc::insensitive, irc::StrHashComp> chan_hash;
85
86 /** List of channels to consider when building the neighbor list of a user
87  */
88 typedef std::vector<Membership*> IncludeChanList;
89
90 /** A cached text file stored with its contents as lines
91  */
92 typedef std::vector<std::string> file_cache;
93
94 /** A mapping of configuration keys to their assigned values.
95  */
96 typedef insp::flat_map<std::string, std::string, irc::insensitive_swo> ConfigItems;
97
98 /** The entire configuration
99  */
100 typedef std::multimap<std::string, reference<ConfigTag>, irc::insensitive_swo> ConfigDataHash;
101
102 /** Iterator of ConfigDataHash */
103 typedef ConfigDataHash::const_iterator ConfigIter;
104 /** Iterator pair, used for tag-name ranges */
105 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
106
107 /** Files read by the configuration */
108 typedef std::map<std::string, file_cache> ConfigFileCache;
109
110 /** Generic user list, used for exceptions */
111 typedef std::set<User*> CUList;
112
113 /** Contains an ident and host split into two strings
114  */
115 typedef std::pair<std::string, std::string> IdentHostPair;
116
117 /** A map of xline factories
118  */
119 typedef std::map<std::string, XLineFactory*> XLineFactMap;
120
121 /** A map of XLines indexed by string
122  */
123 typedef std::map<std::string, XLine*, irc::insensitive_swo> XLineLookup;
124
125 /** A map of XLineLookup maps indexed by string
126  */
127 typedef std::map<std::string, XLineLookup > XLineContainer;
128
129 /** An iterator in an XLineContainer
130  */
131 typedef XLineContainer::iterator ContainerIter;
132
133 /** An interator in an XLineLookup
134  */
135 typedef XLineLookup::iterator LookupIter;
136
137 namespace Stats
138 {
139         class Context;
140 }