ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
EventCommonAthenaPool
src
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"
16
#include "
StoreGate/StoreGateSvc.h
"
17
18
// EventCommonAthenaPool includes
19
#include "
INav4MomAssocsCnv.h
"
20
24
25
INav4MomAssocsCnv::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
47
INav4MomAssocs_PERS
*
48
INav4MomAssocsCnv::createPersistent
(
INav4MomAssocs
* transCont )
49
{
50
INav4MomAssocs_PERS
*persObj =
m_tpConverter_p3
.createPersistent( transCont,
msg
() );
51
52
return
persObj;
53
}
54
55
INav4MomAssocs
*
INav4MomAssocsCnv::createTransient
(
const
Token
* token)
56
{
57
INav4MomAssocs
*transObj = 0;
58
59
static
const
Guid
tr_guid(
"DF941034-CCB2-4A1A-9A8C-5F3D5EAFD08C"
);
60
static
const
Guid
p1_guid(
"85027AE1-4FD4-4808-B151-5485634ACD5D"
);
61
static
const
Guid
p2_guid(
"8040BEAA-BC65-43B8-B468-A7157C89ACB3"
);
62
static
const
Guid
p3_guid(
"455AEE6B-9834-4E72-8F81-2532A52E3BE7"
);
63
64
if
(
compareClassGuid
(token, p3_guid) ) {
65
// using unique_ptr ensures deletion of the persistent object
66
std::unique_ptr<INav4MomAssocs_p3> persObj(
poolReadObject<INav4MomAssocs_p3>
(token) );
67
transObj =
m_tpConverter_p3
.createTransient( persObj.get(),
msg
() );
68
}
69
else
if
(
compareClassGuid
(token, p2_guid) ) {
70
// using unique_ptr ensures deletion of the persistent object
71
std::unique_ptr<INav4MomAssocs_p2> persObj(
poolReadObject<INav4MomAssocs_p2>
(token) );
72
transObj =
m_tpConverter_p2
.createTransient( persObj.get(),
msg
() );
73
}
74
else
if
(
compareClassGuid
(token, p1_guid) ) {
75
// using unique_ptr ensures deletion of the persistent object
76
std::unique_ptr<INav4MomAssocs_p1> persObj(
poolReadObject<INav4MomAssocs_p1>
(token) );
77
INav4MomAssocsCnv_p1
cnv(
m_storeGate
.get() );
78
transObj = cnv.
createTransient
( persObj.get(),
msg
() );
79
}
80
else
if
(
compareClassGuid
(token, tr_guid) ) {
81
// regular object from before the T/P separation
82
return
poolReadObject<INav4MomAssocs>
(token);
83
}
84
else
{
85
throw
std::runtime_error(
"Unsupported persistent version of INav4MomAssocs"
);
86
}
87
88
return
transObj;
89
}
INav4MomAssocsCnv.h
INav4MomAssocs_PERS
INav4MomAssocs_p3 INav4MomAssocs_PERS
Definition
INav4MomAssocsCnv.h:33
StoreGateSvc.h
T_AthenaPoolCustomCnv< INav4MomAssocs, INav4MomAssocs_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
INav4MomAssocsCnv_p1
Definition
INav4MomAssocsCnv_p1.h:36
INav4MomAssocsCnv::createTransient
virtual INav4MomAssocs * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
INav4MomAssocsCnv.cxx:55
INav4MomAssocsCnv::createPersistent
virtual INav4MomAssocs_PERS * createPersistent(INav4MomAssocs *transCont)
Build the persistent representation from the transient one.
Definition
INav4MomAssocsCnv.cxx:48
INav4MomAssocsCnv::INav4MomAssocsCnv
INav4MomAssocsCnv(ISvcLocator *svcloc)
Create the converter from the service locator.
Definition
INav4MomAssocsCnv.cxx:25
INav4MomAssocsCnv::m_tpConverter_p2
INav4MomAssocsCnv_p2 m_tpConverter_p2
Definition
INav4MomAssocsCnv.h:75
INav4MomAssocsCnv::m_storeGate
ServiceHandle< StoreGateSvc > m_storeGate
Pointer to the StoreGateSvc.
Definition
INav4MomAssocsCnv.h:72
INav4MomAssocsCnv::m_tpConverter_p3
INav4MomAssocsCnv_p3 m_tpConverter_p3
Definition
INav4MomAssocsCnv.h:74
INav4MomAssocs
Definition
INav4MomAssocs.h:33
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< INav4MomAssocs, INav4MomAssocs_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< INav4MomAssocs, INav4MomAssocs_PERS >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition
T_AthenaPoolCustomCnv.h:129
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
Generated on
for ATLAS Offline Software by
1.17.0