itom  1.0.13
ito::RetVal Class Reference

Class for error value management. More...

#include <sharedStructures.h>

List of all members.

Public Member Functions

 RetVal (tRetValue retValue=retOk)
 RetVal (int retValue)
 RetVal (ito::tRetValue retValue, int retCode, const char *pRetMessage)
 RetVal (const RetVal &copyConstr)
 ~RetVal ()
RetValoperator= (const RetVal rhs)
RetValoperator+= (const RetVal rhs)
RetVal operator+ (const RetVal rhs)
char operator== (const RetVal rhs)
char operator!= (const RetVal rhs)
char operator== (const tRetValue rhs)
char operator!= (const tRetValue rhs)
int containsWarning ()
int containsError ()
int containsWarningOrError ()
char * errorMessage ()
int errorCode () const
void appendRetMessage (const char *addRetMessage)

Static Public Member Functions

static RetVal format (ito::tRetValue retValue, int retCode, const char *pRetMessage,...)

Private Attributes

tRetValue m_retValue
int m_retCode
char * m_pRetMessage

Detailed Description

Class for error value management.

The RetVal class is used for handling return codes. All classes should use this class. In case an error occurs, only the first error is stored and will not be overridden by potentially subsequent occurring errors.


Constructor & Destructor Documentation

ito::RetVal::RetVal ( ito::tRetValue  retValue,
int  retCode,
const char *  pRetMessage 
) [inline]

constructor with retValue, retCode and errorMessage

Parameters:
[in]retValuereturn Value constant, for possible values see tRetValue
[in]retCodeuser definable return code
[in]pRetMessageerror message to be passed, string is copied Makes a deep copy of RetVal, i.e. a copy of the error message
ito::RetVal::RetVal ( const RetVal copyConstr) [inline]

Deep copy constructor Makes a deep copy of RetVal, i.e. a copy of the error message

ito::RetVal::~RetVal ( ) [inline]

Destructor, in case frees errorMessage string


Member Function Documentation

int ito::RetVal::containsError ( ) [inline]

checks if any error has occurred in this return value (true), else (false)

int ito::RetVal::containsWarning ( ) [inline]

checks if any warning has occurred in this return value (true), else (false)

int ito::RetVal::containsWarningOrError ( ) [inline]

checks if any warning or error has occurred in this return value (true), else (false)

char ito::RetVal::operator!= ( const RetVal  rhs) [inline]

unequality operator compares retValue with with retValue of rhs RetVal. For possible constant values see tRetValue

char ito::RetVal::operator!= ( const tRetValue  rhs) [inline]

unequality operator compares retValue with tRetValue constant. For possible constant values see tRetValue

RetVal ito::RetVal::operator+ ( const RetVal  rhs) [inline]

Concatenation of RetVal See operator RetVal::operator+=

RetVal& ito::RetVal::operator+= ( const RetVal  rhs) [inline]

Concatenation of RetVal "Adds" RetVals, i.e. returns the most serious error. In case of equally serious errors the first is retained

RetVal& ito::RetVal::operator= ( const RetVal  rhs) [inline]

assignment operator, copies values of rhs to current RetVal. Before copiing current errorMessage is freed

char ito::RetVal::operator== ( const RetVal  rhs) [inline]

equality operator compares retValue with with retValue of rhs RetVal. For possible constant values see tRetValue

char ito::RetVal::operator== ( const tRetValue  rhs) [inline]

equality operator compares retValue with tRetValue constant. For possible constant values see tRetValue


Member Data Documentation

char* ito::RetVal::m_pRetMessage [private]

error text if available, else NULL

int ito::RetVal::m_retCode [private]

the error code itself

can be one of enumeration tLogLevel values or an or-combination of these values


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