ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaAttributeListCnv Class Reference

This class provides the converter for the AthenaAttributeList class. More...

#include <AthenaAttributeListCnv.h>

Inheritance diagram for AthenaAttributeListCnv:
Collaboration diagram for AthenaAttributeListCnv:

Public Member Functions

virtual ~AthenaAttributeListCnv ()
 Destructor.
virtual StatusCode initialize ()
 Gaudi Service Interface method implementations:
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
 Create a transient object from a POOL persistent representation.
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
 Create a POOL persistent representation for a transient object.
virtual long int repSvcType () const
 AthenaAttributeListCnv (ISvcLocator *svcloc)
 Constructor.

Static Public Member Functions

static long storageType ()
static CLID classID ()

Detailed Description

This class provides the converter for the AthenaAttributeList class.

Definition at line 28 of file AthenaAttributeListCnv.h.

Constructor & Destructor Documentation

◆ ~AthenaAttributeListCnv()

AthenaAttributeListCnv::~AthenaAttributeListCnv ( )
virtual

Destructor.

Definition at line 33 of file AthenaAttributeListCnv.cxx.

33 {
34}

◆ AthenaAttributeListCnv()

AthenaAttributeListCnv::AthenaAttributeListCnv ( ISvcLocator * svcloc)

Constructor.

Definition at line 104 of file AthenaAttributeListCnv.cxx.

104 :
105 Converter(storageType(), classID(), svcloc) {
106}

Member Function Documentation

◆ classID()

CLID AthenaAttributeListCnv::classID ( )
static
Returns
class ID.

Definition at line 100 of file AthenaAttributeListCnv.cxx.

◆ createObj()

StatusCode AthenaAttributeListCnv::createObj ( IOpaqueAddress * pAddr,
DataObject *& pObj )
virtual

Create a transient object from a POOL persistent representation.

Parameters
pAddr[IN] IOpaqueAddress of POOL persistent representation.
pObj[OUT] pointer to the transient object.

Definition at line 48 of file AthenaAttributeListCnv.cxx.

48 {
49
50 // This is the "read" method for an AttributeList. Here we only
51 // extract an AthenaAttributeList pointer from an
52 // AthenaAttrListAddress and return it
53
54 MsgStream log(msgSvc(), "AthenaAttributeListCnv");
55 log << MSG::DEBUG << "Creating AthenaAttrListAddress Object" << endmsg;
56
57 AthenaAttrListAddress* addr = dynamic_cast<AthenaAttrListAddress*>(pAddr);
58
59 if (addr) {
60 // Successful cast
61 pObj = SG::asStorable(addr->attrList());
62 if (!pObj) {
63 log << MSG::ERROR << "AttributeList ptr is 0 from AthenaAttrListAddress " << endmsg;
64 return(StatusCode::FAILURE);
65 }
66 } else {
67 log << MSG::ERROR << "Could not extract ptr for AthenaAttrListAddress " << endmsg;
68 return(StatusCode::FAILURE);
69 }
70
71 return(StatusCode::SUCCESS);
72}
#define endmsg
AthenaAttributeList * attrList()
Access to AttributeList.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)

◆ createRep()

StatusCode AthenaAttributeListCnv::createRep ( DataObject * pObj,
IOpaqueAddress *& pAddr )
virtual

Create a POOL persistent representation for a transient object.

Parameters
pObj[IN] pointer to the transient object.
pAddr[OUT] IOpaqueAddress of POOL persistent representation.

Definition at line 74 of file AthenaAttributeListCnv.cxx.

74 {
75
76 // This is the "write" method for an AttributeList. Here we only
77 // create an AthenaAttrListAddress and fill it with a pointer to
78 // the AthenaAttributeList
79
80 MsgStream log(msgSvc(), "AthenaAttributeListCnv");
81 log << MSG::DEBUG << "Copy AthenaAttributeList ptr into AthenaAttrListAddress" << endmsg;
82
83 AthenaAttributeList* list = 0; //dynamic_cast<AthenaAttributeList*>(pObj);
84 SG::fromStorable(pObj, list);
85 if ( pAddr != nullptr ) pAddr->release();
86 AthenaAttrListAddress* addr = new AthenaAttrListAddress(storageType(),
87 classID(),
88 "POOLContainer_AthenaAttributeList][CLID=x");
89 addr->setAttrList(list);
90 pAddr = addr;
91 pAddr->addRef();
92 log << MSG::DEBUG << "Created AthenaAttrListAddress with list ptr: " << list << endmsg;
93 return(StatusCode::SUCCESS);
94}
void setAttrList(AthenaAttributeList *attrList)
Add AttributeList.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
list(name, path='/')
Definition histSizes.py:38

◆ initialize()

StatusCode AthenaAttributeListCnv::initialize ( )
virtual

Gaudi Service Interface method implementations:

Definition at line 36 of file AthenaAttributeListCnv.cxx.

36 {
37 MsgStream log(msgSvc(), "AthenaAttributeListCnv");
38
39 log << MSG::DEBUG << "initialize() in AthenaAttributeListCnv" << 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}
::StatusCode StatusCode
StatusCode definition for legacy code.
status
Definition merge.py:16

◆ repSvcType()

long int AthenaAttributeListCnv::repSvcType ( ) const
virtual
Returns
storage type.

Definition at line 28 of file AthenaAttributeListCnv.cxx.

28 {
29 return(storageType());
30}

◆ storageType()

long AthenaAttributeListCnv::storageType ( )
static
Returns
storage type.

Definition at line 96 of file AthenaAttributeListCnv.cxx.

96 {
98}
int type() const
Access to full type.
Definition DbType.h:65
static const DbType POOL_StorageType
Definition DbType.h:84

The documentation for this class was generated from the following files: