All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::RootDirectoryCnv Class Reference

Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples. More...

#include <src/RootDirectoryCnv.h>

Inheritance diagram for Gaudi::RootDirectoryCnv:
Collaboration diagram for Gaudi::RootDirectoryCnv:

Public Member Functions

 RootDirectoryCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootDirectoryCnv ()
 Standard Destructor.
 
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Converter overrides: Create transient object from persistent data.
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Resolve the references of the transient object.
 
virtual StatusCode updateObj (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update transient object from persistent data.
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update the references of an updated transient object.
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Converter overrides: Convert the transient object to the requested representation.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Fill references of persistent object representation.
 
virtual StatusCode updateRep (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update persistent object representation.
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update references of persistent object representation.
 
 RootDirectoryCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootDirectoryCnv ()
 Standard Destructor.
 
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Converter overrides: Create transient object from persistent data.
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Resolve the references of the transient object.
 
virtual StatusCode updateObj (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update transient object from persistent data.
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update the references of an updated transient object.
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Converter overrides: Convert the transient object to the requested representation.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Fill references of persistent object representation.
 
virtual StatusCode updateRep (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update persistent object representation.
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update references of persistent object representation.
 
- Public Member Functions inherited from Gaudi::RootStatCnv
 RootStatCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootStatCnv ()
 Standard Destructor.
 
 RootStatCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootStatCnv ()
 Standard Destructor.
 
- Public Member Functions inherited from Gaudi::RootConverter
 RootConverter (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootConverter ()
 Standard Destructor.
 
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses.
 
 RootConverter (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootConverter ()
 Standard Destructor.
 
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses.
 
- Public Member Functions inherited from Converter
virtual StatusCode setDataProvider (IDataProviderSvc *svc)
 Set Data provider service.
 
virtual SmartIF
< IDataProviderSvc > & 
dataProvider () const
 Get Data provider service.
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Set conversion service the converter is connected to.
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Get conversion service the converter is connected to.
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility.
 
virtual SmartIF
< IAddressCreator > & 
addressCreator () const
 Retrieve address creator facility.
 
virtual const CLIDobjType () const
 Retrieve the class type of objects the converter produces.
 
virtual long i_repSvcType () const
 Retrieve the class type of the data store the converter uses.
 
 Converter (long storage_type, const CLID &class_type, ISvcLocator *svc=0)
 Standard Constructor.
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist.
 
template<class T >
StatusCode service (const std::string &type, const std::string &name, T *&psvc) const
 Access a service by name, type creating it if it doesn't already exist.
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true) const
 Return a pointer to the service identified by name (or "type/name")
 
virtual StatusCode setDataProvider (IDataProviderSvc *svc)
 Set Data provider service.
 
virtual SmartIF
< IDataProviderSvc > & 
dataProvider () const
 Get Data provider service.
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Set conversion service the converter is connected to.
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Get conversion service the converter is connected to.
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility.
 
virtual SmartIF
< IAddressCreator > & 
addressCreator () const
 Retrieve address creator facility.
 
virtual const CLIDobjType () const
 Retrieve the class type of objects the converter produces.
 
virtual long i_repSvcType () const
 Retrieve the class type of the data store the converter uses.
 
 Converter (long storage_type, const CLID &class_type, ISvcLocator *svc=0)
 Standard Constructor.
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist.
 
template<class T >
StatusCode service (const std::string &type, const std::string &name, T *&psvc) const
 Access a service by name, type creating it if it doesn't already exist.
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true) const
 Return a pointer to the service identified by name (or "type/name")
 

Additional Inherited Members

- Public Types inherited from Converter
typedef
Gaudi::PluginService::Factory
< IConverter *, ISvcLocator * > 
Factory
 
typedef
Gaudi::PluginService::Factory
< IConverter *, ISvcLocator * > 
Factory
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 
- Protected Member Functions inherited from Gaudi::RootStatCnv
MsgStreamlog () const
 Helper to use mesage logger.
 
virtual StatusCode initialize ()
 Initialize converter object.
 
virtual StatusCode finalize ()
 Finalize converter object.
 
virtual const std::string containerName (IRegistry *pDir) const
 Retrieve the name of the container a given object is placed into.
 
virtual const std::string fileName (IRegistry *pReg) const
 Retrieve the name of the file a given object is placed into.
 
virtual const std::string topLevel (IRegistry *pReg) const
 Retrieve the full path of the file a given object is placed into.
 
StatusCode makeError (const std::string &msg, bool throw_exception=false) const
 Helper method to issue error messages.
 
StatusCode saveDescription (const std::string &path, const std::string &ident, const std::string &desc, const std::string &opt, const CLID &clid)
 Save statistics object description.
 
MsgStreamlog () const
 Helper to use mesage logger.
 
virtual StatusCode initialize ()
 Initialize converter object.
 
virtual StatusCode finalize ()
 Finalize converter object.
 
virtual const std::string containerName (IRegistry *pDir) const
 Retrieve the name of the container a given object is placed into.
 
virtual const std::string fileName (IRegistry *pReg) const
 Retrieve the name of the file a given object is placed into.
 
virtual const std::string topLevel (IRegistry *pReg) const
 Retrieve the full path of the file a given object is placed into.
 
StatusCode makeError (const std::string &msg, bool throw_exception=false) const
 Helper method to issue error messages.
 
StatusCode saveDescription (const std::string &path, const std::string &ident, const std::string &desc, const std::string &opt, const CLID &clid)
 Save statistics object description.
 
- Protected Attributes inherited from Gaudi::RootStatCnv
IDataManagerSvcm_dataMgr
 Reference to data manager service to manipulate the TES.
 
MsgStreamm_log
 Reference to logger object.
 

Detailed Description

Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples.

Author
M.Frank
Version
1.0

Definition at line 31 of file RootDirectoryCnv.h.

Constructor & Destructor Documentation

RootDirectoryCnv::RootDirectoryCnv ( long  typ,
const CLID clid,
ISvcLocator svc,
RootCnvSvc mgr 
)

Initializing Constructor.

Parameters
typ[IN] Concrete storage type of the converter
clid[IN] Class identifier of the object
svc[IN] Pointer to service locator object
Returns
Reference to RootBaseCnv object

Definition at line 31 of file RootDirectoryCnv.cpp.

: RootStatCnv(typ, clid, svc, mgr)
{
}
virtual Gaudi::RootDirectoryCnv::~RootDirectoryCnv ( )
inlinevirtual

Standard Destructor.

Definition at line 44 of file RootDirectoryCnv.h.

{ }
Gaudi::RootDirectoryCnv::RootDirectoryCnv ( long  typ,
const CLID clid,
ISvcLocator svc,
RootCnvSvc mgr 
)

Initializing Constructor.

Parameters
typ[IN] Concrete storage type of the converter
clid[IN] Class identifier of the object
svc[IN] Pointer to service locator object
Returns
Reference to RootBaseCnv object
virtual Gaudi::RootDirectoryCnv::~RootDirectoryCnv ( )
inlinevirtual

Standard Destructor.

Definition at line 44 of file RootDirectoryCnv.h.

{ }

Member Function Documentation

StatusCode RootDirectoryCnv::createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

Converter overrides: Create transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
refpObj[OUT] Location to pointer to store data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Reimplemented in Gaudi::RootDatabaseCnv, and Gaudi::RootDatabaseCnv.

Definition at line 40 of file RootDirectoryCnv.cpp.

{
refpObj = new NTuple::Directory();
}
virtual StatusCode Gaudi::RootDirectoryCnv::createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

Converter overrides: Create transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
refpObj[OUT] Location to pointer to store data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Reimplemented in Gaudi::RootDatabaseCnv, and Gaudi::RootDatabaseCnv.

StatusCode RootDirectoryCnv::createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

Converter overrides: Convert the transient object to the requested representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 47 of file RootDirectoryCnv.cpp.

{
string dsc;
if ( objType() == CLID_StatisticsDirectory ) {
dsc = "Directory containing statistics results.";
}
else if ( objType() == CLID_StatisticsFile ) {
dsc = "File containing statistics results.";
}
else {
}
string ident = containerName(pObj->registry());
string path = fileName(pObj->registry());
return saveDescription(path, ident, dsc, ident, objType());
}
virtual StatusCode Gaudi::RootDirectoryCnv::createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

Converter overrides: Convert the transient object to the requested representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

StatusCode RootDirectoryCnv::fillObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Resolve the references of the transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 64 of file RootDirectoryCnv.cpp.

{
return updateObjRefs(pAddr, pObj);
}
virtual StatusCode Gaudi::RootDirectoryCnv::fillObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Resolve the references of the transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

StatusCode RootDirectoryCnv::fillRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Fill references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 196 of file RootDirectoryCnv.cpp.

{
}
virtual StatusCode Gaudi::RootDirectoryCnv::fillRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Fill references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

virtual StatusCode Gaudi::RootDirectoryCnv::updateObj ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Converter.

StatusCode RootDirectoryCnv::updateObj ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Converter.

Definition at line 172 of file RootDirectoryCnv.cpp.

{
}
StatusCode RootDirectoryCnv::updateObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update the references of an updated transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Converter.

Definition at line 70 of file RootDirectoryCnv.cpp.

{
typedef vector<RootNTupleDescriptor*> REFS;
REFS refs;
if ( pAddr ) {
IRegistry* pReg = pAddr->registry();
if ( pReg ) {
typedef vector<IRegistry*> Leaves;
string ident = pReg->identifier();
string fname = fileName(pReg);
string cntName = containerName(pReg);
Leaves leaves;
if ( status.isSuccess() ) {
TBranch* b = con->getBranch("##Descriptors","GaudiStatisticsDescription");
if ( b ) {
for(Long64_t n=b->GetEntries(), i=0; i<n; ++i) {
b->SetAddress(&ref);
int nb = b->GetEntry(i);
if ( nb > 1 ) {
string s = ref->container.substr(0,cntName.length());
log() << MSG::VERBOSE << "Read description:" << ref->container
<< " " << ident << " " << cntName << endmsg;
if ( s == cntName ) {
if ( ref->container.length() >= cntName.length()+1 ) {
if ( ref->container.find('/',cntName.length()+1) == string::npos ) {
refs.push_back(ref);
continue;
}
}
}
}
delete ref;
}
}
log() << MSG::DEBUG << "Got " << refs.size() << " tuple connection(s)....." << endmsg;
status = m_dataMgr->objectLeaves(pObject, leaves);
if ( status.isSuccess() ) {
for(REFS::iterator i = refs.begin(); i != refs.end(); ++i) {
REFS::value_type& ref = *i;
if ( ref ) {
bool need_to_add = true;
for(Leaves::iterator j=leaves.begin(); j != leaves.end(); ++j ) {
string curr_leaf = containerName(*j);
if ( curr_leaf == ref->container ) {
need_to_add = false;
break;
}
}
if ( need_to_add ) {
if ( ref->clid == CLID_StatisticsDirectory ||
ref->clid == CLID_StatisticsFile ||
ref->clid == CLID_RowWiseTuple ||
ref->clid == CLID_ColumnWiseTuple )
{
string spar[] = { fname, ref->container};
unsigned long ipar[] = { ~0x0UL, ~0x0UL };
ref->clid,
spar,
ipar,
pA);
}
if ( status.isSuccess() ) {
string top = topLevel(pReg);
string leaf_name = top + ref->container.substr(7);
status = m_dataMgr->registerAddress(leaf_name, pA);
if ( status.isSuccess() ) {
log() << MSG::DEBUG << "Created address for " << leaf_name
<< " of type " << ref->clid << endmsg;
continue;
}
makeError("Failed to register leaves to directory:"+ident,false).ignore();
break;
}
makeError("Failed to create leave address to directory:"+ident,false).ignore();
break;
}
}
makeError("Failed to add leaves to directory:"+ident,false).ignore();
break;
}
}
}
else {
return makeError("Failed to access required tuple data description.",false);
}
}
}
for(REFS::iterator k = refs.begin(); k != refs.end(); ++k) {
if ( *k ) delete (*k);
}
return status;
}
virtual StatusCode Gaudi::RootDirectoryCnv::updateObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update the references of an updated transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Converter.

StatusCode RootDirectoryCnv::updateRep ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Converter.

Definition at line 180 of file RootDirectoryCnv.cpp.

{
}
virtual StatusCode Gaudi::RootDirectoryCnv::updateRep ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Converter.

virtual StatusCode Gaudi::RootDirectoryCnv::updateRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Converter.

StatusCode RootDirectoryCnv::updateRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Converter.

Definition at line 188 of file RootDirectoryCnv.cpp.

{
}

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