Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
GaudiException Class Reference

Define general base for Gaudi exception. More...

#include <GaudiKernel/GaudiException.h>

Inheritance diagram for GaudiException:
Inheritance graph
[legend]
Collaboration diagram for GaudiException:
Collaboration graph
[legend]

Public Member Functions

 GaudiException (const std::string &Message, const std::string &Tag, const StatusCode &Code)
 Constructor (1)
 
 GaudiException (const std::string &Message, const std::string &Tag, const StatusCode &Code, const GaudiException &Exception)
 Constructor (2)
 
 GaudiException (const std::string &Message, const std::string &Tag, const StatusCode &Code, const std::exception &Exception)
 Constructor (3)
 
 GaudiException (const GaudiException &Exception)
 Copy constructor (deep copying!)
 
virtual ~GaudiException () throw ()
 destructor (perform the deletion of "previous" field!)
 
GaudiExceptionoperator= (const GaudiException &Exception)
 assignment operator
 
virtual const std::stringmessage () const
 error message to be printed
 
virtual const std::stringsetMessage (const std::string &newMessage)
 update the error message to be printed
 
virtual const std::stringtag () const
 name tag for the exception, or exception type
 
virtual const std::stringsetTag (const std::string &newTag)
 update name tag
 
virtual const StatusCodecode () const
 StatusCode for Exception.
 
virtual const StatusCodesetCode (const StatusCode &newStatus)
 update the status code for the exception
 
virtual GaudiExceptionprevious () const
 get the previous exception ( "previous" element in the linked list)
 
virtual std::ostreamprintOut (std::ostream &os=std::cerr) const
 methods for overloaded printout to std::ostream& and MsgStream&
 
virtual MsgStreamprintOut (MsgStream &os) const
 Output the exception to the Gaudi MsgStream.
 
virtual GaudiExceptionclone () const
 clone operation
 
virtual const char * what () const throw ()
 method from std::exception
 
- Public Member Functions inherited from std::exception
 exception ()
 

Protected Attributes

std::string m_message
 
std::string m_tag
 error message
 
StatusCode m_code
 exception tag
 
GaudiExceptionm_previous
 status code for exception
 

Static Protected Attributes

static bool s_proc
 "previous" element in the linked list
 

Friends

class StatusCode
 
std::ostreamoperator<< (std::ostream &os, const GaudiException &ge)
 overloaded printout to std::ostream
 
std::ostreamoperator<< (std::ostream &os, const GaudiException *pge)
 
MsgStreamoperator<< (MsgStream &os, const GaudiException &ge)
 overloaded printout to MsgStream
 
MsgStreamoperator<< (MsgStream &os, const GaudiException *pge)
 overloaded printout to MsgStream
 

Detailed Description

Define general base for Gaudi exception.

Author
Vanya Belyaev
Sebastien Ponce

Definition at line 24 of file GaudiException.h.

Constructor & Destructor Documentation

GaudiException::GaudiException ( const std::string Message,
const std::string Tag,
const StatusCode Code 
)
inline

Constructor (1)

Parameters
Messageerror message
Tag"name tag", or exeption type
Codestatus code

Definition at line 42 of file GaudiException.h.

, m_tag ( Tag )
, m_code ( Code )
, m_previous ( 0 )
{ s_proc = true; }
GaudiException::GaudiException ( const std::string Message,
const std::string Tag,
const StatusCode Code,
const GaudiException Exception 
)
inline

Constructor (2)

Parameters
Messageerror message
Tag"name tag", or exeption type
Codestatus code
Exception"previous" exception

Definition at line 57 of file GaudiException.h.

, m_tag ( Tag )
, m_code ( Code )
, m_previous ( Exception.clone() )
{}
GaudiException::GaudiException ( const std::string Message,
const std::string Tag,
const StatusCode Code,
const std::exception Exception 
)
inline

Constructor (3)

Parameters
Messageerror message
Tag"name tag", or exeption type
Codestatus code
Exception"previous" exception (used to improve the error message)

Definition at line 73 of file GaudiException.h.

, m_tag ( Tag )
, m_code ( Code )
, m_previous ( 0 )
{
s_proc = true;
m_message += ": " + System::typeinfoName(typeid(Exception)) + ", " +
Exception.what();
}
GaudiException::GaudiException ( const GaudiException Exception)
inline

Copy constructor (deep copying!)

Definition at line 88 of file GaudiException.h.

: std::exception(Exception)
{
s_proc = true;
m_message = Exception.message() ;
m_tag = Exception.tag () ;
m_code = Exception.code () ;
m_previous = ( 0 == Exception.previous() ) ?
0 : Exception.previous()->clone() ;
}
virtual GaudiException::~GaudiException ( ) throw ()
inlinevirtual

destructor (perform the deletion of "previous" field!)

Definition at line 99 of file GaudiException.h.

{
if( 0 != m_previous ) { delete m_previous ; m_previous = 0 ; }
s_proc = false;
}

Member Function Documentation

virtual GaudiException* GaudiException::clone ( ) const
inlinevirtual

clone operation

