The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
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
//------------------------------------------------------------------------------
20
DECLARE_CONVERTER
(
RootHistCnv::DirectoryCnv
)
21
//------------------------------------------------------------------------------
22
StatusCode
RootHistCnv
::
DirectoryCnv
::
createObj
(
IOpaqueAddress
*
/* pAddress */
,
DataObject
*& refpObject ) {
23
refpObject =
new
DataObject
();
24
return
StatusCode::SUCCESS
;
25
}
26
27
//------------------------------------------------------------------------------
28
StatusCode
RootHistCnv::DirectoryCnv::createRep
(
DataObject
* pObj,
IOpaqueAddress
*& refpAddr ) {
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
}
DECLARE_CONVERTER
#define DECLARE_CONVERTER(x)
Definition
Converter.h:142
DirectoryCnv.h
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition
DataObject.h:37
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition
DataObject.cpp:72
IOpaqueAddress
Opaque address interface definition.
Definition
IOpaqueAddress.h:28
RootHistCnv::DirectoryCnv
Definition
DirectoryCnv.h:27
RootHistCnv::DirectoryCnv::DirectoryCnv
DirectoryCnv(ISvcLocator *svc)
Standard constructor.
Definition
DirectoryCnv.h:36
RootHistCnv::DirectoryCnv::createObj
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&refpObj) override
Create the transient representation of an object.
Definition
DirectoryCnv.cpp:22
RootHistCnv::DirectoryCnv::createRep
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition
DirectoryCnv.cpp:28
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory).
Definition
RConverter.cpp:210
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
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
RootHistCnv
Definition
DirectoryCnv.h:26
RootHistCnv
src
DirectoryCnv.cpp
Generated on
for The Gaudi Framework by
1.17.0