ATLAS Offline Software
Loading...
Searching...
No Matches
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
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}
#define endmsg
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual eflowObjectContainer_p5 * createPersistent(eflowObjectContainer *transCont)
Build the persistent representation from the transient one.
virtual eflowObjectContainer * createTransient()
Build the transient representation from a persistent one.