Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ACSError Class Reference

#include <acserrLegacy.h>

List of all members.

Public Member Functions

 ACSError ()
 ACSError (const char *file, int line)
 ACSError (const char *file, int line, const char *routine)
 ACSError (const ACSErr::ErrorTrace &errortrace)
 ACSError (ACSErr::ErrorTrace &errortrace)
 ACSError (const char *file, int line, ACSErr::ErrorTrace *errortrace, bool release=1)
 ACSError (ACSErr::ErrorTrace *errortrace, bool release=1)
 ACSError (const char *file, int line, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
 ACSError (const char *file, int line, ACSError &err, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
 ACSError (const char *file, int line, ACSError *err, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY, bool release=1)
 ACSError (ACSErr::ACSException &exception)
 ACSError (const char *file, int line, ACSErr::ACSException &pex, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
 ACSError (const char *file, int line, ACSErr::ErrorTrace &pc, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
 ~ACSError ()
ACSErr::ErrorTrace & getErrorTrace ()
ACSErr::ErrorTrace * returnErrorTrace (bool deletion=true)
ACSErr::ErrorTrace * getNext ()
ACSErr::ErrorTrace * top ()
void log ()
bool isOK ()
void addData (const char *name, const char *value)
template<class T> void addData (const char *name, T value)
char * getDescription ()
char * getFileName ()
CORBA::ULong getLineNumber ()
char * getRoutine ()
char * getHostName ()
char * getProcess ()
char * getThread ()
CORBA::ULongLong getTimeStamp ()
ACSErr::ErrorCode getErrorCode ()
ACSErr::ACSErrType getErrorType ()
ACSErr::Severity getSeverity ()
unsigned int getDepth ()
void setTimeStamp (CORBA::ULongLong time)
void setFileName (const char *fn)
void setLineNumber (CORBA::ULong ln)
void setError (ACSErr::ACSErrType ty, ACSErr::ErrorCode ec)
void setSeverity (ACSErr::Severity severity)

Static Public Member Functions

char * getDescription (ACSErr::ACSErrType et, ACSErr::ErrorCode ec)
void hostName (const char *hn)
void processName (const char *pn)
void setProcessName (const char *pn)
ACSErr::ErrorTrace createErrorTrace (const char *file, int line, ACSError &er)
ACSErr::ErrorTrace createErrorTrace (const char *file, int line, ACSErr::ACSException &pex, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
ACSErr::ErrorTrace createErrorTrace (const char *file, int line, ACSErr::ACSErrType et, ACSErr::ErrorCode ec,\const char *routine, ACSErr::Severity severity=DEFAULT_SEVERITY)
bool init (int argc, char *argv[])
bool init (CORBA::ORB_ptr _orb)
bool init ()
bool isInit ()
void done ()

Protected Member Functions

void log (ACSErr::ErrorTrace *c, int level)
void fill (ACSErr::ACSErrType et, ACSErr::ErrorCode ec, ACSErr::Severity severity, const char *file, int line, const char *routine)
ACS::Time getTime ()

Static Protected Member Functions

bool initLog (CORBA::ORB_ptr _orb)

Protected Attributes

ACSErr::ErrorTrace errorTrace
ACSErr::ErrorTrace * current
unsigned int depth

Static Protected Attributes

bool initialized
CORBA::ORB_var orb
std::unexpected_handler m_oldUnexpected
std::terminate_handler m_oldTerminate
const ACSErr::ACSErrType ACSErrTypeOK
const ACSErr::ErrorCode ACSErrOK


Detailed Description

Helper class for handling error structure (=ErrorTrace) locally in C++.


Constructor & Destructor Documentation

ACSError::ACSError  ) 
 

Constructor for creating "no error" object which does not contain runtime and source information. Instead can be used macro ACS_ERROR(). It just set error code and type to 0 (e.g. ACSErrOK, ACSErrTypeOK).

Todo:
in case of error exception shall be thrown

ACSError::ACSError const char *  file,
int  line
 

Constructor for creating "no error" object which does not contain runtime and source information. Instead can be used macro ACS_ERROR(). It just set error code and type to 0 (e.g. ACSErrOK, ACSErrTypeOK). This constructor is functional equal to constructor ACSError () and it is there just that macro ACS_ERROR () can be used.

Parameters:
file it is ignored
line it is ignored

ACSError::ACSError const char *  file,
int  line,
const char *  routine
 

Constructor for creating "no error" object. Instead can be used macro ACS_ERROR(ro).

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where the error occured (should be used __LINE__ macro)
routine name of the routine where the error occured

ACSError::ACSError const ACSErr::ErrorTrace &  errortrace  ) 
 

Constructor for creating error object from errortrace.

Parameters:
errortrace structure contains error information

ACSError::ACSError ACSErr::ErrorTrace &  errortrace  ) 
 

Constructor for creating error object from errortrace.

Parameters:
errortrace structure contains error information

ACSError::ACSError const char *  file,
int  line,
ACSErr::ErrorTrace *  errortrace,
bool  release = 1
 

Constructor for creating error object from pointer errortrace. It makes copy of errortrace.

Parameters:
file it is ignored
line it is ignored
pointer to errortrace structure contains error information
flag which indicates if errortrace shall be released - ACSError will take care of memory managment of the errortrace. This constructor is functional equal to constructor ACSError (ACSErr::ErrorTrace* errortrace, bool release=1) and it is there just that macro ACS_ERROR () can be used.

ACSError::ACSError ACSErr::ErrorTrace *  errortrace,
bool  release = 1
 

Constructor for creating error object from pointer errortrace. It makes copy of errortrace.

Parameters:
pointer to errortrace structure contains error information
flag which indicates if errortrace shall be released - ACSError will take care of memory managment of the errortrace.

ACSError::ACSError const char *  file,
int  line,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
 

Constructor for creating error object. Macro ACS_ERROR(et, ec, ro) should be used instead.

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where error the occured (should be used __LINE__ macro)
et error type (group)
ec error code
routine name of the routine where the error occured
severity severity of error (default medium = DEFAULT_SEVERITY)

ACSError::ACSError const char *  file,
int  line,
ACSError err,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
 

Constructor for creating error object which contains also trace to previous error(s). Macro ACS_ERROR(perr, et, ec, ro) should be used instead.

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where error the occured (should be used __LINE__ macro)
err previos error
et error type (group)
ec error code
routine name of the routine where the error occured
severity severity of error (default medium = DEFAULT_SEVERITY)
release 

ACSError::ACSError const char *  file,
int  line,
ACSError err,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY,
bool  release = 1
 

Constructor for creating error object which contains also trace to previous error(s). Macro ACS_ERROR(perr, et, ec, ro) should be used instead.

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where error the occured (should be used __LINE__ macro)
err previos error
et error type (group)
ec error code
routine name of the routine where the error occured
severity severity of error (default medium = DEFAULT_SEVERITY)
release 

ACSError::ACSError ACSErr::ACSException &  exception  ) 
 

Constructor for creating error object from IDL exception (=ACSException).

Parameters:
reference to the exception object contains error information i.e. ErrorTrace

ACSError::ACSError const char *  file,
int  line,
ACSErr::ACSException &  pex,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
 

Constructor for creating error object which contains also trace to previous error(s) from ACSException object. Macro ACS_ERROR(pe, ed, en, ro) should be used instead.

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where error the occured (should be used __LINE__ macro)
pex reference to previos exception
et error type
ec error code
routine name of the routine where the error occured
severity severity of error (default medium = DEFAULT_SEVERITY)

ACSError::ACSError const char *  file,
int  line,
ACSErr::ErrorTrace &  pc,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
 

Constructor for creating error object which contains also trace to previous error(s) from errortrace structure (ErrorTrace). Macro ACS_ERROR(pe, ed, en, ro) should be used instead.

Parameters:
file name of the file where the error occured (should be used __FILE__ macro)
line line number where error the occured (should be used __LINE__ macro)
pc reference to previos error contained in structure ErrorTrace
et error type (group)
ec error code
routine name of the routine where the error occured
severity severity of error (default medium = DEFAULT_SEVERITY)

ACSError::~ACSError  ) 
 

Destructor


Member Function Documentation

template<class T>
void ACSError::addData const char *  name,
value
[inline]
 

Adds data (pair of name-value)

Parameters:
name data name
value data value

void ACSError::addData const char *  name,
const char *  value
 

Adds data to the current error

Parameters:
name data name
value string data value

ACSErr::ErrorTrace ACSError::createErrorTrace const char *  file,
int  line,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
\const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
[static]
 

ACSErr::ErrorTrace ACSError::createErrorTrace const char *  file,
int  line,
ACSErr::ACSException &  pex,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  routine,
ACSErr::Severity  severity = DEFAULT_SEVERITY
[static]
 

ACSErr::ErrorTrace ACSError::createErrorTrace const char *  file,
int  line,
ACSError er
[inline, static]
 

void ACSError::done  )  [static]
 

void ACSError::fill ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
ACSErr::Severity  severity,
const char *  file,
int  line,
const char *  routine
[protected]
 

Fills errortrace structure

Parameters:
et error type (group)
ec error code
severity severity of error
file name of the file where the error occured
line line number where the error occured
routine name of the routine where the error occured

unsigned int ACSError::getDepth  )  [inline]
 

Returns depth of error stack

Returns:
unsigned int depth

char* ACSError::getDescription ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec
[static]
 

Returns description of the error

Parameters:
et error type (group)
ec error code

char* ACSError::getDescription  ) 
 

Returns copy of description of current error. User have to take care of releasing it!

Returns:
pointer to the char (=string)

ACSErr::ErrorCode ACSError::getErrorCode  )  [inline]
 

Returns error code

Returns:
ACSErr::ErrorCode

ACSErr::ErrorTrace& ACSError::getErrorTrace  )  [inline]
 

Gets reference to errortrace structure. User must take care for makeing copy of structure or should use method returnErrorTrace

Returns:
reference to the current errortrace structure
Todo:
if current is NULL than exception should be thrown

ACSErr::ACSErrType ACSError::getErrorType  )  [inline]
 

Returns error type

Returns:
ACSErr::ACSErrType

char* ACSError::getFileName  )  [inline]
 

Returns file name information of the error

Returns:
pointer to char contains file name

char* ACSError::getHostName  )  [inline]
 

Returns host name information of the error

Returns:
pointer to char contains host name

CORBA::ULong ACSError::getLineNumber  )  [inline]
 

Returns line number information of the error

Returns:
CORBA::ULong line number

ACSErr::ErrorTrace* ACSError::getNext  ) 
 

Moves to the next errortrace element and return its pointer (not copy). If there is no next errortrace element NULL will be returned

Returns:
pointer to the errortrace structure

char* ACSError::getProcess  )  [inline]
 

Retruns process information of the error. Its name or process ID.

Returns:
pointer to the char points to the copy of process information

char* ACSError::getRoutine  )  [inline]
 

Returns routine information of tehe error

Returns:
pointer to char contains routine name

ACSErr::Severity ACSError::getSeverity  )  [inline]
 

Returns error severity

char* ACSError::getThread  )  [inline]
 

Returns thread information of the error. The name of thread or its ID.

Returns:
pointer to the char points to the copy of thread information

ACS::Time ACSError::getTime  )  [protected]
 

Returns time in 100th of nano seconds needed for error time stamp

Returns:
time stamp in CORBA::ULongLong (64 bits)

CORBA::ULongLong ACSError::getTimeStamp  )  [inline]
 

Returns time stamp of the error in 100th of nanoseconds.

Returns:
CORBA::ULongLong time stamp

void ACSError::hostName const char *  hn  )  [static]
 

Sets host name

Parameters:
hn host name

bool ACSError::init  )  [static]
 

bool ACSError::init CORBA::ORB_ptr  _orb  )  [static]
 

bool ACSError::init int  argc,
char *  argv[]
[static]
 

bool ACSError::initLog CORBA::ORB_ptr  _orb  )  [static, protected]
 

bool ACSError::isInit  )  [inline, static]
 

bool ACSError::isOK  )  [inline]
 

Returns true if errortrace does not represent error otherwise false.

Returns:
boolean flag

void ACSError::log ACSErr::ErrorTrace *  c,
int  level
[protected]
 

Logs single error

Parameters:
c errortrace contains error to log
level of error in erro stack

void ACSError::log  ) 
 

Logs errortrace information into logging system

void ACSError::processName const char *  pn  )  [static]
 

Deprecated:
Sets process name
Parameters:
process name

ACSErr::ErrorTrace* ACSError::returnErrorTrace bool  deletion = true  ) 
 

Returns copy of errortrace structure (and delete ACSError object)

Parameters:
deletion flag indicates if ACSError has to be deleted. Default value is true what means that ACSError object will be deleted.
Returns:
pointer to the errortrace structure

void ACSError::setError ACSErr::ACSErrType  ty,
ACSErr::ErrorCode  ec
[inline]
 

Sets current error code

Parameters:
ty error type (should be of type ACSErr::ACSErrType defined in acserrType.idl)
ec erro code

void ACSError::setFileName const char *  fn  )  [inline]
 

Sets file name

Parameters:
fn file name

void ACSError::setLineNumber CORBA::ULong  ln  )  [inline]
 

Sets line number

Parameters:
ln line number

void ACSError::setProcessName const char *  pn  )  [static]
 

Sets process name

Parameters:
process name

void ACSError::setSeverity ACSErr::Severity  severity  )  [inline]
 

Sets error severity

Parameters:
 severity errro severity

void ACSError::setTimeStamp CORBA::ULongLong  time  )  [inline]
 

Sets time stamp of the error in 100th of nanoseconds. time CORBA::ULongLong time stamp

ACSErr::ErrorTrace* ACSError::top  )  [inline]
 

Moves to the first (top) errortrace element and return its pointer (not copy).

Returns:
pointer to the errortrace structure


Member Data Documentation

const ACSErr::ErrorCode ACSError::ACSErrOK [static, protected]
 

const ACSErr::ACSErrType ACSError::ACSErrTypeOK [static, protected]
 

ACSErr::ErrorTrace * ACSError::current [protected]
 

unsigned int ACSError::depth [protected]
 

ACSErr::ErrorTrace ACSError::errorTrace [protected]
 

bool ACSError::initialized [static, protected]
 

std::terminate_handler ACSError::m_oldTerminate [static, protected]
 

std::unexpected_handler ACSError::m_oldUnexpected [static, protected]
 

CORBA::ORB_var ACSError::orb [static, protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:35:48 2009 for ACS C++ API by doxygen 1.3.8