Public Member Functions | Protected Member Functions | Private Attributes

ana::detail::ana_component Class Reference

Base class of network components. More...

#include <ana.hpp>

Inheritance diagram for ana::detail::ana_component:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Base class of network components.

Definition at line 179 of file ana.hpp.


Constructor & Destructor Documentation

virtual ana::detail::ana_component::~ana_component (  )  [inline, virtual]

Definition at line 182 of file ana.hpp.

ana::detail::ana_component::ana_component (  )  [inline, protected]

Initialize component, assign fresh id and sets header-first and async modes.

Definition at line 232 of file ana.hpp.


Member Function Documentation

virtual void ana::detail::ana_component::disconnect (  )  [pure virtual]
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().

Here is the caller graph for this function:

net_id ana::detail::ana_component::id (  )  const [inline]

Get the ID of this component.

Returns:
: ID of the network component represented by this object.

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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.

See also:
listener

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

Here is the caller graph for this function:

virtual ana::stats_collector& ana::detail::ana_component::stats_collector (  )  [pure virtual]

Get associated stats_collector object.

Returns:
A pointer to the associated stats_collector object, NULL if not keeping stats.
See also:
stats_collector.

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

Here is the caller graph for this function:


Member Data Documentation

This component's net_id.

Definition at line 243 of file ana.hpp.

Referenced by id().

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


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

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