Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
T_AthenaPoolCoolMultChanCnv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLCOOLMULTCHANCNV_H
6 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLCOOLMULTCHANCNV_H
7 
19 
20 #include <string>
21 
22 class DataObject;
23 class StatusCode;
25 
27 template <class TYPE> class CnvFactory;
28 
35 template <class COLL_T, class ELEM_T, class ELEM_P = ELEM_T>
36 class T_AthenaPoolCoolMultChanCnv : public T_AthenaPoolCustCnv<COLL_T, ELEM_T> {
37 
38 public:
40  T_AthenaPoolCoolMultChanCnv(ISvcLocator* svcloc);
41 
42 protected:
46  virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
47 
51  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
52 
56  virtual StatusCode fillRepRefs(IOpaqueAddress* pAddr, DataObject* pObj) override;
57 
63  StatusCode objectToAttrListColl ATLAS_NOT_THREAD_SAFE
64  (COLL_T* obj, IOpaqueAddress*& pAddr,
65  CondAttrListCollection*& attrListColl,
66  std::unique_ptr<Token>& token);
67 
74  COLL_T*& obj);
75 
80  StatusCode condMultChanCollImplToObject(const std::string& collImplToken,
81  COLL_T*& obj);
82 
83  // the 2 following methods are allowed to throw std::runtime_error
84 
91  virtual ELEM_P* createPersistent(ELEM_T* obj);
92 
101  virtual ELEM_T* createTransient();
102 
103  //-------------------------------------------------------------------
104  // Helper methods intended to by used when implementing createTransient()
105 
107  virtual void setToken(const std::string& token) override final;
108 
114  template <class P>
116 
117  ELEM_T* poolReadObject();
118 
120  virtual StatusCode transToPers(COLL_T* obj, ELEM_T*& persObj) override;
121  virtual StatusCode persToTrans(COLL_T*& transObj, ELEM_T* obj) override;
122 
123 protected:
124 
126  int m_persCtx { 0 };
127 
128 };
129 
131 #endif
T_AthenaPoolCoolMultChanCnv::condMultChanCollImplToObject
StatusCode condMultChanCollImplToObject(const std::string &collImplToken, COLL_T *&obj)
Read in CondAttrListCollImpl and the objects for its tokens, saving them in the output collection.
T_AthenaPoolCoolMultChanCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Create a transient object from a POOL persistent representation.
T_AthenaPoolCoolMultChanCnv::T_AthenaPoolCoolMultChanCnv
T_AthenaPoolCoolMultChanCnv(ISvcLocator *svcloc)
Constructor.
DMTest::P
P_v1 P
Definition: P.h:23
T_AthenaPoolCoolMultChanCnv::createTransient
virtual ELEM_T * createTransient()
method to be implemented by the developer.
T_AthenaPoolCustCnv
This templated class provides the converter to translate an object to/from its persistent POOL repres...
Definition: T_AthenaPoolCustCnv.h:35
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
T_AthenaPoolCustCnv.h
his file contains the class definition for the templated T_AthenaPoolCustCnv class.
T_AthenaPoolCoolMultChanCnv::ATLAS_NOT_THREAD_SAFE
StatusCode objectToAttrListColl ATLAS_NOT_THREAD_SAFE(COLL_T *obj, IOpaqueAddress *&pAddr, CondAttrListCollection *&attrListColl, std::unique_ptr< Token > &token)
Write out objects stored in "obj" into POOL and save the tokens in a CondAttrListCollection,...
T_AthenaPoolCoolMultChanCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr) override
Create a POOL persistent representation for a transient object.
T_AthenaPoolCoolMultChanCnv::transToPers
virtual StatusCode transToPers(COLL_T *obj, ELEM_T *&persObj) override
Dummy methods not needed here.
T_AthenaPoolCoolMultChanCnv::poolReadObject
ELEM_T * poolReadObject()
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
T_AthenaPoolCoolMultChanCnv::persToTrans
virtual StatusCode persToTrans(COLL_T *&transObj, ELEM_T *obj) override
CnvFactory
Abstract factory to create the converter.
Definition: ToyConverter.h:16
T_AthenaPoolCoolMultChanCnv::attrListCollToObject
StatusCode attrListCollToObject(CondAttrListCollection *attrListColl, COLL_T *&obj)
Read in objects from POOL for the tokens stored CondAttrListCollection and save the objects in the ou...
T_AthenaPoolCoolMultChanCnv::poolReadObject
P * poolReadObject()
Read object of type P.
T_AthenaPoolCoolMultChanCnv::m_persCtx
int m_persCtx
Persistency context in which to read all objects (extracted from the Collection Address)
Definition: T_AthenaPoolCoolMultChanCnv.h:126
T_AthenaPoolCoolMultChanCnv
This templated class provides the POOL converter to translate a DataVector<T> to and from a CondAttrL...
Definition: T_AthenaPoolCoolMultChanCnv.h:36
T_AthenaPoolCoolMultChanCnv::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddr, DataObject *pObj) override
Create a POOL persistent representation for a transient object.
T_AthenaPoolCoolMultChanCnv.icc
T_AthenaPoolCoolMultChanCnv::createPersistent
virtual ELEM_P * createPersistent(ELEM_T *obj)
method to be implemented by the developer.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
Token.h
This file contains the class definition for the Token class (migrated from POOL).
T_AthenaPoolCoolMultChanCnv::setToken
virtual void setToken(const std::string &token) override final
specialized version that adds persistency contextID to tokens (for reading)