#include <acserr.h>
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 () |
ErrorTraceHelper * | getErrorTraceHelper () |
template<> | |
char * | getMemberValue (const char *name) |
template<> | |
ACE_CString | getMemberValue (const char *name) |
Static Public Member Functions | |
static void | setHostName (const char *hn) |
static void | setProcessName (const char *pn) |
static ACS::Time | getTime () |
Protected Member Functions | |
ErrorTraceHelper (ACSErr::ErrorTrace &et) | |
void | setErrorTrace (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) | |
ErrorTraceHelper & | operator= (ACSErr::ErrorTrace ð) |
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 | |
static char | m_hostName [64] |
static char | m_processName [64] |
static const unsigned int | m_maxDepth |
Friends | |
class | CompletionImpl |
class | ::ACSLogImpl |
class | ::ACSError |
Helper class for CORBA error trace (ACSErr::ErrorTrace)
ACSErr::ErrorTraceHelper::ErrorTraceHelper | ( | ACSErr::ErrorTrace & | et | ) | [protected] |
ACSErr::ErrorTraceHelper::ErrorTraceHelper | ( | ) | [inline, 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] |
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.
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. |
Referenced by ACSErr::CompletionImpl::addData(), and addData().
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).
References addData().
void ACSErr::ErrorTraceHelper::addData | ( | const char * | name, | |
T | value | |||
) | [inline] |
Templated version of addData adds data (pair of name-value) It works for all types that can be put to std::ostringstream.
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. |
References addData().
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.
name | data name. If name is NULL an empty string is returned. |
Referenced by getMemberValue().
unsigned int ACSErr::ErrorTraceHelper::getDepth | ( | ) | [inline] |
char* ACSErr::ErrorTraceHelper::getDescription | ( | ) |
Returns copy of short (!) description of current error. User have to take care of releasing it!
ACSErr::ErrorCode ACSErr::ErrorTraceHelper::getErrorCode | ( | ) | [inline] |
ACSErr::ErrorTrace& ACSErr::ErrorTraceHelper::getErrorTrace | ( | ) | [inline] |
ErrorTraceHelper* ACSErr::ErrorTraceHelper::getErrorTraceHelper | ( | ) | [inline] |
Return pointer to ErrorTraceHelper what is itself (=this). It is here just to make generated code simpler.
ACSErr::ACSErrType ACSErr::ErrorTraceHelper::getErrorType | ( | ) | [inline] |
char* ACSErr::ErrorTraceHelper::getFileName | ( | ) | [inline] |
Returns file name information of the error
References m_current.
char* ACSErr::ErrorTraceHelper::getHostName | ( | ) | [inline] |
Returns host name information of the error
References m_current.
CORBA::ULong ACSErr::ErrorTraceHelper::getLineNumber | ( | ) | [inline] |
char* ACSErr::ErrorTraceHelper::getMemberValue | ( | const char * | name | ) |
ACE_CString ACSErr::ErrorTraceHelper::getMemberValue | ( | const char * | name | ) |
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.
name | data name | |
value | string data value |
References getData().
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.
name | data name | |
value | data value |
References getData().
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.
name | data name |
References getData().
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
char* ACSErr::ErrorTraceHelper::getProcessName | ( | ) | [inline] |
Retruns process information of the error. Its name or process ID.
References m_current.
char* ACSErr::ErrorTraceHelper::getRoutine | ( | ) | [inline] |
Returns routine information of tehe error
References m_current.
ACSErr::Severity ACSErr::ErrorTraceHelper::getSeverity | ( | ) | [inline] |
Returns error severity
References m_current.
char* ACSErr::ErrorTraceHelper::getShortDescription | ( | ) |
Returns copy of short description of current error. User have to take care of releasing it!
char* ACSErr::ErrorTraceHelper::getSourceObject | ( | ) | [inline] |
Returns source object information of the error.
References m_current.
char* ACSErr::ErrorTraceHelper::getThread | ( | ) | [inline] |
Returns thread information of the error. The name of thread or its ID.
References m_current.
static ACS::Time ACSErr::ErrorTraceHelper::getTime | ( | ) | [static] |
CORBA::ULongLong ACSErr::ErrorTraceHelper::getTimeStamp | ( | ) | [inline] |
Returns time stamp of the error in 100th of nanoseconds.
References m_current.
bool ACSErr::ErrorTraceHelper::last | ( | ) | [inline] |
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.
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. |
Referenced by AcsBulkdata::BulkDataDistributerNotifCb< BulkDataDistributerStreamCb, BulkDataSenderDefaultCallback >::done(), BaciTestClassImpl::turnOffMonitoring(), and BaciTestClassImpl::turnOnMonitoring().
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
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. |
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
ty | error type (should be of type ACSErr::ACSErrType defined in acserrType.idl) | |
ec | erro code |
References m_current.
void ACSErr::ErrorTraceHelper::setErrorTrace | ( | ACSErr::ErrorTrace & | et, | |
int | depth | |||
) | [protected] |
void ACSErr::ErrorTraceHelper::setFileName | ( | const char * | fn | ) | [inline] |
static void ACSErr::ErrorTraceHelper::setHostName | ( | const char * | hn | ) | [static] |
Sets host name
hn | host name |
void ACSErr::ErrorTraceHelper::setLineNumber | ( | CORBA::ULong | ln | ) | [inline] |
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.
name | data name. If name or value are NULL it returns w/o setting anything. | |
value | string data value |
Referenced by setMemberValue().
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.
name | data name. If name is NULL it returns w/o setting anything. | |
value | string data value |
void ACSErr::ErrorTraceHelper::setMemberValue | ( | const char * | name, | |
T | 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.
name | member name. If name is NULL it returns w/o setting anything. | |
value | member value |
References NULL, and setMemberValue().
static void ACSErr::ErrorTraceHelper::setProcessName | ( | const char * | pn | ) | [static] |
Sets process name
process | name |
void ACSErr::ErrorTraceHelper::setSeverity | ( | ACSErr::Severity | severity | ) | [inline] |
void ACSErr::ErrorTraceHelper::setSourceObject | ( | const char * | so | ) | [inline] |
void ACSErr::ErrorTraceHelper::setTimeStamp | ( | CORBA::ULongLong | time | ) | [inline] |
Sets time stamp of the error in 100th of nanoseconds. time CORBA::ULongLong time stamp
References m_current.
ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::top | ( | ) | [inline] |
Moves to the first (top) errortrace element and return its pointer (not copy).
References m_current, and m_errorTracePtr.
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.
friend class ::ACSError [friend] |
friend class ::ACSLogImpl [friend] |
friend class CompletionImpl [friend] |
ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::m_current [protected] |
Referenced by getErrorCode(), getErrorTrace(), getErrorType(), getFileName(), getHostName(), getLineNumber(), getProcessName(), getRoutine(), getSeverity(), getSourceObject(), getThread(), getTimeStamp(), last(), setError(), setFileName(), setLineNumber(), setSeverity(), setSourceObject(), setTimeStamp(), and top().
unsigned int ACSErr::ErrorTraceHelper::m_depth [protected] |
Referenced by getDepth(), and last().
ACSErr::ErrorTrace* ACSErr::ErrorTraceHelper::m_errorTracePtr [protected] |
Referenced by top().
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] |