|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples. More...
#include <PoolDb/PoolDbStatCnv.h>


Public Member Functions | |
| PoolDbStatCnv (long typ, const CLID &clid, ISvcLocator *svc) | |
| Initializing Constructor. | |
| virtual | ~PoolDbStatCnv () |
| Standard Destructor. | |
Protected Member Functions | |
| 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 | saveDescription (const std::string &path, const std::string &ident, const std::string &desc, const std::string &opt, const pool::Guid &guid, const CLID &clid, const std::string &openMode) |
| Save statistics object description. | |
Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples.
Definition at line 24 of file PoolDbStatCnv.h.
| PoolDbStatCnv::PoolDbStatCnv | ( | long | typ, |
| const CLID & | clid, | ||
| ISvcLocator * | svc | ||
| ) |
Initializing Constructor.
| typ | [IN] Concrete storage type of the converter |
| clid | [IN] Class identifier of the object |
| svc | [IN] Pointer to service locator object |
Definition at line 31 of file PoolDbStatCnv.cpp.
: PoolDbBaseCnv(typ, clid, svc) { }
| virtual PoolDbStatCnv::~PoolDbStatCnv | ( | ) | [inline, virtual] |
| const std::string PoolDbStatCnv::containerName | ( | IRegistry * | pDir ) | const [protected, virtual] |
Retrieve the name of the container a given object is placed into.
| pReg | [IN] Pointer to registry entry. |
Reimplemented from PoolDbBaseCnv.
Reimplemented in PoolDbDatabaseCnv.
Definition at line 39 of file PoolDbStatCnv.cpp.
{
const std::string& path = pReg->identifier();
long loc = path.find('/',1);
std::string local = "<local>";
if ( loc > 0 ) {
loc = path.find('/',++loc);
if ( loc > 0 ) {
local += path.substr(loc,path.length()-loc);
}
}
return local;
}
| const std::string PoolDbStatCnv::fileName | ( | IRegistry * | pReg ) | const [protected, virtual] |
Retrieve the name of the file a given object is placed into.
| pReg | [IN] Pointer to registry entry. |
Definition at line 52 of file PoolDbStatCnv.cpp.
{
std::string path = topLevel(pReg);
DataObject* pObj = 0;
dataProvider()->retrieveObject(path, pObj);
if ( pObj ) {
NTuple::File* fptr = dynamic_cast<NTuple::File*>(pObj);
if ( fptr ) {
return fptr->name();
}
}
return "";
}
| StatusCode PoolDbStatCnv::saveDescription | ( | const std::string & | path, |
| const std::string & | ident, | ||
| const std::string & | desc, | ||
| const std::string & | opt, | ||
| const pool::Guid & | guid, | ||
| const CLID & | clid, | ||
| const std::string & | openMode | ||
| ) | [protected] |
Save statistics object description.
| path | [IN] Path of file to save the description on. |
| ident | [IN] Identifier of description to be saved. |
| desc | [IN] Description |
| opt | [IN] Optional description |
| guid | [IN] Object giud of described object |
| openMode | [IN] Mode of opening the file to save description |
Definition at line 82 of file PoolDbStatCnv.cpp.
{
ROOT::Reflex::Type cl = pool::DbReflex::forTypeInfo(typeid(PoolDbNTupleDescriptor));
const pool::DbTypeInfo* info = pool::DbTypeInfo::create(cl.Name(ROOT::Reflex::SCOPED));
if ( info ) {
StatusCode status = m_dbMgr->connectOutput(path, openMode);
if ( status.isSuccess() ) {
std::auto_ptr<PoolDbNTupleDescriptor> dsc(new PoolDbNTupleDescriptor());
dsc->description = desc;
dsc->optional = opt;
dsc->container = ident;
dsc->guid = guid.toString();
dsc->clid = clid;
pool::DataCallBack* call=new pool::DbObjectCallBack(cl);
call->setShape(info);
call->setObject(dsc.release());
status = m_dbMgr->markWrite(call,"GaudiStatisticsDescription");
if ( status.isSuccess() ) {
status = m_dbMgr->commitOutput(path, true);
}
}
return status;
}
return StatusCode::FAILURE;
}
| const std::string PoolDbStatCnv::topLevel | ( | IRegistry * | pReg ) | const [protected, virtual] |
Retrieve the full path of the file a given object is placed into.
| pReg | [IN] Pointer to registry entry. |
Definition at line 66 of file PoolDbStatCnv.cpp.
{
if ( pReg ) {
std::string path = pReg->identifier();
size_t idx = path.find('/', 1);
if ( idx != std::string::npos ) {
idx = path.find('/', idx+1);
if ( idx != std::string::npos ) {
path = path.substr(0, idx);
}
return path;
}
}
return "";
}