Gaudi Framework, version v20r4

Generated: 8 Jan 2009

HbookCnv::HDirectoryCnv Class Reference

#include <HDirectoryCnv.h>

Inheritance diagram for HbookCnv::HDirectoryCnv:

Inheritance graph
[legend]
Collaboration diagram for HbookCnv::HDirectoryCnv:

Collaboration graph
[legend]

List of all members.


Detailed Description

Create persistent and transient representations of data store directories.

Definition at line 30 of file HDirectoryCnv.h.


Public Member Functions

virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
 Create the transient representation of an object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *refpObject)
 Update the transient object from the other representation.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Convert the transient object to the requested representation.
 HDirectoryCnv (ISvcLocator *svc)
 Standard constructor.
 HDirectoryCnv (ISvcLocator *svc, const CLID &clid)
 Standard constructor.
virtual ~HDirectoryCnv ()
 Standard destructor.

Static Public Member Functions

static const CLIDclassID ()
 Inquire class type.

Friends

class CnvFactory< HDirectoryCnv >

Constructor & Destructor Documentation

HbookCnv::HDirectoryCnv::HDirectoryCnv ( ISvcLocator svc  ) 

Standard constructor.

Definition at line 34 of file HDirectoryCnv.cpp.

00035  : HConverter(CLID_StatisticsDirectory, svc)                 {
00036 }

HbookCnv::HDirectoryCnv::HDirectoryCnv ( ISvcLocator svc,
const CLID clid 
)

Standard constructor.

Definition at line 39 of file HDirectoryCnv.cpp.

00040  : HConverter(clid, svc)                 {
00041 }

HbookCnv::HDirectoryCnv::~HDirectoryCnv (  )  [virtual]

Standard destructor.

Standard Destructor.

Definition at line 45 of file HDirectoryCnv.cpp.

00045                                                                               {
00046 }


Member Function Documentation

StatusCode HbookCnv::HDirectoryCnv::createObj ( IOpaqueAddress pAddress,
DataObject *&  refpObject 
) [virtual]

Create the transient representation of an object.

Reimplemented from Converter.

Reimplemented in HbookCnv::HFileCnv.

Definition at line 54 of file HDirectoryCnv.cpp.

00054                                                                                                     {
00055   refpObject = new NTuple::Directory();
00056   return StatusCode::SUCCESS;
00057 }

StatusCode HbookCnv::HDirectoryCnv::fillObjRefs ( IOpaqueAddress pAddress,
DataObject refpObject 
) [virtual]

Update the transient object from the other representation.

Reimplemented from Converter.

Definition at line 94 of file HDirectoryCnv.cpp.

00095                                                                        {
00096   IRegistry* pReg = pObject->registry();
00097   // Strip of store name to get the top level RZ directory
00098   std::string full = m_prefix + pReg->identifier();
00099   std::string lloc = full.substr(full.find('/',1),full.length());
00100   std::string loc  = "/" + lloc;
00101   std::string pawc = "//PAWC" + lloc;
00102   long idh = 0;
00103   ::HMDIR(pawc, "S");
00104   ::HCDIR(loc, " ");
00105   while( 1 )    {
00106     std::string type = " ", title = "";
00107     long icycle = 99999, ioff = 0;
00108     IOpaqueAddress* pA = 0;
00109     CLID clid = CLID_NULL;
00110     char leaf_name[32];
00111     ::HLNEXT(idh, type, title, "12ND");
00112     if ( idh == 0 || title.length() == 0 ) break;
00113     sprintf(leaf_name, "/%ld", idh);
00114 
00115     switch ( type[0] )    {
00116     case 'D':
00117       createAddress(full, CLID_StatisticsDirectory, title, pA);
00118       break;
00119     case '1':
00120       title = leaf_name;
00121       createAddress(full, CLID_H1D, idh, pA);
00122       break;
00123     case '2':   
00124       title = leaf_name;
00125       createAddress(full, CLID_H2D, idh, pA);
00126       break;
00127     case 'N':
00128       ::HRIN( idh, icycle, ioff);
00129       clid = (1 == ::NTUPLETYPE(idh)) ? CLID_ColumnWiseTuple : CLID_RowWiseTuple;
00130       createAddress(full, clid, idh, pA);
00131       title = leaf_name;
00132       break;
00133     default:
00134       break;
00135     }
00136     if ( 0 != pA )    {
00137       SmartIF<IDataManagerSvc> registrator(dataProvider());
00138       registrator->registerAddress(pReg, title, pA);
00139     }
00140   }
00141   return StatusCode::SUCCESS;
00142 }

StatusCode HbookCnv::HDirectoryCnv::createRep ( DataObject pObject,
IOpaqueAddress *&  refpAddress 
) [virtual]

Convert the transient object to the requested representation.

Reimplemented from HbookCnv::HConverter.

Reimplemented in HbookCnv::HFileCnv.

Definition at line 61 of file HDirectoryCnv.cpp.

00061                                                                                               {
00062   if ( pObject )    {
00063     IRegistry* pRegistry = pObject->registry();
00064     if ( pRegistry )   {
00065       std::string loc = m_prefix + pRegistry->identifier();
00066       if ( createDirectory(loc).isSuccess() )   {
00067         setDirectory(loc);
00068         setDiskDirectory(loc);
00069         return createAddress(loc, objType(), pRegistry->name(), refpAddress);
00070       }
00071     }
00072   }
00073   refpAddress = 0;
00074   return StatusCode::FAILURE;
00075 }

StatusCode HbookCnv::HDirectoryCnv::updateRep ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual]

Convert the transient object to the requested representation.

Reimplemented from Converter.

Reimplemented in HbookCnv::HFileCnv.

Definition at line 79 of file HDirectoryCnv.cpp.

00079                                                                                                   {
00080   if ( pObject )    {
00081     IRegistry* pRegistry = pObject->registry();
00082     if ( pRegistry )   {
00083       std::string loc = m_prefix + pRegistry->identifier();
00084       if ( createDirectory(loc).isSuccess() )   {
00085         setDirectory(loc);
00086         return StatusCode::SUCCESS;
00087       }
00088     }
00089   }
00090   return StatusCode::FAILURE;
00091 }

const CLID & HbookCnv::HDirectoryCnv::classID (  )  [static]

Inquire class type.

Reimplemented in HbookCnv::DirectoryCnv, and HbookCnv::HFileCnv.

Definition at line 49 of file HDirectoryCnv.cpp.

00049                                                 {
00050   return CLID_StatisticsDirectory;
00051 }


Friends And Related Function Documentation

friend class CnvFactory< HDirectoryCnv > [friend]

Definition at line 32 of file HDirectoryCnv.h.


The documentation for this class was generated from the following files:

Generated at Thu Jan 8 17:54:07 2009 for Gaudi Framework, version v20r4 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004