Reimplemented in UpdateManagerException.

Definition at line 167 of file GaudiException.h.

{ return new GaudiException(*this); }
virtual const StatusCode& GaudiException::code ( ) const
inlinevirtual

StatusCode for Exception.

Definition at line 134 of file GaudiException.h.

{ return m_code; }
virtual const std::string& GaudiException::message ( ) const
inlinevirtual

error message to be printed

Definition at line 118 of file GaudiException.h.

{ return m_message; }
GaudiException& GaudiException::operator= ( const GaudiException Exception)
inline

assignment operator

Definition at line 106 of file GaudiException.h.

{
if ( &Exception == this ) { return *this; }
m_message = Exception.message() ;
m_tag = Exception.tag () ;
m_code = Exception.code () ;
if( 0 != m_previous ) { delete m_previous; m_previous = 0 ; }
m_previous = ( 0 == Exception.previous() ) ?
0 : Exception.previous()->clone() ;
return *this;
}
virtual GaudiException* GaudiException::previous ( ) const
inlinevirtual

get the previous exception ( "previous" element in the linked list)

Definition at line 142 of file GaudiException.h.

{ return m_previous ; }
virtual std::ostream& GaudiException::printOut ( std::ostream os = std::cerr) const
inlinevirtual

methods for overloaded printout to std::ostream& and MsgStream&

Definition at line 145 of file GaudiException.h.

{
os << tag() << " \t " << message() ;
switch( code() ) {
case StatusCode::SUCCESS : os << "\t StatusCode=SUCCESS" ; break ;
case StatusCode::FAILURE : os << "\t StatusCode=FAILURE" ; break ;
default : os << "\t StatusCode=" << code() ; break ;
}
return ( 0 != previous() ) ? previous()->printOut( os << std::endl ) : os ;
}
virtual MsgStream& GaudiException::printOut ( MsgStream os) const
inlinevirtual

Output the exception to the Gaudi MsgStream.

Definition at line 156 of file GaudiException.h.

{
os << tag() << "\t" << message() ;
switch( code() ) {
case StatusCode::SUCCESS : os << "\t StatusCode=SUCCESS" ; break ;
case StatusCode::FAILURE : os << "\t StatusCode=FAILURE" ; break ;
default : os << "\t StatusCode=" << code().getCode() ; break ;
}
return ( 0 != previous() ) ? previous()->printOut( os << endmsg ) : os ;
}
virtual const StatusCode& GaudiException::setCode ( const StatusCode newStatus)
inlinevirtual

update the status code for the exception

Definition at line 137 of file GaudiException.h.

{
m_code = newStatus; return code() ;
}
virtual const std::string& GaudiException::setMessage ( const std::string newMessage)
inlinevirtual

update the error message to be printed

Definition at line 121 of file GaudiException.h.

{
m_message = newMessage; return message() ;
}
virtual const std::string& GaudiException::setTag ( const std::string newTag)
inlinevirtual

update name tag

Definition at line 129 of file GaudiException.h.

{
m_tag = newTag ; return tag() ;
}
virtual const std::string& GaudiException::tag ( ) const
inlinevirtual

name tag for the exception, or exception type

Definition at line 126 of file GaudiException.h.

{ return m_tag; }
virtual const char* GaudiException::what ( ) const throw ()
inlinevirtual

method from std::exception

Reimplemented from std::exception.

Definition at line 170 of file GaudiException.h.

{ return message().c_str() ; }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream os,
const GaudiException ge 
)
friend

overloaded printout to std::ostream

Definition at line 180 of file GaudiException.h.

{
return ge.printOut( os );
}
std::ostream& operator<< ( std::ostream os,
const GaudiException pge 
)
friend

Definition at line 183 of file GaudiException.h.

{ return (0 == pge) ?
( os << " GaudiException* points to NULL!" ) : ( os << *pge ); }
MsgStream& operator<< ( MsgStream os,
const GaudiException ge 
)
friend

overloaded printout to MsgStream

Definition at line 188 of file GaudiException.h.

{
return ge.printOut( os );
}
MsgStream& operator<< ( MsgStream os,
const GaudiException pge 
)
friend

overloaded printout to MsgStream

Definition at line 192 of file GaudiException.h.

{
return (0 == pge) ?
( os << " GaudiException* points to NULL!" ) : ( os << *pge );
}
friend class StatusCode
friend

Definition at line 34 of file GaudiException.h.

Member Data Documentation

StatusCode GaudiException::m_code
mutableprotected

exception tag

Definition at line 174 of file GaudiException.h.

std::string GaudiException::m_message
mutableprotected

Definition at line 172 of file GaudiException.h.

GaudiException* GaudiException::m_previous
mutableprotected

status code for exception

Definition at line 175 of file GaudiException.h.

std::string GaudiException::m_tag
mutableprotected

error message

Definition at line 173 of file GaudiException.h.

bool GaudiException::s_proc
staticprotected

"previous" element in the linked list

Definition at line 176 of file GaudiException.h.


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

Generated at Wed Dec 4 2013 14:33:15 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004