ATLAS Offline Software
eflowObjectContainerCnv.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 // Framework includes
17 #include "GaudiKernel/MsgStream.h"
18 
21 {
22  MsgStream eflowStream( msgSvc(), "eflowObjectContainerCnv" );
23 
25  eflowObjectContainer_p5 *persObj = cnv.createPersistent( transCont, eflowStream );
26 
27  if (eflowStream.level() <= MSG::DEBUG) eflowStream << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
28  return persObj;
29 }
30 
32 {
33  MsgStream eflowStream( msgSvc(), "eflowObjectContainerCnv" );
34 
35  eflowObjectContainer *transObj = 0;
36 
37  static const pool::Guid tr_guid("0044A49A-14B8-45BE-9E62-B9780F226168");
38  static const pool::Guid p1_guid("1DE97911-24C0-429D-9041-258A2F1CA7DF");
39  static const pool::Guid p2_guid("E9674EC4-80D0-4616-AE98-26488ADE726B");
40  static const pool::Guid p3_guid("2DF2EC16-AA4D-4BF9-82F8-7DFCE3BE00A0");
41  static const pool::Guid p4_guid("75CC8E85-4CA8-4FE9-A001-26856E3D44C6");
42  static const pool::Guid p5_guid("A38F4620-AB4A-11E2-90EB-00241D7D6914");
43 
44  if ( compareClassGuid(tr_guid) ) {
45 
46  // regular object from before the T/P separation
47  return poolReadObject<eflowObjectContainer>();
48 
49  } else if ( compareClassGuid(p1_guid) ) {
50 
51  // using unique_ptr ensures deletion of the persistent object
52  std::unique_ptr<eflowObjectContainer_p1> persObj( poolReadObject<eflowObjectContainer_p1>() );
54  transObj = cnv.createTransient( persObj.get(), eflowStream );
55  } else if (compareClassGuid(p2_guid) ) {
56 
57  // using unique_ptr ensures deletion of the persistent object
58  std::unique_ptr<eflowObjectContainer_p2> persObj( poolReadObject<eflowObjectContainer_p2>() );
60  transObj = cnv.createTransient( persObj.get(), eflowStream );
61 
62  } else if (compareClassGuid(p3_guid) ) {
63 
64  // using unique_ptr ensures deletion of the persistent object
65  std::unique_ptr<eflowObjectContainer_p3> persObj( poolReadObject<eflowObjectContainer_p3>() );
67  transObj = cnv.createTransient( persObj.get(), eflowStream );
68  } else if (compareClassGuid(p4_guid) ) {
69 
70  // using unique_ptr ensures deletion of the persistent object
71  std::unique_ptr<eflowObjectContainer_p4> persObj( poolReadObject<eflowObjectContainer_p4>() );
73  transObj = cnv.createTransient( persObj.get(), eflowStream );
74  } else if (compareClassGuid(p5_guid) ) {
75 
76  // using unique_ptr ensures deletion of the persistent object
77  std::unique_ptr<eflowObjectContainer_p5> persObj( poolReadObject<eflowObjectContainer_p5>() );
79  transObj = cnv.createTransient( persObj.get(), eflowStream );
80  }
81  else throw std::runtime_error("Unsupported persistent version of eflowObjectContainer");
82 
83  return transObj;
84 }
eflowObjectCnv_p1.h
eflowObjectContainerCnv_p5
Definition: eflowObjectContainerCnv_p5.h:19
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
eflowObjectCnv_p2.h
eflowObjectContainerCnv_p2
Definition: eflowObjectContainerCnv_p2.h:19
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
eflowObjectCnv_p4.h
eflowObjectContainerCnv_p1.h
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
eflowObjectCnv_p5.h
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
eflowObjectContainerCnv_p4
Definition: eflowObjectContainerCnv_p4.h:19
eflowObjectCnv_p3.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
eflowObjectContainerCnv_p1
Definition: eflowObjectContainerCnv_p1.h:19
eflowObjectContainerCnv_p2.h
eflowObjectContainerCnv::createPersistent
virtual eflowObjectContainer_p5 * createPersistent(eflowObjectContainer *transCont)
Build the persistent representation from the transient one.
Definition: eflowObjectContainerCnv.cxx:20
eflowObjectContainerCnv_p3
Definition: eflowObjectContainerCnv_p3.h:19
eflowObjectContainerCnv_p4.h
eflowObjectContainerCnv_p5.h
eflowObjectContainerCnv.h
eflowObjectContainerCnv_p3.h
DEBUG
#define DEBUG
Definition: page_access.h:11
eflowObjectContainer
Definition: eflowObjectContainer.h:19
eflowObjectContainer_p5
Definition: eflowObjectContainer_p5.h:11
T_AthenaPoolCustCnv< eflowObjectContainer, eflowObjectContainer_p5 >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
eflowObjectContainerCnv::createTransient
virtual eflowObjectContainer * createTransient()
Build the transient representation from a persistent one.
Definition: eflowObjectContainerCnv.cxx:31