Rev 1962 | Rev 1986 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1962 | Rev 1963 | ||
|---|---|---|---|
| Line 42... | Line 42... | ||
| 42 | 42 | ||
| 43 | class Manager : public common::IoService |
43 | class Manager : public common::IoService |
| 44 | { |
44 | { |
| 45 | public: |
45 | public: |
| 46 | typedef boost::shared_ptr<Manager> Pointer; |
46 | typedef boost::shared_ptr<Manager> Pointer; |
| 47 | - | ||
| 48 | typedef boost::signals2::signal<void(SocketId, SocketId, ClientState)> SignalOnNewState; |
47 | typedef boost::signals2::signal<void(SocketId, SocketId, ClientState)> SignalOnNewState; |
| 49 | typedef boost::signals2::signal<void(SocketId, SocketId, common::Byteset)> SignalOnNewData; |
48 | typedef boost::signals2::signal<void(SocketId, SocketId, common::Byteset)> SignalOnNewData; |
| 50 | 49 | ||
| 51 | virtual ~Manager(); |
50 | virtual ~Manager(); |
| 52 | 51 | ||
| 53 | static Pointer Instance(); |
52 | static Pointer Instance(); |
| 54 | static void Create(); |
53 | static void Create(); |
| 55 | static void Delete(); |
54 | static void Delete(); |
| 56 | 55 | ||
| 57 | void ConnectSlots(const SignalOnNewState::slot_type& slot_on_new_state, const SignalOnNewData::slot_type& slot_on_new_data); |
56 | void ConnectSlots(const SignalOnNewState::slot_type& slot_on_new_state, const SignalOnNewData::slot_type& slot_on_new_data); |
| 58 | 57 | ||
| 59 | SocketId StartServer(Protocol protocol, unsigned int port); |
58 | SocketId StartServer(Protocol protocol, unsigned int port); |
| 60 | SocketId Connect(Protocol protocol, std::string address, unsigned int port_or_baud); |
59 | SocketId Connect(Protocol protocol, std::string address, unsigned int port_or_baud); |
| 61 | 60 | ||
| 62 | void StopServer(SocketId server_id); |
61 | void StopServer(SocketId server_id); |
| 63 | void Disconnect(SocketId client_id); |
62 | void Disconnect(SocketId client_id); |
| 64 | 63 | ||
| 65 | void SendToAll(SocketId server_id, common::Byteset data); |
64 | void SendToAll(SocketId server_id, common::Byteset data); |
| 66 | void SendTo(SocketId client_id, common::Byteset data); |
65 | void SendTo(SocketId client_id, common::Byteset data); |
| Line 71... | Line 70... | ||
| 71 | 70 | ||
| 72 | static Pointer instance_; |
71 | static Pointer instance_; |
| 73 | 72 | ||
| 74 | ClientList clients_; |
73 | ClientList clients_; |
| 75 | ServerList servers_; |
74 | ServerList servers_; |
| 76 | - | ||
| 77 | SignalOnNewState signal_on_new_state_; |
75 | SignalOnNewState signal_on_new_state_; |
| 78 | SignalOnNewData signal_on_new_data_; |
76 | SignalOnNewData signal_on_new_data_; |
| 79 | 77 | ||
| 80 | Manager(); |
78 | Manager(); |
| 81 | 79 | ||