Manages connected client ids for a given server. More...
#include <network_manager_ana.hpp>


Public Member Functions | |
| clients_manager (ana::server *) | |
| Constructor. | |
| size_t | client_amount () const |
| Returns the amount of components connected to this server. | |
| void | connected (ana::net_id id) |
| void | remove (ana::net_id id) |
| void | handshaked (ana::net_id id) |
| bool | has_connection_pending () const |
| bool | is_pending_handshake (ana::net_id) const |
| bool | is_a_client (ana::net_id id) const |
| network::connection | get_pending_connection_id () |
Private Member Functions | |
| virtual void | handle_connect (ana::error_code error, ana::net_id client) |
| Handle new connection event. | |
| virtual void | handle_disconnect (ana::error_code, ana::net_id client) |
Private Attributes | |
| ana::server * | server_ |
| std::set< ana::net_id > | ids_ |
| std::set< network::connection > | pending_ids_ |
| std::set< ana::net_id > | pending_handshakes_ |
Manages connected client ids for a given server.
Definition at line 131 of file network_manager_ana.hpp.
| clients_manager::clients_manager | ( | ana::server * | server | ) |
Constructor.
Definition at line 515 of file network_manager_ana.cpp.
| size_t clients_manager::client_amount | ( | ) | const |
Returns the amount of components connected to this server.
Definition at line 523 of file network_manager_ana.cpp.
References ids_.
| void clients_manager::connected | ( | ana::net_id | id | ) |
Definition at line 543 of file network_manager_ana.cpp.
References pending_ids_.
Referenced by ana_handshake_finisher_handler::handle_send().

| network::connection clients_manager::get_pending_connection_id | ( | ) |
Definition at line 576 of file network_manager_ana.cpp.
References pending_ids_.
Referenced by ana_network_manager::new_connection_id().

| void clients_manager::handle_connect | ( | ana::error_code | , | |
| ana::net_id | ||||
| ) | [private, virtual] |
Handle new connection event.
| error_code | : Error code of the event. | |
| net_id | : ID of the client that connects. |
Implements ana::connection_handler.
Definition at line 528 of file network_manager_ana.cpp.
References ids_, and pending_handshakes_.
| void clients_manager::handle_disconnect | ( | ana::error_code | , | |
| ana::net_id | client | |||
| ) | [private, virtual] |
Definition at line 537 of file network_manager_ana.cpp.
References ids_, and pending_ids_.
| void clients_manager::handshaked | ( | ana::net_id | id | ) |
Definition at line 556 of file network_manager_ana.cpp.
References pending_handshakes_.
| bool clients_manager::has_connection_pending | ( | ) | const |
Definition at line 561 of file network_manager_ana.cpp.
References pending_ids_.
Referenced by ana_network_manager::new_connection_id().

| bool clients_manager::is_a_client | ( | ana::net_id | id | ) | const |
Definition at line 571 of file network_manager_ana.cpp.
References ids_.
| bool clients_manager::is_pending_handshake | ( | ana::net_id | id | ) | const |
Definition at line 566 of file network_manager_ana.cpp.
References pending_handshakes_.
| void clients_manager::remove | ( | ana::net_id | id | ) |
Definition at line 548 of file network_manager_ana.cpp.
References ids_, pending_handshakes_, and pending_ids_.
std::set< ana::net_id > clients_manager::ids_ [private] |
Definition at line 161 of file network_manager_ana.hpp.
Referenced by client_amount(), handle_connect(), handle_disconnect(), is_a_client(), and remove().
std::set< ana::net_id > clients_manager::pending_handshakes_ [private] |
Definition at line 163 of file network_manager_ana.hpp.
Referenced by handle_connect(), handshaked(), is_pending_handshake(), and remove().
std::set< network::connection > clients_manager::pending_ids_ [private] |
Definition at line 162 of file network_manager_ana.hpp.
Referenced by connected(), get_pending_connection_id(), handle_disconnect(), has_connection_pending(), and remove().
ana::server* clients_manager::server_ [private] |
Definition at line 159 of file network_manager_ana.hpp.
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:14 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |