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