ATLAS Offline Software
TRT_BSErrContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "TRT_BSErrContainerCnv.h"
12 
13 #include <iostream>
14 
15 
18  MsgStream log(msgSvc(), "TRT_BSErrContainerCnv" );
20  return persObj;
21 }
22 
25  MsgStream log(msgSvc(), "TRT_BSErrContainerCnv" );
26  static const pool::Guid p1_guid("D461AC01-02CA-4A9E-886B-24EC14309121");
27  static const pool::Guid p2_guid("A815E78C-BB68-4CA5-9B95-739E9B47043A");
28 
29  if( compareClassGuid(p2_guid) ) {
30  // using unique_ptr ensures deletion of the persistent object
31  std::unique_ptr< TRT_BSErrContainer_p2 > col_vect( poolReadObject< TRT_BSErrContainer_p2 >() );
32  return m_TPConverter.createTransient( col_vect.get(), log );
33  }
34 
35  if( compareClassGuid(p1_guid) ) {
36  log << MSG::ERROR << "TRT_BSErrContainer_p1 not supported any more. Recording empty container." << endmsg;
37  return new TRT_BSErrContainer();
38  }
39 
40  throw std::runtime_error("Unsupported persistent version of Data Collection");
41 }
TRT_BSErrContainerCnv_p2::createTransient
virtual TRT_BSErrContainer * createTransient(const TRT_BSErrContainer_p2 *persObj, MsgStream &log)
Definition: TRT_BSErrContainerCnv_p2.cxx:47
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TRT_BSErrContainerCnv.h
Generated header file which defines a typedef for templated converter class.
TRT_BSErrContainer
Definition: TRT_BSErrContainer.h:20
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TRT_BSErrContainer
Athena::TPCnvVers::Old TRT_BSErrContainer
Definition: InDetByteStreamErrorsAthenaPoolTPCnv.cxx:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TRT_BSErrContainerCnv::createTransient
virtual TRT_BSErrContainer * createTransient()
Definition: TRT_BSErrContainerCnv.cxx:24
TRT_BSErrContainerCnv::m_TPConverter
TRT_BSErrContainerCnv_p2 m_TPConverter
Definition: TRT_BSErrContainerCnv.h:33
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.
TRT_BSErrContainer_p2
Definition: TRT_BSErrContainer_p2.h:13
TRT_BSErrContainerCnv::createPersistent
virtual TRT_BSErrContainer_PERS * createPersistent(TRT_BSErrContainer *transCont)
Definition: TRT_BSErrContainerCnv.cxx:17