| 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, 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 |