ATLAS Offline Software
CrestCondException.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2019-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef CREST_COND_EXCEPTION_H
6 #define CREST_COND_EXCEPTION_H
7 #include <iostream>
8 #include <stdexcept>
9 
10 namespace Crest {
11  const unsigned int UNKNOWN_TYPE = -1;
12  const unsigned int COMMON_TYPE = 0;
13  const unsigned int FINALIZE_STRUCTURE_TYPE = 1;
14  const unsigned int EXISTS_TYPE = 2;
16  protected:
17  std::string m_text;
20  public:
21  char const* what() const throw() { return m_text.c_str(); }
22  uint32_t getType() {return m_type;}
23  };
24 
26  public:
27  FinStructureException(){ m_text="Error: Can not change structure because data already exists.";m_type=FINALIZE_STRUCTURE_TYPE;}
28  };
30  public:
31  ColumnExistException(const char* name){ m_text="Error: The column with name '"+std::string(name)+ "' already exists.";m_type=EXISTS_TYPE;}
32  };
34  public:
35  CommonCrestException(const char* text){m_text="Error: "+std::string(text); m_type=COMMON_TYPE;}
36  };
37 
38 }
39 
40 #endif
Crest::CrestBaseException::CrestBaseException
CrestBaseException()
Definition: CrestCondException.h:19
Crest::CrestBaseException::m_type
uint32_t m_type
Definition: CrestCondException.h:18
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Crest::UNKNOWN_TYPE
const unsigned int UNKNOWN_TYPE
Definition: CrestCondException.h:11
Crest::ColumnExistException
Definition: CrestCondException.h:29
Crest
Definition: CrestApi.h:30
Crest::FINALIZE_STRUCTURE_TYPE
const unsigned int FINALIZE_STRUCTURE_TYPE
Definition: CrestCondException.h:13
Crest::CrestBaseException::m_text
std::string m_text
Definition: CrestCondException.h:17
Crest::ColumnExistException::ColumnExistException
ColumnExistException(const char *name)
Definition: CrestCondException.h:31
Crest::CrestBaseException
Definition: CrestCondException.h:15
calibdata.exception
exception
Definition: calibdata.py:496
Crest::CrestBaseException::what
char const * what() const
Definition: CrestCondException.h:21
Crest::CommonCrestException
Definition: CrestCondException.h:33
Crest::CrestBaseException::getType
uint32_t getType()
Definition: CrestCondException.h:22
Crest::COMMON_TYPE
const unsigned int COMMON_TYPE
Definition: CrestCondException.h:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Crest::FinStructureException
Definition: CrestCondException.h:25
Crest::EXISTS_TYPE
const unsigned int EXISTS_TYPE
Definition: CrestCondException.h:14
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
Crest::FinStructureException::FinStructureException
FinStructureException()
Definition: CrestCondException.h:27
Crest::CommonCrestException::CommonCrestException
CommonCrestException(const char *text)
Definition: CrestCondException.h:35