ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExThinning
src
AthExElephantinoCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// ElephantinoCnv.cxx
8
// Implementation file for class ElephantinoCnv
9
// Author: S.Binet<binet@cern.ch>
11
12
// STL includes
13
14
// Framework includes
15
#include "GaudiKernel/MsgStream.h"
16
#include "GaudiKernel/IToolSvc.h"
17
#include "GaudiKernel/IAlgTool.h"
18
#include "
StoreGate/StoreGateSvc.h
"
19
20
// AthExThinning includes
21
#include "
AthExElephantinoCnv_p1.h
"
22
#include "
AthExElephantinoCnv.h
"
23
27
31
33
// Protected methods:
35
36
AthExElephantinoCnv::AthExElephantinoCnv
(ISvcLocator* svcLocator) :
37
T_AthenaPoolCustomCnv
<
AthExElephantino
,
38
AthExElephantino_PERS
>(svcLocator)
39
{
40
if
( 0 == svcLocator ) {
41
throw
std::runtime_error(
"NULL pointer to ISvcLocator !!"
);
42
}
43
44
}
45
46
47
AthExElephantino_PERS
*
48
AthExElephantinoCnv::createPersistent
(
AthExElephantino
* transCont)
49
{
50
MsgStream
msg
( msgSvc(),
"AthExElephantinoCnv"
);
51
52
AthExElephantinoCnv_p1
cnv;
53
AthExElephantino_PERS
*persObj = cnv.
createPersistent
(transCont,
msg
);
54
55
msg
<< MSG::DEBUG <<
"::createPersistent [Success]"
<<
endmsg
;
56
return
persObj;
57
}
58
59
AthExElephantino
*
AthExElephantinoCnv::createTransient
(
const
Token
* token)
60
{
61
MsgStream
msg
( msgSvc(),
"AthExElephantinoConverter"
);
62
63
AthExElephantino
*transObj = 0;
64
65
static
const
Guid
p1_guid(
"F90BE215-64AD-45E3-B5E4-6AD7DE35BDF9"
);
66
67
if
(
compareClassGuid
(token, p1_guid) ) {
68
69
// using unique_ptr ensures deletion of the persistent object
70
std::unique_ptr<AthExElephantino_p1> persObj(
poolReadObject<AthExElephantino_p1>
(token) );
71
AthExElephantinoCnv_p1
cnv;
72
transObj = cnv.
createTransient
( persObj.get(),
msg
);
73
74
}
else
{
75
throw
std::runtime_error(
"Unsupported persistent version of Elephantino"
);
76
}
77
78
return
transObj;
79
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
AthExElephantinoCnv.h
AthExElephantino_PERS
AthExElephantino_p1 AthExElephantino_PERS
Definition
AthExElephantinoCnv.h:27
AthExElephantinoCnv_p1.h
StoreGateSvc.h
AthExElephantinoCnv_p1
Definition
AthExElephantinoCnv_p1.h:39
AthExElephantinoCnv::AthExElephantinoCnv
AthExElephantinoCnv(ISvcLocator *svcloc)
Create the converter from the service locator.
Definition
AthExElephantinoCnv.cxx:36
AthExElephantinoCnv::createPersistent
virtual AthExElephantino_PERS * createPersistent(AthExElephantino *transCont)
Build the persistent representation from the transient one.
Definition
AthExElephantinoCnv.cxx:48
AthExElephantinoCnv::createTransient
virtual AthExElephantino * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
AthExElephantinoCnv.cxx:59
AthExElephantino
object with 4 legs, so it is best modeled with a vector of ElementLink.
Definition
AthExElephantino.h:33
T_AthenaPoolCustomCnv< AthExElephantino, AthExElephantino_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
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< AthExElephantino, AthExElephantino_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< AthExElephantino, AthExElephantino_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