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 QApolloMessenger & | GetInstance () |
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 |
QMsgClient * | fClient |
void QApolloMessenger::Send | ( | MsgLevel | severity = InfoMsg |
) | [virtual] |
send message to server
severity | message severty |
References fAllowStdOut, QBaseClient::GetError(), and QMsgClient::SendLog().
Referenced by QNiDigitalController::HandleNiError(), QSlowControlServer::SendMessage(), QOnlineMessenger::SendNetworkMessage(), QApolloError::Set(), SetName(), QDaqServer::StartProcess(), and QDaqServer::StartRun().
void QApolloMessenger::SendStatus | ( | QDaqCommonDefs::ProcessStatus_t | status | ) | [virtual] |
send process status to message server
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
name | process name | |
force | determine wether the supplied name should be set even if current name is not null |
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
allow | if true, stdout is allowed; if false an error is thrown in case of network communication error |
References fAllowStdOut.