TOBI Interface A  0.1
tia::TiAClientImpl Class Reference

Base implementation of the TiAClient. More...

#include <tia_client_impl.h>

+ Inheritance diagram for tia::TiAClientImpl:
+ Collaboration diagram for tia::TiAClientImpl:

Public Member Functions

 TiAClientImpl ()
 Default Constructor.
virtual ~TiAClientImpl ()
 Destructor.
virtual void connect (const std::string &address, short unsigned port)
 Establish a connection to a TOBI SignalServer The caller will be blocked until the connection has been made or an error has occurred.
virtual bool connected () const
 Tells if the client is connected to the server, i.e. if the control connection has been established.
virtual void disconnect ()
 Disconnects from the server, i.e. stops receiving and closes the control connection.
virtual void requestConfig ()
 Requests the meta data information from the server The caller will be blocked until the request has been processed or an error has occurred.
virtual SSConfig config () const
 Returns the meta data information requested from the server.
virtual void startReceiving (bool use_udp_bc)
 Turns the client into receiving state The caller will be blocked until the client is ready to receive or an error has occurred.
virtual bool receiving () const
 Tell if the client if is in receiving state.
virtual void stopReceiving ()
 Stops receiving, i.e. calling getDataPacket() will fail afterwards.
virtual void getDataPacket (DataPacket &packet)
 Gets a packet from the server. The caller will be blocked until a packet has been received or an error has occurred.
virtual DataPacketgetEmptyDataPacket ()
 todo
virtual void setBufferSize (size_t size)
 Sets the client's data input buffer size to the given value.

Protected Types

enum  ControlConnState { ControlConnState_NotConnected = 0, ControlConnState_Connected = 1 }
enum  DataInputState { DataInputState_NotConnected = 0, DataInputState_Connected, DataInputState_Receiving }

Protected Member Functions

void establishDataConnection (bool use_udp_bc)
 Establishes a data connection to the SignalServer.
void closeDataConnection ()
 Closes the data connection.

Protected Attributes

boost::asio::io_service io_service_
boost::asio::ip::tcp::iostream ctl_conn_stream_
boost::asio::ip::tcp::socket data_socket_tcp_
boost::asio::ip::udp::socket data_socket_udp_
ControlMsgEncodermsg_encoder_
ControlMsgDecodermsg_decoder_
int ctl_conn_state_
int data_input_state_
SSConfig config_
bool use_udp_bc_
boost::uint64_t last_packet_nr_
boost::uint32_t packet_offset_
boost::uint32_t buffer_offset_
size_t buffered_data_
size_t buffer_size_
std::vector< char > recv_buf_
std::vector< char > data_buf_
boost::asio::ip::tcp::endpoint tcp_target_
boost::shared_ptr< DataPacketpacket_

Detailed Description

Base implementation of the TiAClient.

Definition at line 68 of file tia_client_impl.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations