Base class of network components. More...
#include <ana.hpp>

Public Member Functions | |
| virtual | ~ana_component () |
| net_id | id () const |
| Get the ID of this component. | |
| virtual void | disconnect ()=0 |
| Disconnect the component. | |
| void | set_raw_data_mode () |
| Enter Raw Data mode, ana won't prefix your packets with header information. | |
| void | set_header_first_mode () |
| Enter header first mode, ana will prefix anything you send with size information first, so the listener will inform a new packet has been received only after it receives the whole packet. | |
| bool | raw_mode () const |
| Returns true iff the sender is in raw data mode. | |
| bool | header_mode () const |
| Returns false iff the sender is in raw data mode. | |
| virtual ana::stats_collector & | stats_collector ()=0 |
| Get associated stats_collector object. | |
Protected Member Functions | |
| ana_component () | |
| Initialize component, assign fresh id and sets header-first and async modes. | |
Private Attributes | |
| bool | raw_data_ |
| The component is in raw data mode. | |
| const net_id | id_ |
| This component's net_id. | |
Base class of network components.
Definition at line 179 of file ana.hpp.
| virtual ana::detail::ana_component::~ana_component | ( | ) | [inline, virtual] |
| ana::detail::ana_component::ana_component | ( | ) | [inline, protected] |
| virtual void ana::detail::ana_component::disconnect | ( | ) | [pure virtual] |
Disconnect the component.
Implemented in asio_client, and asio_server::asio_client_proxy.
Referenced by asio_listener::handle_body(), asio_listener::handle_header(), asio_listener::handle_partial_body(), asio_listener::handle_raw_buffer(), asio_listener::listen_one_message(), and asio_sender::send().

| bool ana::detail::ana_component::header_mode | ( | ) | const [inline] |
Returns false iff the sender is in raw data mode.
Definition at line 218 of file ana.hpp.
References raw_data_.
Referenced by asio_client::handle_connect(), asio_client::handle_proxy_connection(), and asio_listener::listen_one_message().

| net_id ana::detail::ana_component::id | ( | ) | const [inline] |
Get the ID of this component.
Definition at line 189 of file ana.hpp.
References id_.
Referenced by ana_network_manager::create_client_and_connect(), ana_network_manager::create_server(), and asio_server::handle_accept().

| bool ana::detail::ana_component::raw_mode | ( | ) | const [inline] |
Returns true iff the sender is in raw data mode.
Definition at line 215 of file ana.hpp.
References raw_data_.
Referenced by asio_server::handle_accept(), and asio_sender::send().

| void ana::detail::ana_component::set_header_first_mode | ( | ) | [inline] |
Enter header first mode, ana will prefix anything you send with size information first, so the listener will inform a new packet has been received only after it receives the whole packet.
Definition at line 212 of file ana.hpp.
References raw_data_.
Referenced by ana_network_manager::create_client_and_connect().

| void ana::detail::ana_component::set_raw_data_mode | ( | ) | [inline] |
Enter Raw Data mode, ana won't prefix your packets with header information.
This is good for handshake procedures or every time you know how much you are supposed to receive. Combine this mode with a listener that is reading things the right way.
Definition at line 205 of file ana.hpp.
References raw_data_.
Referenced by ana_network_manager::create_client_and_connect(), and asio_server::handle_accept().

| virtual ana::stats_collector& ana::detail::ana_component::stats_collector | ( | ) | [pure virtual] |
Get associated stats_collector object.
Implemented in asio_client, and asio_server::asio_client_proxy.
Referenced by ana_component::get_receive_stats(), ana_component::get_send_stats(), asio_listener::handle_body(), asio_listener::handle_header(), asio_listener::handle_partial_body(), asio_listener::handle_raw_buffer(), and asio_sender::send().

const net_id ana::detail::ana_component::id_ [private] |
bool ana::detail::ana_component::raw_data_ [private] |
The component is in raw data mode.
Definition at line 240 of file ana.hpp.
Referenced by header_mode(), raw_mode(), set_header_first_mode(), and set_raw_data_mode().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:18 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |