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

ACSErr::ErrorTraceHelper Class Reference

#include <acserr.h>

Inheritance diagram for ACSErr::ErrorTraceHelper:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void log (ACE_Log_Priority priorty=LM_ERROR)
std::string toString ()
void addData (const char *name, const char *value)
void addData (const char *name, char *value)
template<typename T> void addData (const char *name, T value)
void setMemberValue (const char *name, const char *value)
void setMemberValue (const char *name, ACE_CString &value)
template<typename T> void setMemberValue (const char *name, T value)
ACE_CString getData (const char *name)
void getMemberValue (const char *name, char *&value)
template<typename T> void getMemberValue (const char *name, T &value)
template<typename T> T getMemberValue (const char *name)
char * getDescription ()
char * getShortDescription ()
char * getFileName ()
CORBA::ULong getLineNumber ()
char * getRoutine ()
char * getHostName ()
char * getProcessName ()
char * getThread ()
char * getSourceObject ()
CORBA::ULongLong getTimeStamp ()
ACSErr::ErrorCode getErrorCode ()
ACSErr::ACSErrType getErrorType ()
ACSErr::Severity getSeverity ()
unsigned int getDepth ()
void setTimeStamp (CORBA::ULongLong time)
void setSourceObject (const char *so)
void setFileName (const char *fn)
void setLineNumber (CORBA::ULong ln)
void setError (ACSErr::ACSErrType ty, ACSErr::ErrorCode ec)
void setSeverity (ACSErr::Severity severity)
ACSErr::ErrorTrace * getNext ()
bool last ()
ACSErr::ErrorTrace * top ()
ACSErr::ErrorTrace & getErrorTrace ()
ErrorTraceHelpergetErrorTraceHelper ()

Static Public Member Functions

void setHostName (const char *hn)
void setProcessName (const char *pn)
ACS::Time getTime ()

Protected Member Functions

 ErrorTraceHelper (ACSErr::ErrorTrace &et)
 ErrorTraceHelper (ACSErr::ErrorTrace &et, int depth)
 ErrorTraceHelper ()
 ErrorTraceHelper (ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *file, int line, const char *routine, const char *sd, ACSErr::Severity severity, ACSErr::ErrorTrace &errortrace)
 ErrorTraceHelper (const ACSErr::ErrorTrace &pet, ACSErr::ACSErrType et, ACSErr::ErrorCode ec, const char *file, int line, const char *routine, const char *sd, ACSErr::Severity severity, ACSErr::ErrorTrace &errortrace)
ErrorTraceHelperoperator= (ACSErr::ErrorTrace &eth)
void fill (ACSErr::ACSErrType et, ACSErr::ErrorCode ec, ACSErr::Severity severity, const char *file, int line, const char *routine, const char *sd)
void log (ACSErr::ErrorTrace *c, int level, char *stackId, ACE_Log_Priority priorty=LM_ERROR)
void toString (ACSErr::ErrorTrace *c, int level, std::ostringstream &oss)

Protected Attributes

ACSErr::ErrorTrace * m_errorTracePtr
ACSErr::ErrorTrace * m_current
unsigned int m_depth

Static Protected Attributes

char m_hostName [64]
char m_processName [64]
const unsigned int m_maxDepth

Detailed Description

Helper class for CORBA error trace (#ACSErr::ErrorTrace)


Constructor & Destructor Documentation

ACSErr::ErrorTraceHelper::ErrorTraceHelper ACSErr::ErrorTrace &  et  )  [protected]
 

ACSErr::ErrorTraceHelper::ErrorTraceHelper ACSErr::ErrorTrace &  et,
int  depth
[protected]
 

ACSErr::ErrorTraceHelper::ErrorTraceHelper  )  [protected]
 

ACSErr::ErrorTraceHelper::ErrorTraceHelper ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  file,
int  line,
const char *  routine,
const char *  sd,
ACSErr::Severity  severity,
ACSErr::ErrorTrace &  errortrace
[protected]
 

ACSErr::ErrorTraceHelper::ErrorTraceHelper const ACSErr::ErrorTrace &  pet,
ACSErr::ACSErrType  et,
ACSErr::ErrorCode  ec,
const char *  file,
int  line,
const char *  routine,
const char *  sd,
ACSErr::Severity  severity,
ACSErr::ErrorTrace &  errortrace
[protected]
 


