FeeServer::Client Class Reference
[Client code]

#include <feeserver/fee_client.hh>

Collaboration diagram for FeeServer::Client:

Collaboration graph
[legend]

List of all members.


Detailed Description

An example client.
Examples:

test_client.cc.


Public Member Functions

 Client (const std::string &server, const std::string &dns, unsigned int tries=20, unsigned int timeout=2000)
virtual ~Client ()
bool SendCommand (unsigned short flags, std::vector< unsigned char > &data)
virtual void HandleMessage (Message &m)
virtual void NolinkMessage ()
virtual void NolinkAcknowledge ()
virtual void AcknowledgeError (short error)
virtual void ChecksumFailed (unsigned int expected, unsigned int got)
virtual void UnexpectedReply (unsigned int expected, unsigned int got)
virtual void UnknownService (const std::string &name)
virtual void Timeout ()

Protected Member Functions

 Client (const Client &)
Clientoperator= (const Client &)
virtual unsigned int MakeId ()
void DoHandleAcknowledge ()

Protected Attributes

InfoHandler * _handler
std::string _server
std::string _cmd_name
Message _msg
Acknowledge _ack
Command _cmd
std::vector< unsigned char > _buffer
size_t _size
unsigned int _tries
unsigned int _timeout
bool _reply
unsigned int _id

Friends

class InfoHandler

Constructor & Destructor Documentation

FeeServer::Client::Client ( const std::string &  server,
const std::string &  dns,
unsigned int  tries = 20,
unsigned int  timeout = 2000 
)

Constructor

FeeServer::Client::~Client (  )  [virtual]

Destructor

FeeServer::Client::Client ( const Client  )  [protected]

Not implemented


Member Function Documentation

bool FeeServer::Client::SendCommand ( unsigned short  flags,
std::vector< unsigned char > &  data 
)

Send a command to the server

void FeeServer::Client::HandleMessage ( Message m  )  [inline, virtual]

Function called when messages arrive

Parameters:
m Messsage structure

virtual void FeeServer::Client::NolinkMessage (  )  [inline, virtual]

Called on no-link to message channel

virtual void FeeServer::Client::NolinkAcknowledge (  )  [inline, virtual]

Called on no-link to acknowledge channel

void FeeServer::Client::AcknowledgeError ( short  error  )  [inline, virtual]

Acknowledge error seen

Parameters:
error Error code

void FeeServer::Client::ChecksumFailed ( unsigned int  expected,
unsigned int  got 
) [inline, virtual]

Bad check sum in acknowledge

Parameters:
expected Expected check sum
got The actual check sum

void FeeServer::Client::UnexpectedReply ( unsigned int  expected,
unsigned int  got 
) [inline, virtual]

Got unexpected reply

Parameters:
expected Expected reply
got The actual reply

void FeeServer::Client::UnknownService ( const std::string &  name  )  [inline, virtual]

Got an unknown service update

Parameters:
name Name of service updated

virtual void FeeServer::Client::Timeout (  )  [inline, virtual]

Called when the acknowledge times out

Client& FeeServer::Client::operator= ( const Client  )  [protected]

Not implemented

unsigned int FeeServer::Client::MakeId (  )  [protected, virtual]

Make a request id

void FeeServer::Client::DoHandleAcknowledge (  )  [protected]

Information handler Handle the acknowledge


Friends And Related Function Documentation

friend class InfoHandler [friend]

Hidden info handler is a friend


Member Data Documentation

InfoHandler* FeeServer::Client::_handler [protected]

Pointer to hidden info handler

std::string FeeServer::Client::_server [protected]

server name

std::string FeeServer::Client::_cmd_name [protected]

Name of command service

Message structure

Acknowledge structure

Command structure

std::vector<unsigned char> FeeServer::Client::_buffer [protected]

Buffer

size_t FeeServer::Client::_size [protected]

Current number of valid bytes in buffer

unsigned int FeeServer::Client::_tries [protected]

Tries

unsigned int FeeServer::Client::_timeout [protected]

Timeout otu

bool FeeServer::Client::_reply [protected]

Got the reply

unsigned int FeeServer::Client::_id [protected]

Id we're waiting for


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

Generated on Thu Jun 26 17:02:29 2008 for FeeServer++ 0.9 by  doxygen 1.5.6