| # Gaudi Framework, version v21r7p1 |

Home |  | Generated: 15 Feb 2010

# ISvcManager.h

Go to the documentation of this file.

    00001 // $Id: ISvcManager.h,v 1.7 2008/11/10 15:29:09 marcocle Exp $
    00002 #ifndef GAUDIKERNEL_ISVCMANAGER_H
    00003 #define GAUDIKERNEL_ISVCMANAGER_H
    00004
    00005 // Include files
    00006 #include "GaudiKernel/IComponentManager.h"
    00007 #include "GaudiKernel/SmartIF.h"
    00008 #include "GaudiKernel/TypeNameString.h"
    00009 #include <string>
    00010
    00011 // Forward class declaration
    00012 #if defined(GAUDI_V20_COMPAT) || (!defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR))
    00013 class ISvcFactory;
    00014 #include "GaudiKernel/IService.h"
    00015 #else
    00016 class IService;
    00017 #endif
    00018 class ISvcLocator;
    00019
    00029 class GAUDI_API ISvcManager: virtual public IComponentManager {
    00030 public:
    00032   DeclareInterfaceID(ISvcManager,4,0);
    00033
    00039   virtual StatusCode addService( IService* svc, int prio = 10) = 0;
    00040
    00041 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
    00042
    00047   virtual StatusCode addService( const std::string& typ, const std::string& nam, int prio ){
    00048     return addService(Gaudi::Utils::TypeNameString(nam,typ), prio);
    00049   }
    00050 #endif
    00051
    00057   virtual StatusCode addService( const Gaudi::Utils::TypeNameString& nametype, int prio = 10) = 0;
    00058
    00064   virtual StatusCode removeService( IService* svc ) = 0;
    00065
    00071   virtual StatusCode removeService( const std::string& nam ) = 0;
    00072
    00073 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
    00074
    00080   virtual StatusCode declareSvcFactory( const ISvcFactory& /*factory*/,
    00081                                         const std::string& /*svctype*/ ) {
    00082     // This function is never used.
    00083     return StatusCode::FAILURE;
    00084   }
    00085 #endif
    00086
    00093   virtual StatusCode declareSvcType( const std::string& svcname,
    00094                                      const std::string& svctype ) = 0;
    00095
    00102   virtual SmartIF<IService>& createService(const Gaudi::Utils::TypeNameString& nametype) = 0;
    00103
    00104 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
    00105
    00113   virtual StatusCode createService( const std::string& svctype,
    00114                                     const std::string& svcname,
    00115                                     IService*& svc ){
    00116     SmartIF<IService> s = createService(svctype + "/" + svcname);
    00117     svc = s.get();
    00118     if (svc) {
    00119       svc->addRef(); // Needed to maintain the correct reference counting.
    00120       return StatusCode::SUCCESS;
    00121     }
    00122     return StatusCode::FAILURE;
    00123   }
    00124
    00131   virtual StatusCode getFactory(    const std::string& /*svc_type*/,
    00132                                     const ISvcFactory*& /*fac*/) const {
    00133     // This function is never used.
    00134     return StatusCode::FAILURE;
    00135   }
    00136
    00141   virtual StatusCode initializeServices() { return initialize(); }
    00142
    00147   virtual StatusCode startServices() { return start(); }
    00148
    00153   virtual StatusCode stopServices() { return stop(); }
    00154
    00159   virtual StatusCode finalizeServices() { return finalize(); }
    00160
    00165   virtual StatusCode reinitializeServices() { return reinitialize(); }
    00166
    00171   virtual StatusCode restartServices() { return restart(); }
    00172 #endif
    00173
    00174   virtual int getPriority(const std::string& name) const = 0;
    00175   virtual StatusCode setPriority(const std::string& name, int pri) = 0;
    00176
    00178   virtual bool loopCheckEnabled() const = 0;
    00180   virtual void setLoopCheckEnabled(bool en = true) = 0;
    00181
    00182 };
    00183
    00184 #endif  // GAUDIKERNEL_ISVCMANAGER_H
    00185