![]() |
|
|
Generated: 24 Nov 2008 |
#include <PoolDb/PoolDbStatCnv.h>


Definition at line 24 of file 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. | |
| 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 26 of file PoolDbStatCnv.cpp.
00029 : PoolDbBaseCnv(typ, clid, svc) 00030 { 00031 }
| 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 34 of file PoolDbStatCnv.cpp.
00034 { 00035 const std::string& path = pReg->identifier(); 00036 long loc = path.find('/',1); 00037 std::string local = "<local>"; 00038 if ( loc > 0 ) { 00039 loc = path.find('/',++loc); 00040 if ( loc > 0 ) { 00041 local += path.substr(loc,path.length()-loc); 00042 } 00043 } 00044 return local; 00045 }
| 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 47 of file PoolDbStatCnv.cpp.
00047 { 00048 std::string path = topLevel(pReg); 00049 DataObject* pObj = 0; 00050 dataProvider()->retrieveObject(path, pObj); 00051 if ( pObj ) { 00052 NTuple::File* fptr = dynamic_cast<NTuple::File*>(pObj); 00053 if ( fptr ) { 00054 return fptr->name(); 00055 } 00056 } 00057 return ""; 00058 }
| 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 61 of file PoolDbStatCnv.cpp.
00062 { 00063 if ( pReg ) { 00064 std::string path = pReg->identifier(); 00065 size_t idx = path.find('/', 1); 00066 if ( idx != std::string::npos ) { 00067 idx = path.find('/', idx+1); 00068 if ( idx != std::string::npos ) { 00069 path = path.substr(0, idx); 00070 } 00071 return path; 00072 } 00073 } 00074 return ""; 00075 }
| 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 77 of file PoolDbStatCnv.cpp.
00084 { 00085 ROOT::Reflex::Type cl = pool::DbReflex::forTypeInfo(typeid(PoolDbNTupleDescriptor)); 00086 const pool::DbTypeInfo* info = pool::DbTypeInfo::create(cl.Name(ROOT::Reflex::SCOPED)); 00087 if ( info ) { 00088 StatusCode status = m_dbMgr->connectOutput(path, openMode); 00089 if ( status.isSuccess() ) { 00090 std::auto_ptr<PoolDbNTupleDescriptor> dsc(new PoolDbNTupleDescriptor()); 00091 dsc->description = desc; 00092 dsc->optional = opt; 00093 dsc->container = ident; 00094 dsc->guid = guid.toString(); 00095 dsc->clid = clid; 00096 pool::DataCallBack* call=new pool::DbObjectCallBack(cl); 00097 call->setShape(info); 00098 call->setObject(dsc.release()); 00099 status = m_dbMgr->markWrite(call,"GaudiStatisticsDescription"); 00100 if ( status.isSuccess() ) { 00101 status = m_dbMgr->commitOutput(path, true); 00102 } 00103 } 00104 return status; 00105 } 00106 return StatusCode::FAILURE; 00107 }