ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CaloID_Exception Class Reference

Exception class for Calo Identifiers. More...

#include <CaloID_Exception.h>

Collaboration diagram for CaloID_Exception:

Public Member Functions

 CaloID_Exception ()
 default constructor More...
 
 CaloID_Exception (const std::string &lMessage, int lCode)
 constructor to be used More...
 
void message (const std::string &lMessage)
 set error message More...
 
std::string message () const
 return error message
More...
 
void code (int lCode)
 set error code number
More...
 
int code () const
 return error code

More...
 
 operator std::string () const
 

Private Attributes

std::string m_message
 error message More...
 
int m_code
 error code More...
 

Detailed Description

Exception class for Calo Identifiers.

Author
Johann Collot , Fabienne Ledroit (cloning LArID_Exception)

Definition at line 20 of file CaloID_Exception.h.

Constructor & Destructor Documentation

◆ CaloID_Exception() [1/2]

CaloID_Exception::CaloID_Exception ( )

default constructor

Definition at line 11 of file CaloID_Exception.cxx.

11  :
12 m_message("No error message") , m_code( 999 )
13 { }

◆ CaloID_Exception() [2/2]

CaloID_Exception::CaloID_Exception ( const std::string &  lMessage,
int  lCode 
)

constructor to be used

Definition at line 15 of file CaloID_Exception.cxx.

15  :
16 m_message ( lMessage ) , m_code ( lCode )
17 { }

Member Function Documentation

◆ code() [1/2]

int CaloID_Exception::code ( ) const

return error code

error codes :
0 : no error
1 : CaloLVL1_ID::region_id Error
2 : CaloLVL1_ID::channel_id Error
3 : LArDM::region_id Error
4 : LArDM::zone_id Error
999 : undefined error

Definition at line 28 of file CaloID_Exception.cxx.

29 { return m_code;}

◆ code() [2/2]

void CaloID_Exception::code ( int  lCode)

set error code number

Definition at line 25 of file CaloID_Exception.cxx.

26 { m_code = lCode ;}

◆ message() [1/2]

std::string CaloID_Exception::message ( ) const

return error message

Definition at line 22 of file CaloID_Exception.cxx.

23 { return m_message;}

◆ message() [2/2]

void CaloID_Exception::message ( const std::string &  lMessage)

set error message

Definition at line 19 of file CaloID_Exception.cxx.

20 { m_message = lMessage ;}

◆ operator std::string()

CaloID_Exception::operator std::string ( ) const

Definition at line 31 of file CaloID_Exception.cxx.

33 {
34  return
35  strformat ("CaloID_Exception - Error code: %d \n ", this->code()) +
36  this->message();
37 }

Member Data Documentation

◆ m_code

int CaloID_Exception::m_code
private

error code

Definition at line 74 of file CaloID_Exception.h.

◆ m_message

std::string CaloID_Exception::m_message
private

error message

Definition at line 69 of file CaloID_Exception.h.


The documentation for this class was generated from the following files:
CaloID_Exception::m_message
std::string m_message
error message
Definition: CaloID_Exception.h:69
CaloID_Exception::code
int code() const
return error code
Definition: CaloID_Exception.cxx:28
CaloID_Exception::message
std::string message() const
return error message
Definition: CaloID_Exception.cxx:22
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition: StrFormat.cxx:49
CaloID_Exception::m_code
int m_code
error code
Definition: CaloID_Exception.h:74