]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
Fixes for bug #12
[user/henk/code/inspircd.git] / include / typedefs.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef TYPEDEF_H
15 #define TYPEDEF_H
16
17 class BanCacheManager;
18 class BanItem;
19 class BufferedSocket;
20 class Channel;
21 class Command;
22 class ConfigReader;
23 class ConfigTag;
24 class DNSHeader;
25 class DNSRequest;
26 class Extensible;
27 class FakeUser;
28 class InspIRCd;
29 class LocalUser;
30 class Membership;
31 class Module;
32 class OperInfo;
33 class RemoteUser;
34 class ServerConfig;
35 class ServerLimits;
36 class Thread;
37 class User;
38 class UserResolver;
39 class XLine;
40 class XLineManager;
41 class XLineFactory;
42 struct ConnectClass;
43 struct ModResult;
44 struct ResourceRecord;
45
46 #include "hashcomp.h"
47 #include "base.h"
48
49 #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
50         typedef nspace::hash_map<std::string, User*, nspace::hash_compare<std::string, std::less<std::string> > > user_hash;
51         typedef nspace::hash_map<std::string, Channel*, nspace::hash_compare<std::string, std::less<std::string> > > chan_hash;
52 #else
53         #ifdef HASHMAP_DEPRECATED
54                 typedef nspace::hash_map<std::string, User*, nspace::insensitive, irc::StrHashComp> user_hash;
55                 typedef nspace::hash_map<std::string, Channel*, nspace::insensitive, irc::StrHashComp> chan_hash;
56         #else
57                 typedef nspace::hash_map<std::string, User*, nspace::hash<std::string>, irc::StrHashComp> user_hash;
58                 typedef nspace::hash_map<std::string, Channel*, nspace::hash<std::string>, irc::StrHashComp> chan_hash;
59         #endif
60 #endif
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< std::pair<irc::string, time_t> > InvitedList;
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 std::set<Channel*> UserChanList;
76
77 /** Shorthand for an iterator into a UserChanList
78  */
79 typedef UserChanList::iterator UCListIter;
80
81 /** Holds a complete ban list
82  */
83 typedef std::vector<BanItem> BanList;
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 nspace::hash_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;
153
154
155 #endif
156