QApolloMessenger Class Reference
[Networking]

List of all members.


Detailed Description

allows each DAQ process to send messages to MsgLogger server

Author:
Marco Pallavicini

Public Member Functions

virtual ~QApolloMessenger ()
 destructor
virtual void Send (MsgLevel severity=InfoMsg)
 send message to server
const std::string & GetName () const
virtual void SendStatus (QDaqCommonDefs::ProcessStatus_t status)
 send process status to message server
bool SetName (const std::string &name, bool force)
 set name with which messenger will register to message server
void AllowStdOut (bool allow)
 determine wether in case of network problems messages can be sent to stdout

Static Public Member Functions

static QApolloMessengerGetInstance ()
 singleton getter

Private Member Functions

 QApolloMessenger ()
 constructor
void RegisterProcess ()
 register process to message server
void UnregisterProcess ()
 unregister process from message server
bool IsNetworkError (const QError &err) const
void UseStdOut ()

Private Attributes

bool fRegistered
 flag indicating wether messenger is registered at message server
bool fAllowStdOut
 flag indicating wether writing to stdout (or stderr) is allowed in case of network communication failure (default is true).
bool fUseStdOut
const int fOutputFD
 output to be used (if allowed) in case of network communication failure
std::string fName
QMsgClientfClient

Member Function Documentation

void QApolloMessenger::Send ( MsgLevel  severity = InfoMsg  )  [virtual]

void QApolloMessenger::SendStatus ( QDaqCommonDefs::ProcessStatus_t  status  )  [virtual]

send process status to message server

Parameters:
status integer value associated to current stauts of the calling process

References fAllowStdOut, QBaseClient::GetError(), and QMsgClient::SendStatus().

Referenced by QProcessStatus::InformServer().

bool QApolloMessenger::SetName ( const std::string &  name,
bool  force 
)

set name with which messenger will register to message server

Parameters:
name process name
force determine wether the supplied name should be set even if current name is not null
Returns:
true if supplied name has been set, false otherwise

References RegisterProcess(), Send(), and UnregisterProcess().

Referenced by QProcessStatus::InformServer(), QDaqServer::QDaqServer(), QLCTriggerFinder::QLCTriggerFinder(), and QOnlineMessenger::SendNetworkMessage().

void QApolloMessenger::AllowStdOut ( bool  allow  )  [inline]

determine wether in case of network problems messages can be sent to stdout

Parameters:
allow if true, stdout is allowed; if false an error is thrown in case of network communication error

References fAllowStdOut.


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

Generated on Tue Nov 16 10:50:04 2010 for CUORE Software by  doxygen 1.5.6