ATLAS Offline Software
TPCnvElt.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef ATHENAPOOLCNVSVC_TPCNVELT_H
17 #define ATHENAPOOLCNVSVC_TPCNVELT_H
18 
19 
22 #include <typeinfo>
23 #include <memory>
24 class MsgStream;
25 
26 
30 template <class TRANS> class T_TPCnvNull
31 {
32 };
33 
34 
35 namespace AthenaPoolCnvSvc {
36 
37 
44 Guid guidFromTypeinfo (const std::type_info& ti);
45 
46 
59 template <class CNV, class TPCNV>
60 class TPCnvElt
61 {
62 public:
64  typedef typename TPCNV::Trans_t Trans_t;
65  typedef typename TPCNV::Pers_t Pers_t;
66 
67 
72 
73 
85  std::unique_ptr<Trans_t>
86  createTransient (CNV& parent, const std::string& key, MsgStream& msg);
87 
88 
101  bool persToTrans (CNV& parent, Trans_t* trans, const std::string& key, MsgStream& msg);
102 
103 
104 private:
107 
109  TPCNV m_cnv;
110 };
111 
112 
117 template <class CNV, class TRANS>
118 class TPCnvElt<CNV, T_TPCnvNull<TRANS> >
119 {
120 public:
122  typedef TRANS Trans_t;
123  typedef TRANS Pers_t;
124 
125 
130 
131 
143  std::unique_ptr<Trans_t>
144  createTransient (CNV& parent, const std::string& key, MsgStream& msg);
145 
146 
159  bool persToTrans (CNV& parent, Trans_t* trans, const std::string& key, MsgStream& msg);
160 
161 
162 private:
165 };
166 
167 
168 } // namespace AthenaPoolCnvSvc
169 
170 
172 
173 
174 #endif // not ATHENAPOOLCNVSVC_TPCNVELT_H
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::Pers_t
TRANS Pers_t
Definition: TPCnvElt.h:123
AthenaPoolCnvSvc::TPCnvElt::persToTrans
bool persToTrans(CNV &parent, Trans_t *trans, const std::string &key, MsgStream &msg)
Read the persistent object and convert it to transient.
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::createTransient
std::unique_ptr< Trans_t > createTransient(CNV &parent, const std::string &key, MsgStream &msg)
Read the persistent object and convert it to transient.
AthenaPoolCnvSvc::TPCnvElt::Pers_t
TPCNV::Pers_t Pers_t
Definition: TPCnvElt.h:65
TPCnvElt.icc
AthenaPoolCnvSvc::TPCnvElt
Helper for calling a TP converter from an Athena converter.
Definition: TPCnvElt.h:61
T_TPCnvNull
Placeholder for the case where no conversion is to be done.
Definition: TPCnvElt.h:31
AthenaPoolCnvSvc::TPCnvElt::createTransient
std::unique_ptr< Trans_t > createTransient(CNV &parent, const std::string &key, MsgStream &msg)
Read the persistent object and convert it to transient.
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::TPCnvElt
TPCnvElt()
Constructor.
AthenaPoolCnvSvc::TPCnvElt::Trans_t
TPCNV::Trans_t Trans_t
Make available the persistent and transient types.
Definition: TPCnvElt.h:64
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::persToTrans
bool persToTrans(CNV &parent, Trans_t *trans, const std::string &key, MsgStream &msg)
Read the persistent object and convert it to transient.
AthenaPoolCnvSvc::TPCnvElt::TPCnvElt
TPCnvElt()
Constructor.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthenaPoolCnvSvc::TPCnvElt::m_guid
Guid m_guid
GUID for the persistent class we read.
Definition: TPCnvElt.h:106
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::m_guid
Guid m_guid
GUID for the persistent class we read.
Definition: TPCnvElt.h:164
AthenaPoolCnvSvc::TPCnvElt< CNV, T_TPCnvNull< TRANS > >::Trans_t
TRANS Trans_t
Make available the persistent and transient types.
Definition: TPCnvElt.h:122
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
T_AthenaPoolCreateFuncs.h
Helpers for calling TP converters.
AthenaPoolCnvSvc::TPCnvElt::m_cnv
TPCNV m_cnv
The underlying TP converter.
Definition: TPCnvElt.h:109
Guid.h
This file contains the class definition for the Guid class (migrated from POOL).
AthenaPoolCnvSvc::guidFromTypeinfo
Guid guidFromTypeinfo(const std::type_info &ti)
Given a type_info, get the corresponding pool guid.
Definition: TPCnvElt.cxx:30
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
AthenaPoolCnvSvc
Definition: Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/debug.h:26