ATLAS Offline Software
StlAthenaPoolCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 
14 
15 template <class T>
17 {
18  friend class CnvFactory< StlAthenaPoolCnv<T> >;
21 public:
24  explicit StlAthenaPoolCnv(ISvcLocator* svcloc) : BaseCnv_t(svcloc) {}
25 
27  virtual StatusCode initialize() override
28  {
30 
31  RootType rflx_type{typeid(T)};
32  if (!rflx_type) {
33  ATH_MSG_ERROR("Could not get RootType from type_info ["
34  << typeid(T).name()
35  << "] for class ["
36  << ClassName<T>::name() << "]!");
37  return StatusCode::FAILURE;
38  }
39  this->BaseCnv_t::m_classDesc = std::move(rflx_type);
40  return StatusCode::SUCCESS;
41  }
42 };
43 
44 
45 #define DECL_CNV(NAME, TDEF) \
46  typedef StlAthenaPoolCnv< NAME > TDEF; \
47  template class StlAthenaPoolCnv< NAME >; \
48  DECLARE_CONVERTER(TDEF)
49 
50 #define DECL2_CNV(N1, N2, TDEF) \
51  typedef StlAthenaPoolCnv< N1, N2 > TDEF; \
52  template class StlAthenaPoolCnv< N1, N2 >; \
53  DECLARE_CONVERTER(TDEF)
54 
55 #include "SGTools/BuiltinsClids.h"
56 // cppcheck-suppress unknownMacro
57 DECL_CNV(int, AthenaPoolIntCnv)
58 DECL_CNV(unsigned int, AthenaPoolUIntCnv)
59 DECL_CNV(float, AthenaPoolFloatCnv)
60 DECL_CNV(double, AthenaPoolDoubleCnv)
61 DECL_CNV(std::string, AthenaPoolStdStringCnv)
62 
63 #include "SGTools/StlVectorClids.h"
64 DECL_CNV(std::vector<int>, AthenaPoolStdVectorIntCnv)
65 DECL_CNV(std::vector<unsigned int>, AthenaPoolStdVectorUIntCnv)
66 DECL_CNV(std::vector<float>, AthenaPoolStdVectorFloatCnv)
67 DECL_CNV(std::vector<double>, AthenaPoolStdVectorDoubleCnv)
68 
69 #include "SGTools/StlMapClids.h"
70 DECL2_CNV(std::map<int, int>, AthenaPoolStdMapIntIntCnv)
71 DECL2_CNV(std::map<int, float>, AthenaPoolStdMapIntFloatCnv)
72 DECL2_CNV(std::map<int, double>, AthenaPoolStdMapIntDoubleCnv)
73 
74 DECL2_CNV(std::map<std::string, int>, AthenaPoolStdMapStringIntCnv)
75 DECL2_CNV(std::map<std::string, unsigned int>, AthenaPoolStdMapStringUIntCnv)
76 DECL2_CNV(std::map<std::string, float>, AthenaPoolStdMapStringFloatCnv)
77 DECL2_CNV(std::map<std::string, double>, AthenaPoolStdMapStringDoubleCnv)
78 
T_AthenaPoolCnv
This templated class provides the converter to translate an object to/from its persistent POOL repres...
Definition: T_AthenaPoolCnv.h:61
DECL_CNV
#define DECL_CNV(NAME, TDEF)
Definition: StlAthenaPoolCnv.cxx:45
initialize
void initialize()
Definition: run_EoverP.cxx:894
BuiltinsClids.h
DECL2_CNV
#define DECL2_CNV(N1, N2, TDEF)
Definition: StlAthenaPoolCnv.cxx:50
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
StlAthenaPoolCnv
Definition: StlAthenaPoolCnv.cxx:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ClassName
An interface for getting the name of a class as a string.
Definition: AthenaKernel/AthenaKernel/ClassName.h:31
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CnvFactory
Abstract factory to create the converter.
Definition: ToyConverter.h:16
StlAthenaPoolCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition: StlAthenaPoolCnv.cxx:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
T_AthenaPoolCnv.h
his file contains the class definition for the templated T_AthenaPoolCnv class.
StlAthenaPoolCnv::StlAthenaPoolCnv
StlAthenaPoolCnv(ISvcLocator *svcloc)
Standard constructor.
Definition: StlAthenaPoolCnv.cxx:24
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TScopeAdapter
Definition: RootType.h:119