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 9 of file CaloID_Exception.cxx.

9 :
10m_message("No error message") , m_code( 999 )
11{ }
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 13 of file CaloID_Exception.cxx.

13 :
14m_message ( lMessage ) , m_code ( lCode )
15{ }

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 26 of file CaloID_Exception.cxx.

27{ return m_code;}

◆ code() [2/2]

void CaloID_Exception::code ( int lCode)

set error code number

Definition at line 23 of file CaloID_Exception.cxx.

24{ m_code = lCode ;}

◆ message() [1/2]

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

return error message

Definition at line 20 of file CaloID_Exception.cxx.

21{ return m_message;}

◆ message() [2/2]

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

set error message

Definition at line 17 of file CaloID_Exception.cxx.

18{ m_message = lMessage ;}

◆ operator std::string()

CaloID_Exception::operator std::string ( ) const

Definition at line 29 of file CaloID_Exception.cxx.

31{
32 return
33 std::format ("CaloID_Exception - Error code: {} \n{} ", this->code(),
34 this->message());
35}
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: