| The Gaudi Framework v32r1 (f65d50dc)

DirectoryCnv.cpp
Go to the documentation of this file.
1 // Include files
2 #include "DirectoryCnv.h"
3 //------------------------------------------------------------------------------
4 //
5 // Implementation of class : RootHistCnv::DirectoryCnv
6 //
7 // Author : Charles Leggett
8 //
9 //------------------------------------------------------------------------------
10 DECLARE_CONVERTER( RootHistCnv::DirectoryCnv )
11 //------------------------------------------------------------------------------
12 StatusCode RootHistCnv::DirectoryCnv::createObj( IOpaqueAddress* /* pAddress */, DataObject*& refpObject ) {
13 refpObject = new DataObject();
14 return StatusCode::SUCCESS;
15 }
16
17 //------------------------------------------------------------------------------
18 StatusCode RootHistCnv::DirectoryCnv::createRep( DataObject* pObj, IOpaqueAddress*& refpAddr ) {
19 if ( changeDirectory( pObj ) ) {
20 const char* d_nam = pObj->name().c_str() + 1;
21 if ( !gDirectory->GetKey( d_nam ) ) { gDirectory->mkdir( d_nam ); }
22 gDirectory->cd( d_nam );
23 return createAddress( pObj, gDirectory, nullptr, refpAddr );
24 }
25 refpAddr = nullptr;
26 return StatusCode::FAILURE;
27 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DECLARE_CONVERTER
#define DECLARE_CONVERTER(x)
Definition: Converter.h:150
RootHistCnv::DirectoryCnv
Definition: DirectoryCnv.h:18
RootHistCnv::DirectoryCnv::createRep
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition: DirectoryCnv.cpp:18
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:200
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DirectoryCnv.h
RootHistCnv
Definition: DirectoryCnv.h:17
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:62
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:55
std::string::c_str
T c_str(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
RootHistCnv::RConverter::createAddress
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation.
Definition: RConverter.cpp:155