The Gaudi Framework  master (37c0b60a)
DirectoryCnv.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Include files
12 #include "DirectoryCnv.h"
13 //------------------------------------------------------------------------------
14 //
15 // Implementation of class : RootHistCnv::DirectoryCnv
16 //
17 // Author : Charles Leggett
18 //
19 //------------------------------------------------------------------------------
21 //------------------------------------------------------------------------------
22 StatusCode RootHistCnv::DirectoryCnv::createObj( IOpaqueAddress* /* pAddress */, DataObject*& refpObject ) {
23  refpObject = new DataObject();
24  return StatusCode::SUCCESS;
25 }
26 
27 //------------------------------------------------------------------------------
29  if ( changeDirectory( pObj ) ) {
30  const char* d_nam = pObj->name().c_str() + 1;
31  if ( !gDirectory->GetKey( d_nam ) ) { gDirectory->mkdir( d_nam ); }
32  gDirectory->cd( d_nam );
33  return createAddress( pObj, gDirectory, nullptr, refpAddr );
34  }
35  refpAddr = nullptr;
36  return StatusCode::FAILURE;
37 }
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:72
IOpaqueAddress
Definition: IOpaqueAddress.h:33
DECLARE_CONVERTER
#define DECLARE_CONVERTER(x)
Definition: Converter.h:163
DirectoryCnv.h
RootHistCnv::DirectoryCnv
Definition: DirectoryCnv.h:28
RootHistCnv
Definition: DirectoryCnv.h:27
StatusCode
Definition: StatusCode.h:65
std::string::c_str
T c_str(T... args)
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:165
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataObject
Definition: DataObject.h:36
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:210
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
RootHistCnv::DirectoryCnv::createRep
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition: DirectoryCnv.cpp:28