Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
Gaudi::RootDatabaseCnv Class Reference

Statistics file converter class definition. More...

#include <Root/RootDatabaseCnv.h>

Inheritance diagram for Gaudi::RootDatabaseCnv:
Inheritance graph
[legend]
Collaboration diagram for Gaudi::RootDatabaseCnv:
Collaboration graph
[legend]

Public Member Functions

 RootDatabaseCnv (long typ, const CLID &, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootDatabaseCnv ()
 Standard destructor.
 
virtual const std::string containerName (IRegistry *) const
 Retrieve the name of the container a given object is placed into.
 
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Converter overrides: Create transient object from persistent data.
 
- Public Member Functions inherited from Gaudi::RootDirectoryCnv
 RootDirectoryCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor.
 
virtual ~RootDirectoryCnv ()
 Standard Destructor.
 
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.
 
- 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.
 
- 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")
 

Additional Inherited Members

- Public Types inherited from implements1< IConverter >
typedef implements1 base_class
 Typedef to this class.
 
typedef extend_interfaces1
< IConverter
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Static Public Member Functions inherited from IInterface
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 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

Statistics file converter class definition.

Description: Definition of the converter to open root database files.

Author
M.Frank
Version
1.0

Definition at line 29 of file RootDatabaseCnv.h.

Constructor & Destructor Documentation

RootDatabaseCnv::RootDatabaseCnv ( long  typ,
const CLID cl,
ISvcLocator svc,
RootCnvSvc mgr 
)

Initializing Constructor.

Parameters
typ[IN] Concrete storage type of the converter
svc[IN] Pointer to service locator object
mgr[IN] Pointer to hosting conversion service
Returns
Reference to RootDatabaseCnv object

Definition at line 28 of file RootDatabaseCnv.cpp.

: RootDirectoryCnv(typ, cl, svc, mgr)
{
}
RootDatabaseCnv::~RootDatabaseCnv ( )
virtual

Standard destructor.

Definition at line 34 of file RootDatabaseCnv.cpp.

{
}

Member Function Documentation

virtual const std::string Gaudi::RootDatabaseCnv::containerName ( IRegistry ) const
inlinevirtual

Retrieve the name of the container a given object is placed into.

Parameters
pReg[IN] Pointer to registry entry.
Returns
Name of the container the object should be put to.

Reimplemented from Gaudi::RootStatCnv.

Definition at line 49 of file RootDatabaseCnv.h.

{
return "<local>";
}
StatusCode RootDatabaseCnv::createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

Converter overrides: Create transient object from persistent data.

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

Reimplemented from Gaudi::RootDirectoryCnv.

Definition at line 39 of file RootDatabaseCnv.cpp.

{
if ( pAddr ) {
IRegistry* pReg = pAddr->registry();
const unsigned long* ipars = pAddr->ipar();
const string* spars = pAddr->par();
char mode = char(ipars[1]);
string fname = spars[0];
string oname = pReg->name();
bool recrea = mode == 'R';
bool create = mode == 'N';
bool update = mode == 'U';
bool read = mode == 'O';
const CLID& clid = objType();
string cntName = containerName(pReg);
if ( create ) {
status = saveDescription(fname, cntName, "File containing statistics results.","", clid);
if ( status.isSuccess() ) {
log() << MSG::INFO << "Opened NEW Database file:"
<< fname << " as " << oname << endmsg;
}
}
else if ( update ) {
m_dbMgr->connectDatabase(fname,IDataConnection::UPDATE,&con).ignore();
status = saveDescription(fname, cntName, "File containing statistics results.","", clid);
if ( status.isSuccess() ) {
log() << MSG::INFO << "Connect to existing Database file:"
<< fname << " as " << oname << " for UPDATE" << endmsg;
}
}
else if ( read ) {
if ( status.isSuccess() ) {
log() << MSG::INFO << "Connect to existing Database file:"
<< fname << " as " << oname << " for READ" << endmsg;
}
}
else if ( recrea ) {
m_dbMgr->connectDatabase(fname,IDataConnection::RECREATE,&con).ignore();
status = saveDescription(fname, cntName, "File containing statistics results.","", clid);
if ( status.isSuccess() ) {
log() << MSG::INFO << "Recreate Database file:" << fname << " as " << oname << endmsg;
}
}
else {
log() << MSG::ERROR << "Don't know what to do:" << fname << endmsg;
}
// Now create object
if ( status.isSuccess() ) {
NTuple::File* pFile = new NTuple::File(objType(), fname, oname);
pFile->setOpen(false);
refpObj = pFile;
}
}
return status;
}

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

Generated at Wed Dec 4 2013 14:33:21 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004