ATLAS Offline Software
Loading...
Searching...
No Matches
INav4MomAssocsCnv.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7// INav4MomAssocsCnv.cxx
8// Implementation file for class INav4MomAssocsCnv
9// Author: S.Binet<binet@cern.ch>
11
12// STL includes
13
14// Framework includes
15#include "GaudiKernel/MsgStream.h"
17
18// EventCommonAthenaPool includes
19#include "INav4MomAssocsCnv.h"
20
24
25INav4MomAssocsCnv::INav4MomAssocsCnv( ISvcLocator* svcLocator ) :
26 T_AthenaPoolCustomCnv<INav4MomAssocs, INav4MomAssocs_PERS>(svcLocator, "INav4MomAssocsCnv"),
27 m_storeGate("StoreGateSvc", "INav4MomAssocsCnv")
28{
29 if ( 0 == svcLocator ) {
30 throw std::runtime_error("NULL pointer to ISvcLocator !!");
31 }
32
33 if ( m_storeGate.retrieve().isFailure() ) {
34 throw std::runtime_error("Could not fetch StoreGateSvc !!");
35 }
36}
37
41
43// Protected methods:
45
46
49{
50 INav4MomAssocs_PERS *persObj = m_tpConverter_p3.createPersistent( transCont, msg() );
51
52 return persObj;
53}
54
56{
57 INav4MomAssocs *transObj = 0;
58
59 static const pool::Guid tr_guid("DF941034-CCB2-4A1A-9A8C-5F3D5EAFD08C");
60 static const pool::Guid p1_guid("85027AE1-4FD4-4808-B151-5485634ACD5D");
61 static const pool::Guid p2_guid("8040BEAA-BC65-43B8-B468-A7157C89ACB3");
62 static const pool::Guid p3_guid("455AEE6B-9834-4E72-8F81-2532A52E3BE7");
63
64 if( compareClassGuid(p3_guid) ) {
65 // using unique_ptr ensures deletion of the persistent object
66 std::unique_ptr<INav4MomAssocs_p3> persObj( poolReadObject<INav4MomAssocs_p3>() );
67 transObj = m_tpConverter_p3.createTransient( persObj.get(), msg() );
68 }
69 else if ( compareClassGuid(p2_guid) ) {
70 // using unique_ptr ensures deletion of the persistent object
71 std::unique_ptr<INav4MomAssocs_p2> persObj( poolReadObject<INav4MomAssocs_p2>() );
72 transObj = m_tpConverter_p2.createTransient( persObj.get(), msg() );
73 }
74 else if( compareClassGuid(p1_guid) ) {
75 // using unique_ptr ensures deletion of the persistent object
76 std::unique_ptr<INav4MomAssocs_p1> persObj( poolReadObject<INav4MomAssocs_p1>() );
78 transObj = cnv.createTransient( persObj.get(), msg() );
79 }
80 else if( compareClassGuid(tr_guid) ) {
81 // regular object from before the T/P separation
83 }
84 else {
85 throw std::runtime_error("Unsupported persistent version of INav4MomAssocs");
86 }
87
88 return transObj;
89}
INav4MomAssocs_p3 INav4MomAssocs_PERS
virtual INav4MomAssocs_PERS * createPersistent(INav4MomAssocs *transCont)
Build the persistent representation from the transient one.
INav4MomAssocsCnv(ISvcLocator *svcloc)
Create the converter from the service locator.
INav4MomAssocsCnv_p2 m_tpConverter_p2
ServiceHandle< StoreGateSvc > m_storeGate
Pointer to the StoreGateSvc.
INav4MomAssocsCnv_p3 m_tpConverter_p3
virtual INav4MomAssocs * createTransient()
Build the transient representation from a persistent one.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual bool compareClassGuid(const Guid &clid) const
Compatibility for old converter classes that don't get passed the key.