ATLAS Offline Software
CTP_RDOCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Gaudi/Athena include(s):
7 #include "GaudiKernel/MsgStream.h"
8 
9 // Local include(s):
10 #include "CTP_RDOCnv.h"
11 
17 
18  MsgStream log( this->msgSvc(), "CTP_RDOCnv" );
19  return m_converter.createPersistent( transObj, log );
20 
21 }
22 
28 
29  static const pool::Guid p2_guid( "12717F15-E516-4ECD-BC07-82C72B524AD5" );
30  static const pool::Guid p1_guid( "5E6D3E52-952F-4144-BC68-83ACE605AA45" );
31  static const pool::Guid p0_guid( "56C714CC-DC17-4927-B413-9151C82792BB" );
32 
33  if( this->compareClassGuid( p2_guid ) ) {
34 
35  std::unique_ptr< CTP_RDO_p2 > pers_ref( this->poolReadObject< CTP_RDO_p2 >() );
36  MsgStream log( this->msgSvc(), "CTP_RDOCnv" );
37  return m_converter.createTransient( pers_ref.get(), log );
38 
39  } else if( this->compareClassGuid( p1_guid ) ) {
40 
41  std::unique_ptr< CTP_RDO_p1 > pers_ref( this->poolReadObject< CTP_RDO_p1 >() );
42  MsgStream log( this->msgSvc(), "CTP_RDOCnv" );
43  return m_converter_p1.createTransient( pers_ref.get(), log );
44 
45  } else if( this->compareClassGuid( p0_guid ) ) {
46 
47  return this->poolReadObject< CTP_RDO >();
48 
49  }
50 
51  throw std::runtime_error( "Unsupported persistent version of CTP_RDO" );
52  return 0;
53 
54 }
CTP_RDOCnv::m_converter_p1
CTP_RDOCnv_p1 m_converter_p1
Definition: CTP_RDOCnv.h:46
CTP_RDO_p2
Persistent representation of CTP_RDO.
Definition: CTP_RDO_p2.h:26
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
CTP_RDOCnv::m_converter
CTP_RDOCnv_p2 m_converter
Definition: CTP_RDOCnv.h:45
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
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
CTP_RDOCnv.h
CTP_RDOCnv::createTransient
virtual CTP_RDO * createTransient()
Function reading a version of CTP_RDO from POOL and converting it to a transient CTP_RDO object.
Definition: CTP_RDOCnv.cxx:27
CTP_RDO
Definition: CTP_RDO.h:20
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
CTP_RDOCnv::createPersistent
virtual CTP_RDO_PERS * createPersistent(CTP_RDO *transObj)
Function creating a persistent CTP_RDO_PERS object from a transient CTP_RDO one.
Definition: CTP_RDOCnv.cxx:16