| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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_NAMESPACE_CONVERTER_FACTORY( RootHistCnv, DirectoryCnv )
11 //------------------------------------------------------------------------------
12 StatusCode RootHistCnv::DirectoryCnv::createObj( IOpaqueAddress* /* pAddress */, DataObject*& refpObject )
13 {
14 refpObject = new DataObject();
15 return StatusCode::SUCCESS;
16 }
17
18 //------------------------------------------------------------------------------
19 StatusCode RootHistCnv::DirectoryCnv::createRep( DataObject* pObj, IOpaqueAddress*& refpAddr )
20 {
21 if ( changeDirectory( pObj ) ) {
22 const char* d_nam = pObj->name().c_str() + 1;
23 if ( !gDirectory->GetKey( d_nam ) ) {
24 gDirectory->mkdir( d_nam );
25 }
26 gDirectory->cd( d_nam );
27 return createAddress( pObj, gDirectory, nullptr, refpAddr );
28 }
29 refpAddr = nullptr;
30 return StatusCode::FAILURE;
31 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::FAILURE
Definition: StatusCode.h:31
RootHistCnv::DirectoryCnv
Definition: DirectoryCnv.h:19
RootHistCnv::DirectoryCnv::createRep
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition: DirectoryCnv.cpp:19
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:205
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DirectoryCnv.h
RootHistCnv
Definition: DirectoryCnv.h:17
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:55
DECLARE_NAMESPACE_CONVERTER_FACTORY
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
Definition: Converter.h:177
std::string::c_str
T c_str(T...args)
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
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:29
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:160