ATLAS Offline Software
Loading...
Searching...
No Matches
CondAttrListCollCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
21
23#include "StorageSvc/DbType.h"
24
25//--------------------------------------------------------------------
26
27long int
29 return(storageType());
30}
31
32//__________________________________________________________________________
35//__________________________________________________________________________
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//__________________________________________________________________________
48StatusCode 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//__________________________________________________________________________
75StatusCode 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();
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//__________________________________________________________________________
101//__________________________________________________________________________
105//__________________________________________________________________________
107 Converter(storageType(), classID(), svcloc) {
108}
109//__________________________________________________________________________
#define endmsg
This file contains the class definition for the CondAttrListCollAddress class.
This file contains the class definition for the CondAttrListCollCnv class.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
uint32_t CLID
The Class ID type.
This class provides an IOpaqueAddress/GenericAddress which can hold a pointer to a CondAttrListCollec...
CondAttrListCollection * attrListColl()
Access to AttributeList.
void setAttrListColl(CondAttrListCollection *attrListColl)
Add AttributeList.
virtual long int repSvcType() const
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create a transient object from a POOL persistent representation.
virtual ~CondAttrListCollCnv()
Destructor.
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
CondAttrListCollCnv(ISvcLocator *svcloc)
Constructor.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create a POOL persistent representation for a transient object.
static const CLID & classID()
This class is a collection of AttributeLists where each one is associated with a channel number.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
static const DbType POOL_StorageType
Definition DbType.h:98