QApolloError Class Reference

List of all members.


Detailed Description

Singleton for error handling internally to apollo.

This class handles errors in apollo Sends messages to Apollo message handler Can also return a QError class

M.P. & A.G. created 19/07/06

Id
QApolloError.hh 402 2006-11-10 22:40:02Z giacher
Revision
402

Public Member Functions

virtual ~QApolloError ()
 Destructor.
void Reset ()
 reset error
void Set (const std::string &Where, MsgLevel Sev, const std::string &Error, QError_ code=QERR_SUCCESS)
 Set error using std::string.
void Set (const char *Where, MsgLevel Sev, const char *Error, QError_ code=QERR_SUCCESS)
 Set error using C strings.
bool IsError () const
MsgLevel GetSeverity () const
const std::string & GetError () const
const std::string & GetWhere () const
const QErrorGetQError ()
 Return error as class QError.

Static Public Member Functions

static QApolloErrorGet ()
 singleton statis get

Private Member Functions

 QApolloError ()
 Private ctor for singleton.

Private Attributes

std::string fWhere
 Name of function where error occurred.
MsgLevel fSeverity
 Severity level.
std::string fErrorString
 Error message.
QError_ fCode
 Error code as defined in class QError.hh.
QError fError
 Static QError object used for error return.

Static Private Attributes

static QApolloErrorfMe = 0

Member Function Documentation

void QApolloError::Set ( const std::string &  Where,
MsgLevel  Sev,
const std::string &  Error,
QError_  code = QERR_SUCCESS 
)

Set error using std::string.

When an error is Set, a message is sent to the MsgServer according to its severity. The name of the function where error occurred is also reported together with an error description.

Parameters:
Where name of the function where error occurred
Sev severity level of this error defined in QApolloMessenger.hh
Error error message
code Error code as defined in QError.hh

References fCode, fErrorString, fSeverity, fWhere, QApolloMessenger::GetInstance(), and QApolloMessenger::Send().

Referenced by QBaseEleDevice::CreateIdChannels(), QBaseEleDevice::CreateLgChannels(), QPowerSupply::GetBool(), QPowerSupply::GetDouble(), QBaseEleDevice::GetEleChannel(), QPowerSupply::GetString(), QSlowControlServer::LoadElectronicsDevice(), QSlowControlServer::LoadInstrumentDevice(), Set(), QPowerSupply::SetBool(), and QPowerSupply::SetDouble().

void QApolloError::Set ( const char *  Where,
MsgLevel  Sev,
const char *  Error,
QError_  code = QERR_SUCCESS 
) [inline]

Set error using C strings.

Parameters:
Where name of the function where error occurred
Sev severity level of this error defined in QApolloMessenger.hh
Error error message
code Error code as defined in QError.hh

References Set().

bool QApolloError::IsError (  )  const [inline]

Returns:
True is an error is defined

References fSeverity.

Referenced by GetQError().

MsgLevel QApolloError::GetSeverity (  )  const [inline]

Returns:
Error severity code

References fSeverity.

const std::string& QApolloError::GetError (  )  const [inline]

Returns:
Error message

References fErrorString.

const std::string& QApolloError::GetWhere (  )  const [inline]

Returns:
Name of function where error occurred

References fWhere.


Member Data Documentation

Static QError object used for error return.

Returns:
a valid QError

Referenced by GetQError(), and Reset().


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