TPProto::FrameCodec Class Reference

FrameCodec is the main working class the lower layer of libtpproto-cpp. More...

#include <framecodec.h>

Inheritance diagram for TPProto::FrameCodec:

TPProto::Connection List of all members.

Public Member Functions

 FrameCodec ()
 Constructs object and sets up defaults.
 ~FrameCodec ()
 Destructor.
void setAsyncFrameListener (AsyncFrameListener *afl)
 Sets the AsyncFrameListener.
void setLogger (Logger *nlog)
 Sets the Logger.
void setProtocolLayer (ProtocolLayer *pl)
 Sets the ProtocolLayer.
int getStatus ()
 Gets the status of the connection.
FrameConnection sendFrame (boost::shared_ptr< Frame > f, const FrameSignal::slot_type &callback)
void readyToRead ()
 Called when the socket has data ready to be read.
void readyToSend ()
 Called when the socket is ready for data to be sent to it.
void receivedFrame (Frame *frame)

Detailed Description

FrameCodec is the main working class the lower layer of libtpproto-cpp.

The FrameCodec class is responsible for handling the running of the protocol. It interacts with the Thousand Parsec servers and avoids a lot of unneccessary handling by the client and higher layers. The FrameCodec class is not the best way for a client to access a tp server, use the upper layers for that, but it can be used if necessary. A ProtocolLayer must be set (by setting this object as the FrameCodec for the ProtocolLayer).


Constructor & Destructor Documentation

TPProto::FrameCodec::FrameCodec (  ) 

Constructs object and sets up defaults.

Defaults are


Member Function Documentation

void TPProto::FrameCodec::setAsyncFrameListener ( AsyncFrameListener afl  ) 

Sets the AsyncFrameListener.

Only one AsyncFrameListener is allowed currently. When a new listener is set, the old one if present is deleted.

Parameters:
afl The AsyncFrameListener to use.

void TPProto::FrameCodec::setLogger ( Logger nlog  ) 

Sets the Logger.

This method sets a new Logger. The old Logger is deleted. If the pointer to the new Logger is NULL, the default SilentLogger is used.

Parameters:
nlog The new Logger to use, or NULL

void TPProto::FrameCodec::setProtocolLayer ( ProtocolLayer pl  ) 

Sets the ProtocolLayer.

This method sets the ProtocolLayer.

Parameters:
pl The ProtocolLayer to use.

int TPProto::FrameCodec::getStatus (  ) 

Gets the status of the connection.

Returns:
The status (int).

void TPProto::FrameCodec::readyToRead (  )  [virtual]

Called when the socket has data ready to be read.

Protocol reading entry point is here. Non-blocking sockets should be used.

Implements TPProto::Connection.

void TPProto::FrameCodec::readyToSend (  )  [virtual]

Called when the socket is ready for data to be sent to it.

This can be used to send queued data when non-blocking writes say they would have blocked.

Implements TPProto::Connection.


The documentation for this class was generated from the following files:
Generated on Tue Jan 6 08:15:47 2009 for libtpproto-cpp by  doxygen 1.5.1