My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::Communicator Class Reference
Inheritance diagram for gcp::util::Communicator:
gcp::util::HorizonsCommunicator gcp::util::IersCommunicator gcp::util::TipperCommunicator

Classes

struct  RcvdStr
 

Public Member Functions

 Communicator ()
 
virtual ~Communicator ()
 
bool timedOut ()
 
virtual int getFd ()
 
void run ()
 
virtual void processClientMessage ()
 
void registerTimeOut ()
 

Static Public Attributes

static const unsigned COMMAND_TIMEOUT_SEC = 10
 

Protected Member Functions

virtual void terminateCommSequence (bool error)
 
void enableTimeOut (bool enable)
 
void checkLine ()
 
virtual void sendNextString (void)
 
void advanceIterator (bool bufferReset)
 
void checkIterators ()
 

Static Protected Member Functions

static COMM_PARSER_FN (sendNextString)
 

Protected Attributes

gcp::util::TcpClientclient_
 
gcp::util::TimeVal timer_
 
std::list< std::string > sentStrings_
 
std::list< RcvdStrrcvdStrings_
 
std::list< std::string >::iterator sentStringIter_
 
std::list< RcvdStr >::iterator rcvdStringIter_
 
std::ostringstream os_
 

Constructor & Destructor Documentation

Communicator::Communicator ( )

Constructor.

....................................................................... Constructor.

Communicator::~Communicator ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

void Communicator::advanceIterator ( bool  bufferReset)
protected

Reset in preparation for searching for the next string

....................................................................... Reset in preparation for searching for the next string

void gcp::util::Communicator::enableTimeOut ( bool  enable)
protected

Set a timeout for waiting for a response from the strip.

int Communicator::getFd ( )
virtual

Return the fd associated with this communicator

....................................................................... Return the fd

void Communicator::processClientMessage ( )
virtual

Read a line from the power strip and determine what to do

....................................................................... Read a line from the power strip and determine what to do

void Communicator::registerTimeOut ( )

React to a failure on the part of the power strip to reply

......................................................................., React to a failure to reply

void Communicator::run ( void  )

....................................................................... If we are connected to the device, this method executes the command sequence

void Communicator::terminateCommSequence ( bool  error)
protectedvirtual

Terminate a command sequence

....................................................................... Terminate a command sequence to the power strip.

bool Communicator::timedOut ( )

Return true if this communicator timed out waiting for an appropriate response to the last sent string

....................................................................... Return true if we timed out waiting for a command

Member Data Documentation

std::list<std::string>::iterator gcp::util::Communicator::sentStringIter_
protected

A pointer to the current element of the above lists

std::list<std::string> gcp::util::Communicator::sentStrings_
protected

A stack of command/responses for communicating with the strip via telnet.


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