ATLAS Offline Software
T_AthenaPoolCustCnv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLCUSTCNV_H
6 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLCUSTCNV_H
7 
14 
17 
18 namespace pool {
20 }
21 
22 #include <string>
23 #include <map>
24 
25 class DataObject;
26 class StatusCode;
27 
29 template <class TYPE> class CnvFactory;
30 
34 template <class TRANS, class PERS>
36  friend class CnvFactory<T_AthenaPoolCustCnv<TRANS, PERS> >;
37 
38 protected:
40  T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator,
41  const char* name = nullptr);
42 
45 
47  template <class P>
48  Placement setPlacementForP(P& p, const std::string& key, const std::string& output);
49 
53  virtual StatusCode DataObjectToPers(DataObject* pObj, IOpaqueAddress*& pAddr);
54 
58  virtual StatusCode DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj);
59 
64  virtual StatusCode PoolToDataObject(DataObject*& pObj, const Token* token,
65  const std::string& key);
66 
71  template <class P>
72  StatusCode objectToPool(P* pObj, Token*& token, const std::string& key, const std::string& output);
73 
77  template <class P>
78  StatusCode poolToObject(const Token*& token, P*& pObj);
79 
80  virtual StatusCode transToPers(TRANS* obj, PERS*& persObj) = 0;
81  virtual StatusCode persToTrans(TRANS*& transObj, PERS* obj) = 0;
82 
86  virtual bool compareClassGuid(const Guid &clid) const;
87 
92  virtual void setToken(const std::string& token);
93 
94  // the POOL class ID (GUID) of the object being read.
95  // Set by PoolToDataObject() available in createTransient()
97 
98 public:
100  static const CLID& classID();
101 
102 private:
103  std::map<DataObject*, PERS*> m_persMap;
104 };
105 
107 #endif
T_AthenaPoolCustCnv.icc
T_AthenaPoolCustCnv::m_classID
Guid m_classID
Definition: T_AthenaPoolCustCnv.h:96
Placement
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition: Placement.h:19
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
T_AthenaPoolCustCnv::DataObjectToPers
virtual StatusCode DataObjectToPers(DataObject *pObj, IOpaqueAddress *&pAddr)
Convert an object into Persistent.
pool
pool namespace
Definition: libname.h:15
T_AthenaPoolCnvBase
This templated class provides the converter to translate an object to/from its persistent POOL repres...
Definition: T_AthenaPoolCnvBase.h:24
T_AthenaPoolCnvBase.h
his file contains the class definition for the templated T_AthenaPoolCnvBase class.
T_AthenaPoolCustCnv::m_persMap
std::map< DataObject *, PERS * > m_persMap
Definition: T_AthenaPoolCustCnv.h:103
T_AthenaPoolCustCnv
This templated class provides the converter to translate an object to/from its persistent POOL repres...
Definition: T_AthenaPoolCustCnv.h:35
T_AthenaPoolCustCnv::setToken
virtual void setToken(const std::string &token)
Set the token (in std::string representation) and classID for the object that will be read next.
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
T_AthenaPoolCustCnv::PoolToDataObject
virtual StatusCode PoolToDataObject(DataObject *&pObj, const Token *token, const std::string &key)
Read an object from POOL.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
T_AthenaPoolCustCnv::poolToObject
StatusCode poolToObject(const Token *&token, P *&pObj)
Read an object from POOL.
T_AthenaPoolCustCnv::DataObjectToPool
virtual StatusCode DataObjectToPool(IOpaqueAddress *pAddr, DataObject *pObj)
Write an object into POOL.
CnvFactory
Abstract factory to create the converter.
Definition: ToyConverter.h:16
T_AthenaPoolCustCnv::setPlacementForP
Placement setPlacementForP(P &p, const std::string &key, const std::string &output)
Set POOL placement for type P.
T_AthenaPoolCustCnv::T_AthenaPoolCustCnv
T_AthenaPoolCustCnv(ISvcLocator *pSvcLocator, const char *name=nullptr)
Constructor.
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
T_AthenaPoolCustCnv::objectToPool
StatusCode objectToPool(P *pObj, Token *&token, const std::string &key, const std::string &output)
Write an object into POOL returning its token.
merge.output
output
Definition: merge.py:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
RpcSectorLogicContainer_p1
Class to represent.
Definition: RpcSectorLogicContainer_p1.h:19
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
T_AthenaPoolCustCnv::transToPers
virtual StatusCode transToPers(TRANS *obj, PERS *&persObj)=0
T_AthenaPoolCustCnv::classID
static const CLID & classID()
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
Guid.h
This file contains the class definition for the Guid class (migrated from POOL).
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
python.PyAthena.obj
obj
Definition: PyAthena.py:135
Token.h
This file contains the class definition for the Token class (migrated from POOL).
T_AthenaPoolCustCnv::persToTrans
virtual StatusCode persToTrans(TRANS *&transObj, PERS *obj)=0
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37