ATLAS Offline Software
TileL2ContainerCnv.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // TileL2ContainerCnv.cxx
8 // Implementation file for class TileL2ContainerCnv
9 // Author: Aranzazu Ruiz <aranzazu.ruiz.martinez@cern.ch>
10 // Date: July 2008
12 
13 // Framework includes
14 #include "GaudiKernel/MsgStream.h"
15 
16 // TileTPCnv includes
19 
20 // TileEventAthenaPool includes
21 #include "TileL2ContainerCnv.h"
22 
25 {
26  MsgStream msg( msgSvc(), "TileL2ContainerCnv" );
27 
29  TileL2Container_PERS *persObj = cnv.createPersistent( transCont, msg );
30 
31  if (msg.level()<=MSG::DEBUG)
32  msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
33  return persObj;
34 }
35 
37 
38  MsgStream msg( msgSvc(), "TileL2ContainerCnv" );
39 
40  TileL2Container *transObj = 0;
41 
42  static const pool::Guid tr_guid("E9BB4497-FF43-4D70-8A64-B509081DAD88");
43  static const pool::Guid p1_guid("FE877FF9-475D-42D9-8DC3-CABD220BFD27");
44  static const pool::Guid p2_guid("3283BF32-0B18-408F-9B46-6A1B26B37D5C");
45 
46  if ( compareClassGuid(tr_guid) ) {
47 
48  // regular object from before the T/P separation
49  return poolReadObject<TileL2Container>();
50 
51  } else if ( compareClassGuid(p1_guid) ) {
52 
53  // using unique_ptr ensures deletion of the persistent object
54  std::unique_ptr<TileL2Container_p1> persObj( poolReadObject<TileL2Container_p1>() );
56  transObj = cnv.createTransient( persObj.get(), msg );
57  } else if ( compareClassGuid(p2_guid) ) {
58 
59  // using unique_ptr ensures deletion of the persistent object
60  std::unique_ptr<TileL2Container_p2> persObj( poolReadObject<TileL2Container_p2>() );
62  transObj = cnv.createTransient( persObj.get(), msg );
63  } else {
64  throw std::runtime_error("Unsupported persistent version of TileL2Container");
65  }
66 
67  return transObj;
68 }
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TileL2ContainerCnv.h
TileL2ContainerCnv_p1.h
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TileL2ContainerCnv_p2.h
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TileL2Container_p2
Definition: TileL2Container_p2.h:19
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TileL2ContainerCnv::createTransient
virtual TileL2Container * createTransient()
Build the transient representation from a persistent one.
Definition: TileL2ContainerCnv.cxx:36
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
TileL2ContainerCnv::createPersistent
virtual TileL2Container_PERS * createPersistent(TileL2Container *transCont)
Build the persistent representation from the transient one.
Definition: TileL2ContainerCnv.cxx:24
DEBUG
#define DEBUG
Definition: page_access.h:11
TPCnvVector
Definition: TPConverter.h:1256
T_AthenaPoolCustCnv< TileL2Container, TileL2Container_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TileContainer
Definition: TileContainer.h:38