ATLAS Offline Software
Loading...
Searching...
No Matches
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
15template <class T>
17{
18 friend class CnvFactory< StlAthenaPoolCnv<T> >;
21public:
24 explicit StlAthenaPoolCnv(ISvcLocator* svcloc) : BaseCnv_t(svcloc) {}
25
27 virtual StatusCode initialize() override
28 {
29 ATH_CHECK( this->BaseCnv_t::initialize() );
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
56// cppcheck-suppress unknownMacro
57DECL_CNV(int, AthenaPoolIntCnv)
58DECL_CNV(unsigned int, AthenaPoolUIntCnv)
59DECL_CNV(float, AthenaPoolFloatCnv)
60DECL_CNV(double, AthenaPoolDoubleCnv)
61DECL_CNV(std::string, AthenaPoolStdStringCnv)
62
63#include "SGTools/StlVectorClids.h"
64DECL_CNV(std::vector<int>, AthenaPoolStdVectorIntCnv)
65DECL_CNV(std::vector<unsigned int>, AthenaPoolStdVectorUIntCnv)
66DECL_CNV(std::vector<float>, AthenaPoolStdVectorFloatCnv)
67DECL_CNV(std::vector<double>, AthenaPoolStdVectorDoubleCnv)
68
69#include "SGTools/StlMapClids.h"
70DECL2_CNV(std::map<int, int>, AthenaPoolStdMapIntIntCnv)
71DECL2_CNV(std::map<int, float>, AthenaPoolStdMapIntFloatCnv)
72DECL2_CNV(std::map<int, double>, AthenaPoolStdMapIntDoubleCnv)
73
74DECL2_CNV(std::map<std::string, int>, AthenaPoolStdMapStringIntCnv)
75DECL2_CNV(std::map<std::string, unsigned int>, AthenaPoolStdMapStringUIntCnv)
76DECL2_CNV(std::map<std::string, float>, AthenaPoolStdMapStringFloatCnv)
77DECL2_CNV(std::map<std::string, double>, AthenaPoolStdMapStringDoubleCnv)
78
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
TTypeAdapter RootType
Definition RootType.h:211
#define DECL_CNV(NAME, TDEF)
#define DECL2_CNV(N1, N2, TDEF)
his file contains the class definition for the templated T_AthenaPoolCnv class.
static std::string name()
Return the name of class T as a string.
Abstract factory to create the converter.
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
T_AthenaPoolCnv< T > BaseCnv_t
StlAthenaPoolCnv(ISvcLocator *svcloc)
Standard constructor.
StlAthenaPoolCnv< T > Self_t
This templated class provides the converter to translate an object to/from its persistent POOL repres...