Rev 1963 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1963 | Rev 1986 | ||
|---|---|---|---|
| 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 | typedef boost::signals2::signal<void( |
47 | typedef boost::signals2::signal<void(SocketId, ClientState)> SignalOnNewState; |
| - | 48 | typedef boost::signals2::signal<void(SocketId, SocketId)> SignalOnNewClient; |
|
| 48 | typedef boost::signals2::signal<void( |
49 | typedef boost::signals2::signal<void(SocketId, common::Byteset)> SignalOnNewData; |
| 49 | 50 | ||
| 50 | virtual ~Manager(); |
51 | virtual ~Manager(); |
| 51 | 52 | ||
| 52 | static Pointer Instance(); |
53 | static Pointer Instance(); |
| 53 | static void Create(); |
54 | static void Create(); |
| 54 | static void Delete(); |
55 | static void Delete(); |
| 55 | 56 | ||
| 56 | void ConnectSlots(const SignalOnNewState::slot_type& slot_on_new_state, const SignalOnNewData::slot_type& slot_on_new_data); |
57 | void ConnectSlots(const SignalOnNewState::slot_type& slot_on_new_state, const SignalOnNewClient::slot_type& slot_on_new_client, const SignalOnNewData::slot_type& slot_on_new_data); |
| 57 | 58 | ||
| 58 | SocketId StartServer(Protocol protocol, unsigned int port); |
59 | SocketId StartServer(Protocol protocol, unsigned int port); |
| 59 | SocketId Connect(Protocol protocol, std::string address, unsigned int port_or_baud); |
60 | SocketId Connect(Protocol protocol, std::string address, unsigned int port_or_baud); |
| 60 | 61 | ||
| 61 | void StopServer(SocketId server_id); |
62 | void StopServer(SocketId server_id); |
| Line 71... | Line 72... | ||
| 71 | static Pointer instance_; |
72 | static Pointer instance_; |
| 72 | 73 | ||
| 73 | ClientList clients_; |
74 | ClientList clients_; |
| 74 | ServerList servers_; |
75 | ServerList servers_; |
| 75 | SignalOnNewState signal_on_new_state_; |
76 | SignalOnNewState signal_on_new_state_; |
| - | 77 | SignalOnNewClient signal_on_new_client_; |
|
| 76 | SignalOnNewData signal_on_new_data_; |
78 | SignalOnNewData signal_on_new_data_; |
| 77 | 79 | ||
| 78 | Manager(); |
80 | Manager(); |
| 79 | 81 | ||
| 80 | void SlotOnNewState(SocketId client_id, SocketId server_id, ClientState client_state); |
82 | void SlotOnNewState(SocketId client_id, SocketId server_id, ClientState client_state); |