ATLAS Offline Software
EventBookkeeperCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // File for class EventBookkeeperCnv
7 // Author: David Cote, September 2008. <david.cote@cern.ch>
9 
10 #include "EventBookkeeperCnv.h"
12 
14  MsgStream log(msgSvc(), "EventBookkeeperConverter" );
15  EventBookkeeper_PERS * persObj = m_TPConverter.createPersistent( transCont, log );
16  return persObj;
17 }
18 
20  MsgStream log(msgSvc(), "EventBookkeeperConverter" );
21  //p1_guid matches the number in EventBookkeeperTPCnv/selection.xtml and is generated with uuidgen | tr "[:lower:]" "[:upper:]"
22  static const pool::Guid p1_guid("A1550FE9-B52A-451D-A2B8-3B09E046A481");
23  static const pool::Guid p2_guid("EACBE9F1-84F1-4A51-9303-A39619FE965A");
24  if( compareClassGuid(p1_guid) ) {
25  // using unique_ptr ensures deletion of the persistent object
26  std::unique_ptr< EventBookkeeper_p1 > col_vect( poolReadObject< EventBookkeeper_p1 >() );
27  return m_TPConverterP1.createTransient( col_vect.get(), log );
28  }
29  else if( compareClassGuid(p2_guid) ) {
30  // using unique_ptr ensures deletion of the persistent object
31  std::unique_ptr< EventBookkeeper_p2 > col_vect( poolReadObject< EventBookkeeper_p2 >() );
32  return m_TPConverter.createTransient( col_vect.get(), log );
33  }
34  else {
35  throw std::runtime_error("Unsupported persistent version of EventBookkeeper. Please use a more recent software release.");
36  }
37 }
38 
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
EventBookkeeperCnv::createTransient
virtual EventBookkeeper * createTransient()
Definition: EventBookkeeperCnv.cxx:19
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
EventBookkeeperCnv.h
EventBookkeeperCnv::m_TPConverter
EventBookkeeperCnv_p2 m_TPConverter
Definition: EventBookkeeperCnv.h:36
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
EventBookkeeperCnv::m_TPConverterP1
EventBookkeeperCnv_p1 m_TPConverterP1
Definition: EventBookkeeperCnv.h:35
EventBookkeeper_p1.h
EventBookkeeper
Definition: EventBookkeeper.h:24
EventBookkeeperCnv::createPersistent
virtual EventBookkeeper_PERS * createPersistent(EventBookkeeper *transCont)
Definition: EventBookkeeperCnv.cxx:13
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.
EventBookkeeper_p2
Definition: EventBookkeeper_p2.h:16