ATLAS Offline Software
Loading...
Searching...
No Matches
Calorimeter
CaloIdentifier
src
CaloID_Exception.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CaloIdentifier/CaloID_Exception.h
"
6
#include "
CxxUtils/StrFormat.h
"
7
8
using
CxxUtils::strformat
;
9
10
11
CaloID_Exception::CaloID_Exception
() :
12
m_message
(
"No error message"
) ,
m_code
( 999 )
13
{ }
14
15
CaloID_Exception::CaloID_Exception
(
const
std::string& lMessage ,
int
lCode) :
16
m_message
( lMessage ) ,
m_code
( lCode )
17
{ }
18
19
void
CaloID_Exception::message
(
const
std::string& lMessage)
20
{
m_message
= lMessage ;}
21
22
const
std::string&
CaloID_Exception::message
()
const
23
{
return
m_message
;}
24
25
void
CaloID_Exception::code
(
int
lCode)
26
{
m_code
= lCode ;}
27
28
int
CaloID_Exception::code
()
const
29
{
return
m_code
;}
30
31
CaloID_Exception::operator std::string ()
const
32
33
{
34
return
35
strformat
(
"CaloID_Exception - Error code: %d \n "
, this->
code
()) +
36
this->
message
();
37
}
38
strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition
StrFormat.cxx:49
CaloID_Exception.h
StrFormat.h
Provide helper functions to create formatted strings.
CaloID_Exception::message
const std::string & message() const
return error message
Definition
CaloID_Exception.cxx:22
CaloID_Exception::code
int code() const
return error code
Definition
CaloID_Exception.cxx:28
CaloID_Exception::CaloID_Exception
CaloID_Exception()
default constructor
Definition
CaloID_Exception.cxx:11
CaloID_Exception::code
void code(int lCode)
set error code number
Definition
CaloID_Exception.cxx:25
CaloID_Exception::m_code
int m_code
error code
Definition
CaloID_Exception.h:74
CaloID_Exception::m_message
std::string m_message
error message
Definition
CaloID_Exception.h:69
CaloID_Exception::message
void message(const std::string &lMessage)
set error message
Definition
CaloID_Exception.cxx:19
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition
StrFormat.cxx:49
Generated on
for ATLAS Offline Software by
1.14.0