ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaPOOL
AthenaPoolCnvSvc
src
CondAttrListCollCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
10
11
#include "
CondAttrListCollCnv.h
"
12
13
#include "GaudiKernel/ClassID.h"
14
#include "GaudiKernel/DataObject.h"
15
#include "GaudiKernel/MsgStream.h"
16
#include "GaudiKernel/StatusCode.h"
17
18
// CondAttrListCollection and address
19
#include "
AthenaPoolUtilities/CondAttrListCollection.h
"
20
#include "
AthenaPoolUtilities/CondAttrListCollAddress.h
"
21
22
#include "
StoreGate/StoreGateSvc.h
"
23
#include "
StorageSvc/DbType.h
"
24
25
//--------------------------------------------------------------------
26
27
long
int
28
CondAttrListCollCnv::repSvcType
()
const
{
29
return
(
storageType
());
30
}
31
32
//__________________________________________________________________________
33
CondAttrListCollCnv::~CondAttrListCollCnv
() {
34
}
35
//__________________________________________________________________________
36
StatusCode
CondAttrListCollCnv::initialize
() {
37
MsgStream log(msgSvc(),
"CondAttrListCollCnv"
);
38
39
log << MSG::DEBUG <<
"initialize() in CondAttrListCollCnv"
<<
endmsg
;
40
StatusCode status = Converter::initialize();
41
if
(!status.isSuccess()) {
42
log << MSG::ERROR <<
"Can not initialize Converter base class."
<<
endmsg
;
43
return
(status);
44
}
45
return
(status);
46
}
47
//__________________________________________________________________________
48
StatusCode
CondAttrListCollCnv::createObj
(IOpaqueAddress* pAddr, DataObject*& pObj) {
49
50
// This is the "read" method for an CondAttrListCollection. Here
51
// we only extract an CondAttrListCollection pointer from an
52
// CondAttrListCollAddress and return it
53
54
MsgStream log(msgSvc(),
"CondAttrListCollCnv"
);
55
log << MSG::DEBUG <<
"Creating CondAttrListCollAddress Object"
<<
endmsg
;
56
57
CondAttrListCollAddress
* addr =
dynamic_cast<
CondAttrListCollAddress
*
>
(pAddr);
58
59
if
(addr) {
60
// Successful cast
61
pObj =
SG::asStorable
(addr->
attrListColl
());
62
if
(!pObj) {
63
log << MSG::ERROR <<
"CondAttrListCollection ptr is 0 from CondAttrListCollAddress "
<<
endmsg
;
64
return
(StatusCode::FAILURE);
65
}
66
}
67
else
{
68
log << MSG::ERROR <<
"Could not extract ptr for CondAttrListCollAddress "
<<
endmsg
;
69
return
(StatusCode::FAILURE);
70
}
71
72
return
(StatusCode::SUCCESS);
73
}
74
//__________________________________________________________________________
75
StatusCode
CondAttrListCollCnv::createRep
(DataObject* pObj, IOpaqueAddress*& pAddr) {
76
77
// This is the "write" method for an CondAttrListCollection. Here
78
// we only create an CondAttrListCollAddress and fill it with a
79
// pointer to the CondAttrListCollection
80
81
MsgStream log(msgSvc(),
"CondAttrListCollCnv"
);
82
log << MSG::DEBUG <<
"Copy CondAttrListCollection ptr into CondAttrListCollAddress"
<<
endmsg
;
83
84
CondAttrListCollection
* list = 0;
//dynamic_cast<CondAttrListCollection*>(pObj);
85
SG::fromStorable
(pObj, list);
86
if
( pAddr !=
nullptr
) pAddr->release();
87
CondAttrListCollAddress
* addr =
new
CondAttrListCollAddress
(
storageType
(),
88
classID
(),
89
"POOLContainer_CondAttrListCollection][CLID=x"
);
90
addr->
setAttrListColl
(list);
91
pAddr = addr;
92
pAddr->addRef();
93
94
log << MSG::DEBUG <<
"Created CondAttrListCollAddress with list ptr: "
<< list <<
endmsg
;
95
return
(StatusCode::SUCCESS);
96
}
97
//__________________________________________________________________________
98
long
CondAttrListCollCnv::storageType
() {
99
return
pool::POOL_StorageType
.type();
100
}
101
//__________________________________________________________________________
102
CLID
CondAttrListCollCnv::classID
() {
103
return
(
ClassID_traits<CondAttrListCollection>::ID
());
104
}
105
//__________________________________________________________________________
106
CondAttrListCollCnv::CondAttrListCollCnv
(ISvcLocator* svcloc) :
107
Converter
(
storageType
(),
classID
(), svcloc) {
108
}
109
//__________________________________________________________________________
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CondAttrListCollAddress.h
This file contains the class definition for the CondAttrListCollAddress class.
CondAttrListCollCnv.h
This file contains the class definition for the CondAttrListCollCnv class.
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
DbType.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
StoreGateSvc.h
CondAttrListCollAddress
This class provides an IOpaqueAddress/GenericAddress which can hold a pointer to a CondAttrListCollec...
Definition
CondAttrListCollAddress.h:24
CondAttrListCollAddress::attrListColl
CondAttrListCollection * attrListColl()
Access to AttributeList.
Definition
CondAttrListCollAddress.h:117
CondAttrListCollAddress::setAttrListColl
void setAttrListColl(CondAttrListCollection *attrListColl)
Add AttributeList.
Definition
CondAttrListCollAddress.h:123
CondAttrListCollCnv::repSvcType
virtual long int repSvcType() const
Definition
CondAttrListCollCnv.cxx:28
CondAttrListCollCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create a transient object from a POOL persistent representation.
Definition
CondAttrListCollCnv.cxx:48
CondAttrListCollCnv::~CondAttrListCollCnv
virtual ~CondAttrListCollCnv()
Destructor.
Definition
CondAttrListCollCnv.cxx:33
CondAttrListCollCnv::storageType
static long storageType()
Definition
CondAttrListCollCnv.cxx:98
CondAttrListCollCnv::classID
static CLID classID()
Definition
CondAttrListCollCnv.cxx:102
CondAttrListCollCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition
CondAttrListCollCnv.cxx:36
CondAttrListCollCnv::CondAttrListCollCnv
CondAttrListCollCnv(ISvcLocator *svcloc)
Constructor.
Definition
CondAttrListCollCnv.cxx:106
CondAttrListCollCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create a POOL persistent representation for a transient object.
Definition
CondAttrListCollCnv.cxx:75
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number.
Definition
CondAttrListCollection.h:51
Converter::Converter
Converter()
Definition
Converter.h:29
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition
StorableConversions.h:169
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
pool::POOL_StorageType
static const DbType POOL_StorageType
Definition
DbType.h:84
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0