Member Function Documentation

template<typename T>
void ACSErr::ErrorTraceHelper::addData const char *  name,
value
[inline]
 

Templated version of addData adds data (pair of name-value) It works for all types that can be put to std::ostringstream.

Parameters:
name data name, which should be shorter than 255 characters otherwise is truncated. If name is NULL the method return w/o setting anything.
value data value. The stringified length of value should not exceed 255 characters, otherwise it is truncated. If value is NULL the method return w/o setting anything.

void ACSErr::ErrorTraceHelper::addData const char *  name,
char *  value
[inline]
 

Variation of addData for non cons char* value, otherwise the template versioin is taken. It just pass work to addData(const char* name, const char* value).

void ACSErr::ErrorTraceHelper::addData const char *  name,
const char *  value
 

Adds data to the current error trace. If the name apperas more than one time it adds it more times.

Parameters:
name data name, which should be shorter than 255 characters otherwise is truncated. If name is NULL the method return w/o setting anything.
value string data value , which should be shorter than 255 characters, otherwise is truncated. If value is NULL the method return w/o setting anything.

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

ACE_CString ACSErr::ErrorTraceHelper::getData const char *  name  ) 
 

Gets data value for data name (first occurrence). If data for name is not found it returns an empty string.

Parameters:
name data name. If name is NULL an empty string is returned.
Returns:
value string data value

unsigned int ACSErr::ErrorTraceHelper::getDepth  )  [inline]
 

Returns depth of error stack

Returns:
unsigned int depth

char* ACSErr::ErrorTraceHelper::getDescription  ) 
 

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

Returns:
pointer to the char (=string). TBD: should return description if it is possible to retreive it. To be changed or removed. short description should be retreived using getShortDescription

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

Returns error code

Returns:
ACSErr::ErrorCode

ACSErr::ErrorTrace& ACSErr::ErrorTraceHelper::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

ErrorTraceHelper* ACSErr::ErrorTraceHelper::getErrorTraceHelper  )  [inline]
 

Return pointer to ErrorTraceHelper what is itself (=this). It is here just to make generated code simpler.

Returns:
pointer to itself

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

Returns error type

Returns:
ACSErr::ACSErrType

char* ACSErr::ErrorTraceHelper::getFileName  )  [inline]
 

Returns file name information of the error

Returns:
pointer to char contains file name

char* ACSErr::ErrorTraceHelper::getHostName  )  [inline]
 

Returns host name information of the error

Returns:
pointer to char contains host name

CORBA::ULong ACSErr::ErrorTraceHelper::getLineNumber  )  [inline]
 

Returns line number information of the error

Returns:
CORBA::ULong line number

template<typename T>
T ACSErr::ErrorTraceHelper::getMemberValue const char *  name  ) 
 

Another version of getMemberValue, which is more elegant since it returns value. This function is mainly used by generated code. It works for all types that can be retreived from std::istringstream like: int, string and double.

Parameters:
name data name
Returns:
data vlaue of right type

template<typename T>
void ACSErr::ErrorTraceHelper::getMemberValue const char *  name,
T &  value
[inline]
 

Template version of getMemberValue. Gets data value for data name (first occurrence). It works for all types that can be retreived from std::istringstream like: int, string and double. If data name is not found it returns empty string.

Parameters:
name data name
value data value

void ACSErr::ErrorTraceHelper::getMemberValue const char *  name,
char *&  value
[inline]
 

Gets data value for data name (first occurrence). This method is mainly used by generated code. If data for name is not found it returns an empty string.

Parameters:
name data name
value string data value

ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::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* ACSErr::ErrorTraceHelper::getProcessName  )  [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* ACSErr::ErrorTraceHelper::getRoutine  )  [inline]
 

Returns routine information of tehe error

Returns:
pointer to char contains routine name

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

Returns error severity

char* ACSErr::ErrorTraceHelper::getShortDescription  ) 
 

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

Returns:
pointer to the char (=string)

char* ACSErr::ErrorTraceHelper::getSourceObject  )  [inline]
 

Returns source object information of the error.

Returns:
pointer to the char points to the copy of the source object (caller has to delete it).

char* ACSErr::ErrorTraceHelper::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 ACSErr::ErrorTraceHelper::getTime  )  [static]
 

CORBA::ULongLong ACSErr::ErrorTraceHelper::getTimeStamp  )  [inline]
 

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

