ATLAS Offline Software
RecoTimingObjCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Framework includes
7 #include "GaudiKernel/MsgStream.h"
8 
9 // RecTPCnv includes
11 
12 // RecAthenaPool includes
13 #include "RecoTimingObjCnv.h"
14 
17 {
18  // MsgStream msg( msgSvc(), "RecoTimingObjCnv" );
19  if ( ! bool(m_msg) )
20  m_msg=new MsgStream( msgSvc(), "RecoTimingObjCnv" );
21 
23  RecoTimingObj_PERS *persObj = cnv.createPersistent( transCont, *m_msg );
24 
25  // msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
26  return persObj;
27 }
28 
30 {
31  // MsgStream msg( msgSvc(), "RecoTimingObjCnv" );
32  if ( ! bool(m_msg) )
33  m_msg=new MsgStream( msgSvc(), "RecoTimingObjCnv" );
34 
35  RecoTimingObj *transObj = 0;
36 
37  static const pool::Guid p1_guid("4A28542C-DD7F-441A-9866-37A74ED49850");
38 
39  if ( compareClassGuid(p1_guid) )
40  {
41  std::unique_ptr<RecoTimingObj_p1> persObj( poolReadObject<RecoTimingObj_p1>() );
43  transObj = cnv.createTransient( persObj.get(), *m_msg );
44  } else {
45  throw std::runtime_error("Unsupported persistent version of RecoTimingObj");
46  }
47 
48  return transObj;
49 }
RecoTimingObjCnv::createTransient
virtual RecoTimingObj * createTransient()
Build the transient representation from a persistent one.
Definition: RecoTimingObjCnv.cxx:29
RecoTimingObj
Definition: RecoTimingObj.h:13
RecoTimingObjCnv::m_msg
MsgStream * m_msg
Definition: RecoTimingObjCnv.h:49
RecoTimingObj_p1
Definition: RecoTimingObj_p1.h:14
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
RecoTimingObjCnv.h
RecoTimingObjCnv_p1
Definition: RecoTimingObjCnv_p1.h:15
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
RecoTimingObjCnv_p1.h
RecoTimingObjCnv::createPersistent
virtual RecoTimingObj_PERS * createPersistent(RecoTimingObj *transCont)
Build the persistent representation from the transient one.
Definition: RecoTimingObjCnv.cxx:16
T_AthenaPoolCustCnv< RecoTimingObj, RecoTimingObj_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.