| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:
[legend]
Collaboration diagram for Gaudi::RootDatabaseCnv:
[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 CLID & | objType () 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< IService > | service (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::Factory1 < IConverter *, ISvcLocator * > | Factory
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface.
Protected Member Functions inherited from Gaudi::RootStatCnv
MsgStream & | log () 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
IDataManagerSvc * | m_dataMgr
| Reference to data manager service to manipulate the TES.
MsgStream * | m_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 26 of file RootDatabaseCnv.cpp.

: RootDirectoryCnv(typ, cl, svc, mgr)
{
}

RootDatabaseCnv::~RootDatabaseCnv | ( |  | ) |
| virtual

Standard destructor.

Definition at line 32 of file RootDatabaseCnv.cpp.

{
}

## Member Function Documentation

virtual const std::string Gaudi::RootDatabaseCnv::containerName | ( | IRegistry * |  | ) | const
| inline virtual

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 37 of file RootDatabaseCnv.cpp.

{
StatusCode status = StatusCode::FAILURE;
if ( pAddr ) {
RootDataConnection* con = 0;
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();
status = StatusCode::SUCCESS;
string cntName = containerName(pReg);
if ( create ) {
m_dbMgr->connectDatabase(fname,IDataConnection::CREATE,&con).ignore();
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 ) {
status = m_dbMgr->connectDatabase(fname,IDataConnection::READ,&con);
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;
status = StatusCode::FAILURE;
}
// 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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/RootCnv/RootCnv/RootDatabaseCnv.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/RootCnv/src/RootDatabaseCnv.cpp