Returns:
CORBA::ULongLong time stamp

bool ACSErr::ErrorTraceHelper::last  )  [inline]
 

Tells if we are at the end of error trace. This method should be used with combination of getNext to find out when the end of the error trace is reached.

Returns:
true if we reach the end of error trace otherwise false

void ACSErr::ErrorTraceHelper::log ACSErr::ErrorTrace *  c,
int  level,
char *  stackId,
ACE_Log_Priority  priorty = LM_ERROR
[protected]
 

Logs just a single part (item) of an errortrace into the logging system. This method is used internaly by the log method

Parameters:
c pointer to error trace structure
level error trace level
priorty: priorty with which the error trace will be logged If priorty is not specified the completuion/error trace will be logged with ERROR priorty.

void ACSErr::ErrorTraceHelper::log ACE_Log_Priority  priorty = LM_ERROR  ) 
 

Logs the complete error trace into the logging system. For each such exception in the trace, a separate log entry is created, in accordance with the ACS error logging specification.

Parameters:
priorty: priorty with which the error trace will be logged If priorty is not specified the completion/error trace will be logged with ERROR priorty. The priority can be used to log an important error trace at LM_DEBUG level before sending it to a remote client. The responsibility of ultimately decide is an error trace shall be logged or closed is ultimately left to the higher level client, but a bad behaving client could "forget" to log. In order to make sure potentially critical information is not lost, the servant application can decide to log anyway the error trace as debug information before sending it to the client.

ErrorTraceHelper& ACSErr::ErrorTraceHelper::operator= ACSErr::ErrorTrace &  eth  )  [protected]
 

assigning ACSErr::ErrorTrace directly

void ACSErr::ErrorTraceHelper::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 ACSErr::ErrorTraceHelper::setFileName const char *  fn  )  [inline]
 

Sets file name

Parameters:
fn file name

void ACSErr::ErrorTraceHelper::setHostName const char *  hn  )  [static]
 

Sets host name

Parameters:
hn host name

void ACSErr::ErrorTraceHelper::setLineNumber CORBA::ULong  ln  )  [inline]
 

Sets line number

Parameters:
ln line number

template<typename T>
void ACSErr::ErrorTraceHelper::setMemberValue const char *  name,
value
[inline]
 

Sets member value. Template version of setMemberValue. This method is mainly used by generated code. It works for all types that can be put to std::ostringstream like: int, string and double.

Parameters:
name member name. If name is NULL it returns w/o setting anything.
value member value

void ACSErr::ErrorTraceHelper::setMemberValue const char *  name,
ACE_CString &  value
 

Version of setMember that takes value as ACE_CString. This method is mainly used by generated code. If this function is used the fist time it adds new name-value pair.

Parameters:
name data name. If name is NULL it returns w/o setting anything.
value string data value

void ACSErr::ErrorTraceHelper::setMemberValue const char *  name,
const char *  value
 

Sets member value of current error. This method is mainly used by generated code. If this function is used the fist time it adds new name-value pair.

Parameters:
name data name. If name or value are NULL it returns w/o setting anything.
value string data value

void ACSErr::ErrorTraceHelper::setProcessName const char *  pn  )  [static]
 

Sets process name

Parameters:
process name

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

Sets error severity

Parameters:
 severity errro severity

void ACSErr::ErrorTraceHelper::setSourceObject const char *  so  )  [inline]
 

Sets source object

Parameters:
source object

void ACSErr::ErrorTraceHelper::setTimeStamp CORBA::ULongLong  time  )  [inline]
 

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

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

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

Returns:
pointer to the errortrace structure

void ACSErr::ErrorTraceHelper::toString ACSErr::ErrorTrace *  c,
int  level,
std::ostringstream &  oss
[protected]
 

std::string ACSErr::ErrorTraceHelper::toString  ) 
 

Returns a string describing the error on top of the error trace.


Member Data Documentation

ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::m_current [protected]
 

unsigned int ACSErr::ErrorTraceHelper::m_depth [protected]
 

ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::m_errorTracePtr [protected]
 

char ACSErr::ErrorTraceHelper::m_hostName[64] [static, protected]
 

const unsigned int ACSErr::ErrorTraceHelper::m_maxDepth [static, protected]
 

char ACSErr::ErrorTraceHelper::m_processName[64] [static, protected]
 


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