ATLAS Offline Software
Loading...
Searching...
No Matches
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
 CaloID_Exception (const std::string &lMessage, int lCode)
 constructor to be used
void message (const std::string &lMessage)
 set error message
const std::string & message () const
 return error message

void code (int lCode)
 set error code number

int code () const
 return error code


 operator std::string () const

Private Attributes

std::string m_message
 error message
int m_code
 error code

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 :
12m_message("No error message") , m_code( 999 )
13{ }
int m_code
error code
std::string m_message
error message

◆ 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 :
16m_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]

const 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}
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition StrFormat.cxx:49
const std::string & message() const
return error message
int code() const
return error code

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: