Public Member Functions | Private Member Functions | Private Attributes

ana_connect_handler Class Reference

To use the asynchronous library synchronously, objects of this type lock a mutex until enough calls have been made to the associated handler. More...

#include <network_manager_ana.hpp>

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

List of all members.

Public Member Functions

 ana_connect_handler ()
 Constructs a connection handler.
 ~ana_connect_handler ()
 Destructor.
const ana::error_codeerror () const
 Checks if an error occurred during the connection procedure.
void wait_completion ()
 Locks current thread until the connection attempt has finished.

Private Member Functions

virtual void handle_connect (ana::error_code error_code, ana::net_id)
 Handle new connection event.

Private Attributes

boost::mutex mutex_
ana::error_code error_code_

Detailed Description

To use the asynchronous library synchronously, objects of this type lock a mutex until enough calls have been made to the associated handler.

Definition at line 336 of file network_manager_ana.hpp.


Constructor & Destructor Documentation

ana_connect_handler::ana_connect_handler (  ) 

Constructs a connection handler.

Parameters:
timer : A pointer to a running timer dealing with the timeout of this connect operation.

Definition at line 329 of file network_manager_ana.cpp.

References mutex_.

ana_connect_handler::~ana_connect_handler (  ) 

Destructor.

Definition at line 336 of file network_manager_ana.cpp.

References mutex_.


Member Function Documentation

const ana::error_code & ana_connect_handler::error (  )  const

Checks if an error occurred during the connection procedure.

Returns:
Error code of the operation.

Definition at line 342 of file network_manager_ana.cpp.

References error_code_.

Referenced by ana_network_manager::create_client_and_connect().

Here is the caller graph for this function:

void ana_connect_handler::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 347 of file network_manager_ana.cpp.

References error_code_, and mutex_.

void ana_connect_handler::wait_completion (  ) 

Locks current thread until the connection attempt has finished.

Definition at line 353 of file network_manager_ana.cpp.

References mutex_.

Referenced by ana_network_manager::create_client_and_connect().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 364 of file network_manager_ana.hpp.

Referenced by error(), and handle_connect().

boost::mutex ana_connect_handler::mutex_ [private]

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:12:41 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs