QBaseClient Class Reference

Inheritance diagram for QBaseClient:

QDaqClient QMsgClient QSlowControlClient List of all members.

Detailed Description

base class implementing all protocol-related methods common to all network clients involved in apollo.

Author:
sergio.didomizio@ge.infn.it, andrea.giachero@lngs.infn.it


Public Member Functions

virtual ~QBaseClient ()
 destructor
void SetConnectionMode (bool alwaysOpen)
 set connection mode
bool GetConnectionMode () const
 get connection mode
const QErrorGetError () const
 get last error

Protected Member Functions

 QBaseClient (const std::string &serverType)
 constructor with default addres and port (from environment variables)
 QBaseClient (const std::string &address, const std::string &port)
 constructor with server address and port
bool ExecCmdNoResponse (const std::string &command, std::string &answer)
 execute base command with no response.
bool ExecSetCommand (const std::string &command, std::string &answer)
 execute set command.
bool ExecStartCommand (const std::string &command, std::string &answer)
 execute start command.
bool ExecGetCommand (const std::string &command, std::string &answer)
 execute get command.
bool ReturnInt (const std::string &command, int &answer)
 execute get command and return int value
bool ReturnDouble (const std::string &command, double &answer)
 execute get command and return double value
bool ReturnBool (const std::string &command, bool &answer)
 execute get command and return bool value
bool ReturnString (const std::string &command, std::string &answer)
 execute get command and return string value
bool CompleteCommand (std::string &command)
 complete the command appending newline to its end
void BuildError (std::string answer)
 convert server response from string to QError

Protected Attributes

bool fConnMode
QError fError


Constructor & Destructor Documentation

QBaseClient::QBaseClient ( const std::string &  serverType  )  [protected]

constructor with default addres and port (from environment variables)

Parameters:
serverType string specifying the name of the environment varibles the constructor will search for. Allowed values are "SLOW", for communication with SlowServer, "DAQ", for DaqServer and "MSG" for MsgServer

QBaseClient::QBaseClient ( const std::string &  address,
const std::string &  port 
) [protected]

constructor with server address and port

Parameters:
address server address connection port


Member Function Documentation

void QBaseClient::SetConnectionMode ( bool  alwaysOpen  )  [inline]

set connection mode

Parameters:
alwaysOpen if true, connection is opened when first command is executed and is closed when this object is destroyed. If false, connection is opened and closed every time a command is executed

bool QBaseClient::GetConnectionMode (  )  const [inline]

get connection mode

Returns:
connection mode. See SetConnectionMode() documentation to understand the meaning of this parameter

bool QBaseClient::ExecCmdNoResponse ( const std::string &  command,
std::string &  answer 
) [protected]

execute base command with no response.

Parameters:
argument to set command to be executed
answer server response
Returns:
true if server responded wiht "Answer: OK", false otherwise

bool QBaseClient::ExecSetCommand ( const std::string &  command,
std::string &  answer 
) [protected]

execute set command.

Parameters:
argument to set command to be executed
answer server response
Returns:
true if server responded with "Answer: OK", false otherwise

bool QBaseClient::ExecStartCommand ( const std::string &  command,
std::string &  answer 
) [protected]

execute start command.

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded with "Answer: OK", false otherwise

bool QBaseClient::ExecGetCommand ( const std::string &  command,
std::string &  answer 
) [protected]

execute get command.

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded without error, false otherwise

bool QBaseClient::ReturnInt ( const std::string &  command,
int &  answer 
) [protected]

execute get command and return int value

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded without error, false otherwise

bool QBaseClient::ReturnDouble ( const std::string &  command,
double &  answer 
) [protected]

execute get command and return double value

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded without error, false otherwise

bool QBaseClient::ReturnBool ( const std::string &  command,
bool &  answer 
) [protected]

execute get command and return bool value

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded without error, false otherwise

bool QBaseClient::ReturnString ( const std::string &  command,
std::string &  answer 
) [protected]

execute get command and return string value

Parameters:
argument to get command to be executed
answer server response
Returns:
true if server responded without error, false otherwise

bool QBaseClient::CompleteCommand ( std::string &  command  )  [protected]

complete the command appending newline to its end

Parameters:
command string to be complete
Returns:
false in case of malformatted string, true otherwise

void QBaseClient::BuildError ( std::string  answer  )  [protected]

convert server response from string to QError

Parameters:
answer slow server response


Member Data Documentation

bool QBaseClient::fConnMode [protected]

connection mode. If true, connection is open when the first command is executed and is closed when this object is destroyed. If false, connection is opened and closed every time a command is executed


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:42 2009 for CUORE Software by  doxygen 1.5.1