ATLAS Offline Software
HGTD_RDO_ContainerCnv.cxx
Go to the documentation of this file.
1 
10 #include "GaudiKernel/MsgStream.h"
11 
12 #include <memory>
13 
15  : HGTD_RDO_ContainerCnvBase_t(svcloc) {}
16 
18 
19  static const pool::Guid p1_guid(
20  "C25315CC-F0A2-43D6-8F42-012BE34B0107"); // with HGTD_RDO_p1
21  ATH_MSG_DEBUG("createTransient(): main converter");
22 
23  HGTD_RDO_Container* trans_cont(0);
24  if (compareClassGuid(p1_guid)) {
25  ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
26  std::unique_ptr<HGTD_RDO_Container_PERS_t> pers_cont(
27  poolReadObject<HGTD_RDO_Container_PERS_t>());
28 
29  trans_cont = m_converter.createTransient(pers_cont.get(), msg());
30 
31  } else {
32  throw std::runtime_error(
33  "Unsupported persistent version of HGTD_RDO_Container");
34  }
35  return trans_cont;
36 }
37 
40 
41  HGTD_RDO_Container_PERS_t* pers_cont =
42  m_converter.createPersistent(trans_cont, msg());
43 
44  return pers_cont;
45 }
HGTD_RDO_ContainerCnv::m_converter
HGTD_RDO_ContainerCNV_t m_converter
Definition: HGTD_RDO_ContainerCnv.h:44
HGTD_RDO_Container_p1
Definition: HGTD_RDO_Container_p1.h:17
HGTD_RDO_ContainerCnv_p1::createTransient
virtual Trans_t * createTransient(const Pers_t *persistent_container, MsgStream &log)
Definition: HGTD_RDO_ContainerCnv_p1.cxx:156
HGTD_RDO_ContainerCnv::createPersistent
virtual HGTD_RDO_Container_PERS_t * createPersistent(HGTD_RDO_Container *trans) override
Definition: HGTD_RDO_ContainerCnv.cxx:39
HGTD_RDO_Container
Definition: HGTD_RDO_Container.h:18
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
HGTD_RDO_ContainerCnv.h
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
HGTD_RDO_ContainerCnv::createTransient
virtual HGTD_RDO_Container * createTransient() override
Definition: HGTD_RDO_ContainerCnv.cxx:17
HGTD_RDO_ContainerCnv::HGTD_RDO_ContainerCnv
HGTD_RDO_ContainerCnv(ISvcLocator *svcloc)
Definition: HGTD_RDO_ContainerCnv.cxx:14
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.