Rev 1592 | Rev 1595 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1592 | Rev 1593 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | #include <string> |
24 | #include <string> |
| 25 | #include <map> |
25 | #include <map> |
| 26 | 26 | ||
| 27 | #include <boost/asio.hpp> |
27 | #include <boost/asio.hpp> |
| 28 | #include <boost/signals2.hpp> |
28 | #include <boost/signals2.hpp> |
| 29 | #include <boost/ |
29 | #include <boost/shared_ptr.hpp> |
| 30 | #include <boost/thread.hpp> |
30 | #include <boost/thread.hpp> |
| 31 | #include <boost/thread/mutex.hpp> |
31 | #include <boost/thread/mutex.hpp> |
| 32 | 32 | ||
| 33 | #include "Types.h" |
33 | #include "Types.h" |
| 34 | #include "Client.h" |
34 | #include "Client.h" |
| Line 42... | Line 42... | ||
| 42 | class Manager |
42 | class Manager |
| 43 | { |
43 | { |
| 44 | public: |
44 | public: |
| 45 | typedef boost::shared_ptr<Manager> Pointer; |
45 | typedef boost::shared_ptr<Manager> Pointer; |
| 46 | 46 | ||
| 47 | typedef boost::signals2::signal<void(ClientId, ClientState)> SignalOnNewState; |
47 | typedef boost::signals2::signal<void(ClientId, ServerId, ClientState)> SignalOnNewState; |
| 48 | typedef boost::signals2::signal<void(ClientId, |
48 | typedef boost::signals2::signal<void(ClientId, ServerId, Buffer)> SignalOnNewData; |
| 49 | 49 | ||
| 50 | virtual ~Manager(); |
50 | virtual ~Manager(); |
| 51 | 51 | ||
| 52 | static Pointer Instance(); |
52 | static Pointer Instance(); |
| 53 | static void Delete(); |
53 | static void Delete(); |
| Line 78... | Line 78... | ||
| 78 | SignalOnNewState signal_on_new_state_; |
78 | SignalOnNewState signal_on_new_state_; |
| 79 | SignalOnNewData signal_on_new_data_; |
79 | SignalOnNewData signal_on_new_data_; |
| 80 | 80 | ||
| 81 | Manager(); |
81 | Manager(); |
| 82 | 82 | ||
| 83 | void SlotOnNewState(ClientId client_id, ClientState client_state); |
83 | void SlotOnNewState(ClientId client_id, ServerId server_id, ClientState client_state); |
| 84 | void SlotOnNewData(ClientId client_id, Buffer data); |
84 | void SlotOnNewData(ClientId client_id, ServerId server_id, Buffer data); |
| 85 | 85 | ||
| 86 | void StopServerHandler(ServerId server_id); |
86 | void StopServerHandler(ServerId server_id); |
| 87 | void DisconnectHandler(ClientId client_id); |
87 | void DisconnectHandler(ClientId client_id); |
| 88 | 88 | ||
| 89 | void SendToAllHandler(ServerId server_id, Buffer data); |
89 | void SendToAllHandler(ServerId server_id, Buffer data); |