| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# DataSvc.h

Go to the documentation of this file.

    00001 // $Id: DataSvc.h,v 1.14 2006/11/30 14:43:13 mato Exp $
    00002 #ifndef GAUDIKERNEL_DATASVC_H
    00003 #define GAUDIKERNEL_DATASVC_H
    00004
    00005 // Include files
    00006 #include "GaudiKernel/Service.h"
    00007 #include "GaudiKernel/DataStoreItem.h"
    00008 #include "GaudiKernel/IDataManagerSvc.h"
    00009 #include "GaudiKernel/IDataProviderSvc.h"
    00010
    00011 // Forward declarations
    00012 // Incident service
    00013 class IIncidentSvc;
    00014 // Generic address
    00015 class IOpaqueAddress;
    00016 // Generic interface to data object class
    00017 class DataObject;
    00018 // Data store agent
    00019 class IDataStoreAgent;
    00020 // Service factory
    00021 template <class TYPE> class SvcFactory;
    00022
    00023 // Do not clutter global namespace for helpers...
    00024 namespace DataSvcHelpers    {
    00025   // Map of objects where loading is inhibited
    00026   class InhibitMap;
    00027   // Generic registry entry
    00028   class RegistryEntry;
    00029 }
    00030
    00031
    00042 class DataSvc  : public Service,
    00043                              virtual public IDataProviderSvc,
    00044                  virtual public IDataManagerSvc
    00045 {
    00047   friend class SvcFactory<DataSvc>;
    00048
    00049 public:
    00051   typedef std::vector<DataStoreItem> LoadItems;
    00052
    00053 protected:
    00055   CLID                            m_rootCLID;
    00057   std::string                     m_rootName;
    00059   IConversionSvc*                 m_dataLoader;
    00061   IIncidentSvc*                   m_incidentSvc;
    00063   LoadItems                       m_preLoads;
    00065   bool                            m_forceLeaves;
    00067   bool                            m_enableAccessHdlr;
    00069   bool                            m_enableFaultHdlr;
    00071   DataSvcHelpers::RegistryEntry*  m_root;
    00073   DataSvcHelpers::InhibitMap*     m_inhibitMap;
    00075   std::vector<std::string>        m_inhibitPathes;
    00077   std::string                     m_accessName;
    00079   std::string                     m_faultName;
    00080 public:
    00081
    00083   virtual CLID rootCLID() const;
    00084
    00086   virtual std::string rootName() const;
    00087
    00089   virtual StatusCode registerAddress( const std::string& fullPath,
    00090                                       IOpaqueAddress* pAddress);
    00091
    00093   virtual StatusCode registerAddress( DataObject* parentObj,
    00094                                       const std::string& objectPath,
    00095                                       IOpaqueAddress* pAddress);
    00096
    00098   virtual StatusCode registerAddress( IRegistry* parentObj,
    00099                                       const std::string& objectPath,
    00100                                       IOpaqueAddress* pAddress);
    00101
    00103   virtual StatusCode unregisterAddress(const std::string& fullPath);
    00104
    00106   virtual StatusCode unregisterAddress( DataObject* pParent,
    00107                                         const std::string& objPath);
    00108
    00110   virtual StatusCode unregisterAddress( IRegistry* pParent,
    00111                                         const std::string& objPath);
    00112
    00116   virtual StatusCode objectLeaves( const DataObject*  pObject,
    00117                                   std::vector<IRegistry*>& refLeaves);
    00121   virtual StatusCode objectLeaves( const IRegistry*   pRegistry,
    00122                                   std::vector<IRegistry*>& refLeaves);
    00123
    00125   virtual StatusCode objectParent( const DataObject*  pObject,
    00126                                    IRegistry*& refpParent);
    00128   virtual StatusCode objectParent( const IRegistry*   pRegistry,
    00129                                    IRegistry*& refpParent);
    00130
    00134   virtual StatusCode clearSubTree( const std::string& sub_tree_path );
    00135
    00139   virtual StatusCode clearSubTree( DataObject* pObject );
    00140
    00142   virtual StatusCode clearStore();
    00143
    00147   virtual StatusCode traverseSubTree( const std::string& sub_tree_path,
    00148                                       IDataStoreAgent* pAgent );
    00149
    00151   virtual StatusCode traverseSubTree( DataObject* pObject,
    00152                                       IDataStoreAgent* pAgent );
    00153
    00155   virtual StatusCode traverseTree( IDataStoreAgent* pAgent );
    00156
    00159   virtual StatusCode setRoot( const std::string& root_name,
    00160                               DataObject* pRootObj);
    00161
    00165   virtual StatusCode i_setRoot( const std::string& root_name,
    00166                                 DataObject* pRootObj);
    00167
    00170   virtual StatusCode setRoot (const std::string& root_path,
    00171                               IOpaqueAddress* pRootAddr);
    00172
    00177   virtual StatusCode i_setRoot (const std::string& root_path,
    00178                                 IOpaqueAddress* pRootAddr);
    00179
    00183   virtual StatusCode setDataLoader( IConversionSvc* svc );
    00184
    00186   virtual StatusCode addPreLoadItem( const DataStoreItem& item );
    00187
    00189   virtual StatusCode addPreLoadItem( const std::string& itemPath );
    00190
    00192   virtual StatusCode removePreLoadItem( const DataStoreItem& item );
    00193
    00195   virtual StatusCode removePreLoadItem( const std::string& itemPath );
    00196
    00198   virtual StatusCode resetPreLoad();
    00199
    00207   virtual StatusCode preLoad( int depth,
    00208                               int load_depth,
    00209                               DataObject* pObject );
    00210
    00212   virtual StatusCode preLoad();
    00213
    00215   virtual StatusCode registerObject(  const std::string& fullPath,
    00216                                       DataObject* pObject );
    00217
    00219   virtual StatusCode registerObject(  const std::string& parentPath,
    00220                                       const std::string& objPath,
    00221                                       DataObject* pObject );
    00222
    00224   virtual StatusCode registerObject(  const std::string& parentPath,
    00225                                       int item,
    00226                                       DataObject* pObject );
    00227
    00229   virtual StatusCode registerObject(  DataObject* parentObj,
    00230                                       const std::string& objPath,
    00231                                       DataObject* pObject );
    00232
    00234   virtual StatusCode registerObject(  DataObject* parentObj,
    00235                                       int item,
    00236                                       DataObject* pObject );
    00237
    00239   virtual StatusCode unregisterObject(const std::string& fullPath );
    00240
    00242   virtual StatusCode unregisterObject(const std::string& parentPath,
    00243                                       const std::string& objectPath );
    00244
    00246   virtual StatusCode unregisterObject(const std::string& parentPath,
    00247                                       int item );
    00248
    00250   virtual StatusCode unregisterObject(DataObject* pObject );
    00251
    00253   virtual StatusCode unregisterObject(DataObject* pObject,
    00254                                       const std::string& objectPath );
    00255
    00257   virtual StatusCode unregisterObject(DataObject* pObject,
    00258                                       int item );
    00259
    00261   virtual StatusCode retrieveObject(  IRegistry* pDirectory,
    00262                                       const std::string& path,
    00263                                       DataObject*& pObject );
    00264
    00266   virtual StatusCode retrieveObject(  const std::string& fullPath,
    00267                                       DataObject*& pObject );
    00268
    00270   virtual StatusCode retrieveObject(  const std::string& parentPath,
    00271                                       const std::string& objPath,
    00272                                       DataObject*& pObject );
    00273
    00275   virtual StatusCode retrieveObject(  const std::string& parentPath,
    00276                                       int item,
    00277                                       DataObject*& pObject );
    00278
    00280   virtual StatusCode retrieveObject(  DataObject* parentObj,
    00281                                       const std::string& objPath,
    00282                                       DataObject*& pObject );
    00283
    00285   virtual StatusCode retrieveObject(  DataObject* parentObj,
    00286                                       int item,
    00287                                       DataObject*& pObject );
    00288
    00290   virtual StatusCode findObject(  const std::string& fullPath,
    00291                                   DataObject*& pObject );
    00292
    00294   virtual StatusCode findObject(  IRegistry* pDirectory,
    00295                                   const std::string& path,
    00296                                   DataObject*& pObject );
    00297
    00299   virtual StatusCode findObject(  const std::string& parentPath,
    00300                                   const std::string& objPath,
    00301                                   DataObject*& pObject );
    00302
    00304   virtual StatusCode findObject(  const std::string& parentPath,
    00305                                   int item,
    00306                                   DataObject*& pObject );
    00307
    00309   virtual StatusCode findObject(  DataObject* parentObj,
    00310                                   const std::string& objPath,
    00311                                   DataObject*& pObject );
    00312
    00314   virtual StatusCode findObject(  DataObject* parentObj,
    00315                                   int item,
    00316                                   DataObject*& pObject );
    00317
    00319   virtual StatusCode linkObject(  IRegistry* from,
    00320                                   const std::string& objPath,
    00321                                   DataObject* to );
    00322
    00324   virtual StatusCode linkObject(  const std::string& fromPath,
    00325                                   const std::string& objPath,
    00326                                   DataObject* to );
    00327
    00329   virtual StatusCode linkObject(  DataObject* from,
    00330                                   const std::string& objPath,
    00331                                   DataObject* to );
    00332
    00334   virtual StatusCode linkObject(  const std::string& fullPath,
    00335                                   DataObject* to );
    00336
    00338   virtual StatusCode unlinkObject(IRegistry* from,
    00339                                   const std::string& objPath );
    00340
    00342   virtual StatusCode unlinkObject(const std::string& fromPath,
    00343                                   const std::string& objPath );
    00344
    00346   virtual StatusCode unlinkObject(DataObject* fromObj,
    00347                                   const std::string& objPath );
    00348
    00350   virtual StatusCode unlinkObject(const std::string& fullPath );
    00351
    00353   virtual StatusCode updateObject(IRegistry* pDirectory );
    00354
    00356   virtual StatusCode updateObject(const std::string& updatePath );
    00357
    00359   virtual StatusCode updateObject(DataObject* toUpdate );
    00360
    00362   virtual StatusCode updateObject(const std::string& parentPath,
    00363                                   const std::string& updatePath );
    00364
    00366   virtual StatusCode updateObject(DataObject* pParent,
    00367                                   const std::string& updatePath );
    00368
    00370   virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvUnknown );
    00371
    00373   virtual StatusCode initialize();
    00374
    00376   virtual StatusCode reinitialize();
    00377
    00379   virtual StatusCode finalize();
    00380
    00382   DataSvc( const std::string& name, ISvcLocator* svc );
    00383
    00385   virtual ~DataSvc();
    00386
    00387 protected:
    00389   bool checkRoot()    {
    00390     return 0 != m_root;
    00391   }
    00392
    00396   virtual IConversionSvc* getDataLoader(IRegistry* pReg);
    00397
    00399   virtual DataObject* createDefaultObject()   const;
    00400
    00404   virtual StatusCode loadObject( IRegistry* pNode );
    00405
    00409   virtual StatusCode loadObject( IConversionSvc* pLoader,
    00410                                  IRegistry* pNode );
    00411
    00413   StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode,
    00414                             const std::string& path,
    00415                             DataSvcHelpers::RegistryEntry*& pEntry );
    00422   DataObject* handleDataFault(IRegistry* pReg, const std::string& path="");
    00423 };
    00424 #endif // GAUDIKERNEL_DATASVC_H
    00425