Diana Software
Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
QError Class Reference

error class with error type and description More...

Inheritance diagram for QError:

Public Member Functions

virtual const char * what () const throw ()
 returns the same information as operator<< More...
 
 QError ()
 Default constructor. More...
 
 QError (QError_ err)
 constructor with error type More...
 
 QError (QError_ err, const std::string &descr)
 contructor with error type and description More...
 
 QError (QError_ err, const std::string &file, const int line, const std::string &descr)
 constructor with error type, filename, line and description More...
 
 QError (const QError &err)
 copy constructor More...
 
virtual ~QError () throw ()
 destructor More...
 
const QErroroperator= (const QError_ &e)
 assignement operator More...
 
const QErroroperator= (const QError &err)
 assignement operator More...
 
void SetDescription (const std::string &descr)
 set error description More...
 
void SetDescription (const std::string &file, const int line, const std::string &descr)
 set error description with file and line More...
 
const std::string & GetDescription () const
 get error description More...
 
QError_ GetCode () const
 get error code More...
 
const std::string & ToString () const
 error type to string conversion More...
 
bool operator== (const QError_ &e) const
 comparison with QError_ enum More...
 
bool operator== (const QError &e) const
 comparison with QError based on enum only More...
 
bool operator!= (const QError_ &e) const
 comparison with QError_ enum More...
 
bool operator!= (const QError &e) const
 comparison with QError based on enum only More...
 
void Set (QError_ e=QERR_SUCCESS, const std::string &descr="")
 set to error code and description (default is SUCCESS) More...
 
void Set (QError_ e, const std::string &file, const int line, const std::string &descr="")
 

Static Private Member Functions

static void Init ()
 initialization of fMap More...
 

Private Attributes

QError_ fErr
 underlying enum More...
 
std::string fDescr
 error description More...
 

Static Private Attributes

static std::map< QError_, std::string > fMap
 map of string error More...
 

Friends

std::ostream & operator<< (std::ostream &s, const QError &err)
 stream of error type and description More...
 

Detailed Description

error class with error type and description

QFramework errors definition.

Every algorithm or procedure have to use this class for error return, modules will read these errors and decide what to do

Definition at line 115 of file QError.hh.

Constructor & Destructor Documentation

◆ QError() [1/5]

QError::QError ( )

Default constructor.

Definition at line 115 of file QError.cc.

References fDescr, fErr, Init(), and QERR_SUCCESS.

◆ QError() [2/5]

QError::QError ( QError_  err)

constructor with error type

Definition at line 125 of file QError.cc.

References err, fDescr, fErr, and Init().

◆ QError() [3/5]

QError::QError ( QError_  err,
const std::string &  descr 
)

contructor with error type and description

Definition at line 134 of file QError.cc.

References err, fDescr, fErr, and Init().

◆ QError() [4/5]

QError::QError ( QError_  err,
const std::string &  file,
const int  line,
const std::string &  descr 
)

constructor with error type, filename, line and description

Definition at line 141 of file QError.cc.

References err, fErr, Init(), and SetDescription().

◆ QError() [5/5]

QError::QError ( const QError err)

copy constructor

Definition at line 148 of file QError.cc.

References err.

◆ ~QError()

virtual QError::~QError ( )
throw (
)
inlinevirtual

destructor

Definition at line 138 of file QError.hh.

Member Function Documentation

◆ GetCode()

QError_ QError::GetCode ( ) const
inline

get error code

Definition at line 156 of file QError.hh.

References fErr.

◆ GetDescription()

const std::string & QError::GetDescription ( ) const

get error description

Definition at line 190 of file QError.cc.

References fDescr.

Referenced by GlobalHandle< Q >::Get(), and QSequence::SaveConfig().

◆ Init()

void QError::Init ( )
staticprivate

◆ operator!=() [1/2]

bool QError::operator!= ( const QError e) const
inline

comparison with QError based on enum only

Definition at line 172 of file QError.hh.

References fErr.

◆ operator!=() [2/2]

bool QError::operator!= ( const QError_ e) const
inline

comparison with QError_ enum

Definition at line 169 of file QError.hh.

References fErr.

◆ operator=() [1/2]

const QError & QError::operator= ( const QError err)

assignement operator

Definition at line 182 of file QError.cc.

References fDescr, and fErr.

◆ operator=() [2/2]

const QError & QError::operator= ( const QError_ e)

assignement operator

Definition at line 174 of file QError.cc.

References fErr.

◆ operator==() [1/2]

bool QError::operator== ( const QError e) const
inline

comparison with QError based on enum only

Definition at line 166 of file QError.hh.

References fErr.

◆ operator==() [2/2]

bool QError::operator== ( const QError_ e) const
inline

comparison with QError_ enum

Definition at line 163 of file QError.hh.

References fErr.

◆ Set() [1/2]

void QError::Set ( QError_  e,
const std::string &  file,
const int  line,
const std::string &  descr = "" 
)

Definition at line 163 of file QError.cc.

References err, fErr, and SetDescription().

◆ Set() [2/2]

void QError::Set ( QError_  e = QERR_SUCCESS,
const std::string &  descr = "" 
)

set to error code and description (default is SUCCESS)

Definition at line 157 of file QError.cc.

References err, fDescr, and fErr.

Referenced by QDbWatchdogThread::operator()().

◆ SetDescription() [1/2]

void QError::SetDescription ( const std::string &  descr)
inline

◆ SetDescription() [2/2]

void QError::SetDescription ( const std::string &  file,
const int  line,
const std::string &  descr 
)

set error description with file and line

Definition at line 195 of file QError.cc.

◆ ToString()

const std::string & QError::ToString ( ) const

error type to string conversion

Definition at line 203 of file QError.cc.

References fErr, and fMap.

◆ what()

const char * QError::what ( ) const
throw (
)
virtual

returns the same information as operator<<

Definition at line 222 of file QError.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const QError err 
)
friend

stream of error type and description

Definition at line 210 of file QError.cc.

Member Data Documentation

◆ fDescr

std::string QError::fDescr
private

error description

Definition at line 187 of file QError.hh.

Referenced by GetDescription(), operator=(), QError(), Set(), and SetDescription().

◆ fErr

QError_ QError::fErr
private

underlying enum

Definition at line 184 of file QError.hh.

Referenced by GetCode(), operator!=(), operator=(), operator==(), QError(), Set(), and ToString().

◆ fMap

std::map< QError_, std::string > QError::fMap
staticprivate

map of string error

Definition at line 194 of file QError.hh.

Referenced by Init(), and ToString().


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