Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ISvcManager.h
Go to the documentation of this file.
1 // $Id: ISvcManager.h,v 1.7 2008/11/10 15:29:09 marcocle Exp $
2 #ifndef GAUDIKERNEL_ISVCMANAGER_H
3 #define GAUDIKERNEL_ISVCMANAGER_H
4 
5 // Include files
7 #include "GaudiKernel/SmartIF.h"
9 #include <string>
10 
11 // Forward class declaration
12 #if defined(GAUDI_V20_COMPAT) || (!defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR))
13 class ISvcFactory;
14 #include "GaudiKernel/IService.h"
15 #else
16 class IService;
17 #endif
18 class ISvcLocator;
19 
29 class GAUDI_API ISvcManager: virtual public IComponentManager {
30 public:
33 
34  static const int DEFAULT_SVC_PRIORITY = 100;
35 
41  virtual StatusCode addService( IService* svc, int prio = DEFAULT_SVC_PRIORITY) = 0;
42 
43 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
44 
49  virtual StatusCode addService( const std::string& typ, const std::string& nam, int prio ){
50  return addService(Gaudi::Utils::TypeNameString(nam,typ), prio);
51  }
52 #endif
53 
59  virtual StatusCode addService( const Gaudi::Utils::TypeNameString& nametype, int prio = DEFAULT_SVC_PRIORITY) = 0;
60 
66  virtual StatusCode removeService( IService* svc ) = 0;
67 
73  virtual StatusCode removeService( const std::string& nam ) = 0;
74 
75 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
76 
82  virtual StatusCode declareSvcFactory( const ISvcFactory& /*factory*/,
83  const std::string& /*svctype*/ ) {
84  // This function is never used.
85  return StatusCode::FAILURE;
86  }
87 #endif
88 
95  virtual StatusCode declareSvcType( const std::string& svcname,
96  const std::string& svctype ) = 0;
97 
104  virtual SmartIF<IService>& createService(const Gaudi::Utils::TypeNameString& nametype) = 0;
105 
106 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
107 
115  virtual StatusCode createService( const std::string& svctype,
116  const std::string& svcname,
117  IService*& svc ){
118  SmartIF<IService> s = createService(svctype + "/" + svcname);
119  svc = s.get();
120  if (svc) {
121  svc->addRef(); // Needed to maintain the correct reference counting.
122  return StatusCode::SUCCESS;
123  }
124  return StatusCode::FAILURE;
125  }
126 
133  virtual StatusCode getFactory( const std::string& /*svc_type*/,
134  const ISvcFactory*& /*fac*/) const {
135  // This function is never used.
136  return StatusCode::FAILURE;
137  }
138 
143  virtual StatusCode initializeServices() { return initialize(); }
144 
149  virtual StatusCode startServices() { return start(); }
150 
155  virtual StatusCode stopServices() { return stop(); }
156 
161  virtual StatusCode finalizeServices() { return finalize(); }
162 
168 
173  virtual StatusCode restartServices() { return restart(); }
174 #endif
175 
176  virtual int getPriority(const std::string& name) const = 0;
177  virtual StatusCode setPriority(const std::string& name, int pri) = 0;
178 
180  virtual bool loopCheckEnabled() const = 0;
182  virtual void setLoopCheckEnabled(bool en = true) = 0;
183 
184 };
185 
186 #endif // GAUDIKERNEL_ISVCMANAGER_H
187 

Generated at Wed Dec 4 2013 14:33:08 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004