828a09e9c62340c7f7a2c7eaa178a1670daf4518
[clinton/bobotpp.git] / source / DCCManager.H
1 // DCCManager.H -*- C++ -*-
2 // Copyright (c) 2002 Clinton Ebadi
3
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // any later version.
8
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 #ifndef DCC_MANAGER_H
19 #define DCC_MANAGER_H
20
21 #include <map>
22 #include <list>
23 #include "DCCPerson.H"
24 #include "DCCConnection.H"
25 #include "UserCommands.H"
26 #include "String.H"
27
28 typedef std::map<String, DCCPerson*, std::less<String> > DCC_MAP;
29
30 // Manages all active DCC connections and allows you to send a message
31 // to each one using the string representation of the user's address
32 class DCCManager
33 {
34 DCC_MAP dcc_map;
35 public:
36 void addConnection (DCCConnection*);
37 bool sendMessage (String, String);
38 void checkStale ();
39 #ifdef _HPUX_SOURCE
40 void checkInput (int);
41 #else
42 void checkInput (fd_set);
43 #endif
44 ~DCCManager ();
45
46 friend class Bot;
47 friend void
48 UserCommands::DCCList (ServerConnection *, Person *,
49 String, String);
50 };
51
52 #endif