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>


Public Member Functions | |
| ana_send_handler (size_t calls=1) | |
| Constructs a handler object. | |
| ~ana_send_handler () | |
| Destructor, checks that the necessary calls were made. | |
| void | wait_completion () |
| Locks current thread until all the calls are made. | |
| const ana::error_code & | error () const |
Private Member Functions | |
| virtual void | handle_send (ana::error_code, ana::net_id, ana::operation_id) |
| Handle send completion event. | |
Private Attributes | |
| boost::mutex | mutex_ |
| size_t | target_calls_ |
| ana::error_code | error_code_ |
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 171 of file network_manager_ana.hpp.
| ana_send_handler::ana_send_handler | ( | size_t | calls = 1 |
) |
Constructs a handler object.
| calls | [optional, default 1] : The amount of calls to the handler expected. |
Definition at line 36 of file network_manager_ana.cpp.
References mutex_.
| ana_send_handler::~ana_send_handler | ( | ) |
Destructor, checks that the necessary calls were made.
Definition at line 45 of file network_manager_ana.cpp.
References mutex_, and target_calls_.
| const ana::error_code& ana_send_handler::error | ( | ) | const [inline] |
Definition at line 186 of file network_manager_ana.hpp.
References error_code_.
Referenced by ana_network_manager::create_client_and_connect(), and ana_network_manager::send_raw_data().

| void ana_send_handler::handle_send | ( | ana::error_code | , | |
| ana::net_id | , | |||
| ana::operation_id | ||||
| ) | [private, virtual] |
Handle send completion event.
| error_code | : Error code of the event. | |
| net_id | : ID of the client that sent the message. |
Implements ana::send_handler.
Definition at line 53 of file network_manager_ana.cpp.
References error_code_, mutex_, and target_calls_.
| void ana_send_handler::wait_completion | ( | ) |
Locks current thread until all the calls are made.
Definition at line 63 of file network_manager_ana.cpp.
References mutex_.
Referenced by ana_network_manager::create_client_and_connect(), ana_network_manager::send_all(), ana_network_manager::send_all_except(), and ana_network_manager::send_raw_data().

ana::error_code ana_send_handler::error_code_ [private] |
Definition at line 196 of file network_manager_ana.hpp.
Referenced by error(), and handle_send().
boost::mutex ana_send_handler::mutex_ [private] |
Definition at line 194 of file network_manager_ana.hpp.
Referenced by ana_send_handler(), handle_send(), wait_completion(), and ~ana_send_handler().
size_t ana_send_handler::target_calls_ [private] |
Definition at line 195 of file network_manager_ana.hpp.
Referenced by handle_send(), and ~ana_send_handler().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:12:48 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |