EUDAQ
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
eudaq::TransportBase Class Referenceabstract

#include <TransportBase.hh>

Inheritance diagram for eudaq::TransportBase:
eudaq::TransportClient eudaq::TransportServer eudaq::NULLClient eudaq::TCPClient eudaq::NULLServer eudaq::TCPServer

Public Member Functions

virtual void SendPacket (const unsigned char *data, size_t len, const ConnectionInfo &=ConnectionInfo::ALL, bool duringconnect=false)=0
 
void SendPacket (const std::string &data, const ConnectionInfo &inf=ConnectionInfo::ALL, bool duringconnect=false)
 
void SendPacket (const char *str, const ConnectionInfo &inf=ConnectionInfo::ALL, bool duringconnect=false)
 
void SendPacket (const BufferSerializer &t, const ConnectionInfo &inf=ConnectionInfo::ALL, bool duringconnect=false)
 
virtual void Close (const ConnectionInfo &)
 
virtual void ProcessEvents (int timeout)=0
 
void Process (int timeout=-1)
 
bool ReceivePacket (std::string *packet, int timeout=-1, const ConnectionInfo &=ConnectionInfo::ALL)
 
bool SendReceivePacket (const std::string &sendpacket, std::string *recpacket, const ConnectionInfo &connection, int timeout=-1)
 
template<typename T >
SendReceivePacket (const std::string &packet, const ConnectionInfo &connection, int timeout=-1)
 
void SetCallback (const TransportCallback &)
 
virtual bool IsNull () const
 

Protected Attributes

std::queue< TransportEventm_events
 A buffer to queue up events until they are handled.
 
TransportCallback m_callback
 The callback function to invoke on a transport event.
 
Mutex m_mutex
 

Detailed Description

A base class from which all types of Transport should inherit. They must implement the two pure virtual member functions SendPacket and ProcessEvents. A Transport is a means of transferring data or commands from one process to another, possibly on another machine.

Member Function Documentation

virtual void eudaq::TransportBase::Close ( const ConnectionInfo )
inlinevirtual

Pure virtual function to close a connection. This function should be implemented by the concrete Transport class to close the connection to the specified remote Transport instance.

Reimplemented in eudaq::TCPServer, and eudaq::NULLServer.

virtual void eudaq::TransportBase::ProcessEvents ( int  timeout)
pure virtual

Pure virtual function to receive data. This function must be implemented by the concrete Transport class to receive all pending data from the remote Transport instance, and fill the queue of events so that they may be handled.

Implemented in eudaq::TCPClient, eudaq::TCPServer, eudaq::NULLClient, and eudaq::NULLServer.

virtual void eudaq::TransportBase::SendPacket ( const unsigned char *  data,
size_t  len,
const ConnectionInfo = ConnectionInfo::ALL,
bool  duringconnect = false 
)
pure virtual

Pure virtual function to send a packet of data. This function must be implemented by the concrete Transport class to send a packet of data to the remote Transport instance.

Implemented in eudaq::TCPClient, eudaq::TCPServer, eudaq::NULLClient, and eudaq::NULLServer.


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