Public Member Functions | Private Member Functions | Private Attributes

clients_manager Class Reference

Manages connected client ids for a given server. More...

#include <network_manager_ana.hpp>

Inheritance diagram for clients_manager:
Inheritance graph
[legend]
Collaboration diagram for clients_manager:
Collaboration graph
[legend]

List of all members.

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::serverserver_
std::set< ana::net_idids_
std::set< network::connectionpending_ids_
std::set< ana::net_idpending_handshakes_

Detailed Description

Manages connected client ids for a given server.

Definition at line 131 of file network_manager_ana.hpp.


Constructor & Destructor Documentation

clients_manager::clients_manager ( ana::server server  ) 

Constructor.

Definition at line 515 of file network_manager_ana.cpp.


Member Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void clients_manager::handle_connect ( ana::error_code  ,
ana::net_id   
) [private, virtual]

Handle new connection event.

Parameters:
error_code : Error code of the event.
net_id : ID of the client that connects.
See also:
error_code
net_id

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().

Here is the caller graph for this function:

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_.


Member Data Documentation

std::set< ana::net_id > clients_manager::ids_ [private]

Definition at line 163 of file network_manager_ana.hpp.

Referenced by handle_connect(), handshaked(), is_pending_handshake(), and remove().

Definition at line 159 of file network_manager_ana.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:14 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs