Realistic 3D camera system
3D camera system components
Public Member Functions | List of all members
s11n_example::connection Class Reference

The connection class provides serialization primitives on top of a socket. More...

#include <connection.hpp>

Public Member Functions

 connection (asio::io_service &io_service)
 Constructor. More...
 
asio::ip::tcp::socketsocket ()
 
template<typename T , typename Handler >
void async_write (const T &t, Handler handler)
 Asynchronously write a data structure to the socket. More...
 
template<typename T , typename Handler >
void async_read (T &t, Handler handler)
 Asynchronously read a data structure from the socket. More...
 
template<typename T , typename Handler >
void handle_read_header (const asio::error_code &e, T &t, boost::tuple< Handler > handler)
 
template<typename T , typename Handler >
void handle_read_data (const asio::error_code &e, T &t, boost::tuple< Handler > handler)
 Handle a completed read of message data. More...
 

Detailed Description

The connection class provides serialization primitives on top of a socket.

Each message sent using this class consists of:

Definition at line 34 of file connection.hpp.

Constructor & Destructor Documentation

s11n_example::connection::connection ( asio::io_service io_service)
inline

Constructor.

Definition at line 38 of file connection.hpp.

Member Function Documentation

template<typename T , typename Handler >
void s11n_example::connection::async_read ( T &  t,
Handler  handler 
)
inline

Asynchronously read a data structure from the socket.

Definition at line 83 of file connection.hpp.

template<typename T , typename Handler >
void s11n_example::connection::async_write ( const T &  t,
Handler  handler 
)
inline

Asynchronously write a data structure to the socket.

Definition at line 52 of file connection.hpp.

template<typename T , typename Handler >
void s11n_example::connection::handle_read_data ( const asio::error_code e,
T &  t,
boost::tuple< Handler >  handler 
)
inline

Handle a completed read of message data.

Definition at line 134 of file connection.hpp.

template<typename T , typename Handler >
void s11n_example::connection::handle_read_header ( const asio::error_code e,
T &  t,
boost::tuple< Handler >  handler 
)
inline

Handle a completed read of a message header. The handler is passed using a tuple since boost::bind seems to have trouble binding a function object created using boost::bind as a parameter.

Definition at line 100 of file connection.hpp.

asio::ip::tcp::socket& s11n_example::connection::socket ( )
inline

Get the underlying socket. Used for making a connection or for accepting an incoming connection.

Definition at line 45 of file connection.hpp.


The documentation for this class was generated from the following file: