| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# DirectoryCnv.cpp

Go to the documentation of this file.

    00001 // $Id: DirectoryCnv.cpp,v 1.6 2006/11/13 15:19:34 hmd Exp $
    00002
    00003 // Include files
    00004 #include "GaudiKernel/CnvFactory.h"
    00005 #include "DirectoryCnv.h"
    00006 //------------------------------------------------------------------------------
    00007 //
    00008 // Implementation of class :  RootHistCnv::DirectoryCnv
    00009 //
    00010 // Author :                   Charles Leggett
    00011 //
    00012 //------------------------------------------------------------------------------
    00013 DECLARE_NAMESPACE_CONVERTER_FACTORY(RootHistCnv,DirectoryCnv)
    00014 //------------------------------------------------------------------------------
    00015 StatusCode RootHistCnv::DirectoryCnv::createObj(IOpaqueAddress* /* pAddress */,
    00016                                                 DataObject*& refpObject)
    00017 {
    00018   refpObject = new DataObject();
    00019   return StatusCode::SUCCESS;
    00020 }
    00021
    00022 //------------------------------------------------------------------------------
    00023 StatusCode
    00024 RootHistCnv::DirectoryCnv::createRep(DataObject* pObj, IOpaqueAddress*& refpAddr) {
    00025   if ( changeDirectory(pObj) ) {
    00026     const char* d_nam = pObj->name().c_str()+1;
    00027     if (! gDirectory->GetKey(d_nam) ) {
    00028       gDirectory->mkdir(d_nam);
    00029     }
    00030     gDirectory->cd(d_nam);
    00031     return createAddress(pObj, gDirectory, 0, refpAddr);
    00032   }
    00033   refpAddr = 0;
    00034   return StatusCode::FAILURE;
    00035 }