| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# 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 GAUDI_API DataSvc: public extends2<Service, IDataProviderSvc, IDataManagerSvc>
    00043 {
    00045   friend class SvcFactory<DataSvc>;
    00046
    00047 public:
    00049   typedef std::vector<DataStoreItem> LoadItems;
    00050
    00051 protected:
    00053   CLID                            m_rootCLID;
    00055   std::string                     m_rootName;
    00057   IConversionSvc*                 m_dataLoader;
    00059   IIncidentSvc*                   m_incidentSvc;
    00061   LoadItems                       m_preLoads;
    00063   bool                            m_forceLeaves;
    00065   bool                            m_enableAccessHdlr;
    00067   bool                            m_enableFaultHdlr;
    00069   DataSvcHelpers::RegistryEntry*  m_root;
    00071   DataSvcHelpers::InhibitMap*     m_inhibitMap;
    00073   std::vector<std::string>        m_inhibitPathes;
    00075   std::string                     m_accessName;
    00077   std::string                     m_faultName;
    00078 public:
    00079
    00081   virtual CLID rootCLID() const;
    00082
    00084   virtual std::string rootName() const;
    00085
    00087   virtual StatusCode registerAddress( const std::string& fullPath,
    00088                                       IOpaqueAddress* pAddress);
    00089
    00091   virtual StatusCode registerAddress( DataObject* parentObj,
    00092                                       const std::string& objectPath,
    00093                                       IOpaqueAddress* pAddress);
    00094
    00096   virtual StatusCode registerAddress( IRegistry* parentObj,
    00097                                       const std::string& objectPath,
    00098                                       IOpaqueAddress* pAddress);
    00099
    00101   virtual StatusCode unregisterAddress(const std::string& fullPath);
    00102
    00104   virtual StatusCode unregisterAddress( DataObject* pParent,
    00105                                         const std::string& objPath);
    00106
    00108   virtual StatusCode unregisterAddress( IRegistry* pParent,
    00109                                         const std::string& objPath);
    00110
    00114   virtual StatusCode objectLeaves( const DataObject*  pObject,
    00115                                   std::vector<IRegistry*>& refLeaves);
    00119   virtual StatusCode objectLeaves( const IRegistry*   pRegistry,
    00120                                   std::vector<IRegistry*>& refLeaves);
    00121
    00123   virtual StatusCode objectParent( const DataObject*  pObject,
    00124                                    IRegistry*& refpParent);
    00126   virtual StatusCode objectParent( const IRegistry*   pRegistry,
    00127                                    IRegistry*& refpParent);
    00128
    00132   virtual StatusCode clearSubTree( const std::string& sub_tree_path );
    00133
    00137   virtual StatusCode clearSubTree( DataObject* pObject );
    00138
    00140   virtual StatusCode clearStore();
    00141
    00145   virtual StatusCode traverseSubTree( const std::string& sub_tree_path,
    00146                                       IDataStoreAgent* pAgent );
    00147
    00149   virtual StatusCode traverseSubTree( DataObject* pObject,
    00150                                       IDataStoreAgent* pAgent );
    00151
    00153   virtual StatusCode traverseTree( IDataStoreAgent* pAgent );
    00154
    00157   virtual StatusCode setRoot( const std::string& root_name,
    00158                               DataObject* pRootObj);
    00159
    00163   virtual StatusCode i_setRoot( const std::string& root_name,
    00164                                 DataObject* pRootObj);
    00165
    00168   virtual StatusCode setRoot (const std::string& root_path,
    00169                               IOpaqueAddress* pRootAddr);
    00170
    00175   virtual StatusCode i_setRoot (const std::string& root_path,
    00176                                 IOpaqueAddress* pRootAddr);
    00177
    00181   virtual StatusCode setDataLoader( IConversionSvc* svc );
    00182
    00184   virtual StatusCode addPreLoadItem( const DataStoreItem& item );
    00185
    00187   virtual StatusCode addPreLoadItem( const std::string& itemPath );
    00188
    00190   virtual StatusCode removePreLoadItem( const DataStoreItem& item );
    00191
    00193   virtual StatusCode removePreLoadItem( const std::string& itemPath );
    00194
    00196   virtual StatusCode resetPreLoad();
    00197
    00205   virtual StatusCode preLoad( int depth,
    00206                               int load_depth,
    00207                               DataObject* pObject );
    00208
    00210   virtual StatusCode preLoad();
    00211
    00213   virtual StatusCode registerObject(  const std::string& fullPath,
    00214                                       DataObject* pObject );
    00215
    00217   virtual StatusCode registerObject(  const std::string& parentPath,
    00218                                       const std::string& objPath,
    00219                                       DataObject* pObject );
    00220
    00222   virtual StatusCode registerObject(  const std::string& parentPath,
    00223                                       int item,
    00224                                       DataObject* pObject );
    00225
    00227   virtual StatusCode registerObject(  DataObject* parentObj,
    00228                                       const std::string& objPath,
    00229                                       DataObject* pObject );
    00230
    00232   virtual StatusCode registerObject(  DataObject* parentObj,
    00233                                       int item,
    00234                                       DataObject* pObject );
    00235
    00237   virtual StatusCode unregisterObject(const std::string& fullPath );
    00238
    00240   virtual StatusCode unregisterObject(const std::string& parentPath,
    00241                                       const std::string& objectPath );
    00242
    00244   virtual StatusCode unregisterObject(const std::string& parentPath,
    00245                                       int item );
    00246
    00248   virtual StatusCode unregisterObject(DataObject* pObject );
    00249
    00251   virtual StatusCode unregisterObject(DataObject* pObject,
    00252                                       const std::string& objectPath );
    00253
    00255   virtual StatusCode unregisterObject(DataObject* pObject,
    00256                                       int item );
    00257
    00259   virtual StatusCode retrieveObject(  IRegistry* pDirectory,
    00260                                       const std::string& path,
    00261                                       DataObject*& pObject );
    00262
    00264   virtual StatusCode retrieveObject(  const std::string& fullPath,
    00265                                       DataObject*& pObject );
    00266
    00268   virtual StatusCode retrieveObject(  const std::string& parentPath,
    00269                                       const std::string& objPath,
    00270                                       DataObject*& pObject );
    00271
    00273   virtual StatusCode retrieveObject(  const std::string& parentPath,
    00274                                       int item,
    00275                                       DataObject*& pObject );
    00276
    00278   virtual StatusCode retrieveObject(  DataObject* parentObj,
    00279                                       const std::string& objPath,
    00280                                       DataObject*& pObject );
    00281
    00283   virtual StatusCode retrieveObject(  DataObject* parentObj,
    00284                                       int item,
    00285                                       DataObject*& pObject );
    00286
    00288   virtual StatusCode findObject(  const std::string& fullPath,
    00289                                   DataObject*& pObject );
    00290
    00292   virtual StatusCode findObject(  IRegistry* pDirectory,
    00293                                   const std::string& path,
    00294                                   DataObject*& pObject );
    00295
    00297   virtual StatusCode findObject(  const std::string& parentPath,
    00298                                   const std::string& objPath,
    00299                                   DataObject*& pObject );
    00300
    00302   virtual StatusCode findObject(  const std::string& parentPath,
    00303                                   int item,
    00304                                   DataObject*& pObject );
    00305
    00307   virtual StatusCode findObject(  DataObject* parentObj,
    00308                                   const std::string& objPath,
    00309                                   DataObject*& pObject );
    00310
    00312   virtual StatusCode findObject(  DataObject* parentObj,
    00313                                   int item,
    00314                                   DataObject*& pObject );
    00315
    00317   virtual StatusCode linkObject(  IRegistry* from,
    00318                                   const std::string& objPath,
    00319                                   DataObject* to );
    00320
    00322   virtual StatusCode linkObject(  const std::string& fromPath,
    00323                                   const std::string& objPath,
    00324                                   DataObject* to );
    00325
    00327   virtual StatusCode linkObject(  DataObject* from,
    00328                                   const std::string& objPath,
    00329                                   DataObject* to );
    00330
    00332   virtual StatusCode linkObject(  const std::string& fullPath,
    00333                                   DataObject* to );
    00334
    00336   virtual StatusCode unlinkObject(IRegistry* from,
    00337                                   const std::string& objPath );
    00338
    00340   virtual StatusCode unlinkObject(const std::string& fromPath,
    00341                                   const std::string& objPath );
    00342
    00344   virtual StatusCode unlinkObject(DataObject* fromObj,
    00345                                   const std::string& objPath );
    00346
    00348   virtual StatusCode unlinkObject(const std::string& fullPath );
    00349
    00351   virtual StatusCode updateObject(IRegistry* pDirectory );
    00352
    00354   virtual StatusCode updateObject(const std::string& updatePath );
    00355
    00357   virtual StatusCode updateObject(DataObject* toUpdate );
    00358
    00360   virtual StatusCode updateObject(const std::string& parentPath,
    00361                                   const std::string& updatePath );
    00362
    00364   virtual StatusCode updateObject(DataObject* pParent,
    00365                                   const std::string& updatePath );
    00366
    00368   virtual StatusCode initialize();
    00369
    00371   virtual StatusCode reinitialize();
    00372
    00374   virtual StatusCode finalize();
    00375
    00377   DataSvc( const std::string& name, ISvcLocator* svc );
    00378
    00380   virtual ~DataSvc();
    00381
    00382 private:
    00384   DataSvc(const DataSvc&);
    00386   DataSvc& operator= (const DataSvc&);
    00387
    00388 protected:
    00390   bool checkRoot()    {
    00391     return 0 != m_root;
    00392   }
    00393
    00397   virtual IConversionSvc* getDataLoader(IRegistry* pReg);
    00398
    00400   virtual DataObject* createDefaultObject()   const;
    00401
    00405   virtual StatusCode loadObject( IRegistry* pNode );
    00406
    00410   virtual StatusCode loadObject( IConversionSvc* pLoader,
    00411                                  IRegistry* pNode );
    00412
    00414   StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode,
    00415                             const std::string& path,
    00416                             DataSvcHelpers::RegistryEntry*& pEntry );
    00423   DataObject* handleDataFault(IRegistry* pReg, const std::string& path="");
    00424 };
    00425 #endif // GAUDIKERNEL_DATASVC_H
    00426