| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Static Public Attributes | List of all members
ISvcManager Class Referenceabstract

The ISvcManager is the interface implemented by the Service Factory in the Application Manager to support management functions. More...

`#include <GaudiKernel/ISvcManager.h>`

Inheritance diagram for ISvcManager:
[legend]
Collaboration diagram for ISvcManager:
[legend]

## Public Member Functions
| DeclareInterfaceID (ISvcManager, 4, 0)
| InterfaceID. More...
virtual StatusCode | addService (IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
| Add a service to the "active" list of services of the factory. More...
virtual StatusCode | addService (const std::string &typ, const std::string &nam, int prio)
| Add a service to the "active" list of services of the factory. More...
virtual StatusCode | addService (const Gaudi::Utils::TypeNameString &nametype, int prio=DEFAULT_SVC_PRIORITY)=0
| Add a service to the "active" list of services of the factory. More...
virtual StatusCode | removeService (IService *svc)=0
| Remove a service from the "active" list of services of the factory. More...
virtual StatusCode | removeService (const std::string &nam)=0
| Remove a service from the "active" list of services of the factory. More...
virtual StatusCode | declareSvcFactory (const ISvcFactory &, const std::string &)
| Declare an abstract factory for a given service type. More...
virtual StatusCode | declareSvcType (const std::string &svcname, const std::string &svctype)=0
| Declare the type of the service to be used when crating a given service name. More...
virtual SmartIF< IService > & | createService (const Gaudi::Utils::TypeNameString &nametype)=0
| Creates and instance of a service type that has been declared beforehand and assigns it a name. More...
virtual StatusCode | createService (const std::string &svctype, const std::string &svcname, IService *&svc)
| Creates and instance of a service type that has been declared beforehand and assigns it a name. More...
virtual StatusCode | getFactory (const std::string &, const ISvcFactory *&) const
| Access to service factory by name to create unmanaged services. More...
virtual StatusCode | initializeServices ()
| Initializes the list of "active" services. More...
virtual StatusCode | startServices ()
| Starts the list of "active" services. More...
virtual StatusCode | stopServices ()
| Stops the list of "active" services. More...
virtual StatusCode | finalizeServices ()
| Finalizes the list of "active" services. More...
virtual StatusCode | reinitializeServices ()
| Reinitializes the list of "active" services. More...
virtual StatusCode | restartServices ()
| Restarts the list of "active" services. More...
virtual int | getPriority (const std::string &name) const =0
virtual StatusCode | setPriority (const std::string &name, int pri)=0
virtual bool | loopCheckEnabled () const =0
| Get the value of the initialization loop check flag. More...
virtual void | setLoopCheckEnabled (bool en=true)=0
| Set the value of the initialization loop check flag. More...
Public Member Functions inherited from IComponentManager
| DeclareInterfaceID (IComponentManager, 1, 0)
| InterfaceID. More...
virtual const InterfaceID & | componentBaseInterface () const =0
| Basic interface id of the managed components. More...
virtual void | outputLevelUpdate ()=0
| Function to call to update the outputLevel of the components (after a change in MessageSvc). More...
Public Member Functions inherited from IStateful
| DeclareInterfaceID (IStateful, 1, 0)
| InterfaceID. More...
virtual StatusCode | configure ()=0
| Configuration (from OFFLINE to CONFIGURED). More...
virtual StatusCode | initialize ()=0
| Initialization (from CONFIGURED to INITIALIZED). More...
virtual StatusCode | start ()=0
| Start (from INITIALIZED to RUNNING). More...
virtual StatusCode | stop ()=0
| Stop (from RUNNING to INITIALIZED). More...
virtual StatusCode | finalize ()=0
| Finalize (from INITIALIZED to CONFIGURED). More...
virtual StatusCode | terminate ()=0
| Initialization (from CONFIGURED to OFFLINE). More...
virtual StatusCode | reinitialize ()=0
| Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
virtual StatusCode | restart ()=0
| Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
virtual Gaudi::StateMachine::State | FSMState () const =0
| Get the current state. More...
virtual Gaudi::StateMachine::State | targetFSMState () const =0
| When we are in the middle of a transition, get the state where the transition is leading us. More...
Public Member Functions inherited from IInterface
virtual void * | i_cast (const InterfaceID &) const =0
| main cast function More...
virtual std::vector< std::string > | getInterfaceNames () const =0
| Returns a vector of strings containing the names of all the implemented interfaces. More...
virtual unsigned long | addRef ()=0
| Increment the reference count of Interface instance. More...
virtual unsigned long | release ()=0
| Release Interface instance. More...
virtual unsigned long | refCount () const =0
| Current reference count. More...
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)=0
| Set the void** to the pointer to the requested interface of the instance. More...
virtual | ~IInterface ()=default
| Virtual destructor. More...

## Static Public Attributes
static const int | DEFAULT_SVC_PRIORITY = 100

## Additional Inherited Members
Public Types inherited from IInterface
enum | Status : StatusCode::code_t { Status::FAILURE = 0, Status::SUCCESS = 1, Status::NO_INTERFACE, Status::VERSMISMATCH, Status::LAST_ERROR }
| Return status. More...
using | iid = Gaudi::InterfaceId< IInterface, 0, 0 >
| Interface ID. More...
using | ext_iids = Gaudi::interface_list< iid >
| Extra interfaces. More...
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface. More...

## Detailed Description

The ISvcManager is the interface implemented by the Service Factory in the Application Manager to support management functions.

Clients use this interface to declare abstract service factories, and to create concrete instances of services.

Author
  Pere Mato

Definition at line 28 of file ISvcManager.h.

## Member Function Documentation

## ◆ addService() [1/3]

virtual StatusCode ISvcManager::addService | ( | IService * | svc,
|  | int | prio = `DEFAULT_SVC_PRIORITY`
| ) |  |
| pure virtual

Add a service to the "active" list of services of the factory.

Parameters

  svc | Pointer to the service

Returns
  StatusCode indicating success or failure.

## ◆ addService() [2/3]

virtual StatusCode ISvcManager::addService | ( | const std::string & | typ,
|  | const std::string & | nam,
|  | int | prio
| ) |  |
| inline virtual

Add a service to the "active" list of services of the factory.

Parameters

  svc | Pointer to the service

Returns
  StatusCode indicating success or failure.

Definition at line 48 of file ISvcManager.h.

48 {
49 return addService( Gaudi::Utils::TypeNameString( nam, typ ), prio );
50 }
ISvcManager::addService
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10

## ◆ addService() [3/3]

virtual StatusCode ISvcManager::addService | ( | const Gaudi::Utils::TypeNameString & | nametype,
|  | int | prio = `DEFAULT_SVC_PRIORITY`
| ) |  |
| pure virtual

Add a service to the "active" list of services of the factory.

Parameters

  svc | Pointer to the service

Returns
  StatusCode indicating success or failure.

## ◆ createService() [1/2]

virtual SmartIF<IService>& ISvcManager::createService | ( | const Gaudi::Utils::TypeNameString & | nametype | ) |
| pure virtual

Creates and instance of a service type that has been declared beforehand and assigns it a name.

It returns a pointer to an IService.

Parameters

  nametype | name/type of the service to create

Returns
  SmartIF& to the created service.

NOTE: as this returns a &, the underlying implementation must guarantee that once created, these SmartIF remain pinned in their location, thus constraining the underlying implementation (i.e. one cannot use something like std::vector<SmartIF<IService>>). If this interface had used value-semantics, and returned just plain SmartIF<IService> (i.e. WITHOUT the &) then the underlying implementation would have much more freedom)

## ◆ createService() [2/2]

virtual StatusCode ISvcManager::createService | ( | const std::string & | svctype,
|  | const std::string & | svcname,
|  | IService *& | svc
| ) |  |
| inline virtual

Creates and instance of a service type that has been declared beforehand and assigns it a name.

It returns a pointer to an IService.

Parameters

  svctype | Service type name
  svcname | Service name to be set
  svc | Returned service pointer

Returns
  StatusCode indicating success or failure.

Definition at line 121 of file ISvcManager.h.

121 {
122 SmartIF<IService> s = createService( svctype + "/" + svcname );
123 svc = s.get();
124 if ( svc ) {
125 svc->addRef(); // Needed to maintain the correct reference counting.
126 return StatusCode::SUCCESS;
127 }
128 return StatusCode::FAILURE;
129 }
SmartIF< IService >
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ISvcManager::createService
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name.
gaudirun.s
string s
Definition: gaudirun.py:316
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ DeclareInterfaceID()

ISvcManager::DeclareInterfaceID | ( | ISvcManager | ,
|  | 4 | ,
|  | 0 |
| ) |  |

InterfaceID.

## ◆ declareSvcFactory()

virtual StatusCode ISvcManager::declareSvcFactory | ( | const ISvcFactory & | ,
|  | const std::string & |
| ) |  |
| inline virtual

Declare an abstract factory for a given service type.

Parameters

  factory | Abstract factory reference
  svctype | Service type name

Returns
  StatusCode indicating success or failure.

Definition at line 81 of file ISvcManager.h.

81 {
82 // This function is never used.
83 return StatusCode::FAILURE;
84 }
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ declareSvcType()

virtual StatusCode ISvcManager::declareSvcType | ( | const std::string & | svcname,
|  | const std::string & | svctype
| ) |  |
| pure virtual

Declare the type of the service to be used when crating a given service name.

Parameters

  svcname | Service name
  svctype | Service type name

Returns
  StatusCode indicating success or failure.

## ◆ finalizeServices()

virtual StatusCode ISvcManager::finalizeServices | ( |  | ) |
| inline virtual

Finalizes the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 164 of file ISvcManager.h.

164 { return finalize(); }
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).

## ◆ getFactory()

virtual StatusCode ISvcManager::getFactory | ( | const std::string & | ,
|  | const ISvcFactory *& |
| ) |  | const
| inline virtual

Access to service factory by name to create unmanaged services.

Parameters

  svc_type | [IN] Name of the service type
  fac | [OUT] Reference to store pointer to service factory

Returns
  StatusCode indicating success or failure.

Definition at line 137 of file ISvcManager.h.

137 {
138 // This function is never used.
139 return StatusCode::FAILURE;
140 }
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ getPriority()

virtual int ISvcManager::getPriority | ( | const std::string & | name | ) | const
| pure virtual

## ◆ initializeServices()

virtual StatusCode ISvcManager::initializeServices | ( |  | ) |
| inline virtual

Initializes the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 146 of file ISvcManager.h.

146 { return initialize(); }
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).

## ◆ loopCheckEnabled()

virtual bool ISvcManager::loopCheckEnabled | ( |  | ) | const
| pure virtual

Get the value of the initialization loop check flag.

## ◆ reinitializeServices()

virtual StatusCode ISvcManager::reinitializeServices | ( |  | ) |
| inline virtual

Reinitializes the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 170 of file ISvcManager.h.

170 { return reinitialize(); }
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

## ◆ removeService() [1/2]

virtual StatusCode ISvcManager::removeService | ( | IService * | svc | ) |
| pure virtual

Remove a service from the "active" list of services of the factory.

Parameters

  svc | Pointer to the service

Returns
  StatusCode indicating success or failure.

## ◆ removeService() [2/2]

virtual StatusCode ISvcManager::removeService | ( | const std::string & | nam | ) |
| pure virtual

Remove a service from the "active" list of services of the factory.

Parameters

  svc | Pointer to the service

Returns
  StatusCode indicating success or failure.

## ◆ restartServices()

virtual StatusCode ISvcManager::restartServices | ( |  | ) |
| inline virtual

Restarts the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 176 of file ISvcManager.h.

176 { return restart(); }
IStateful::restart
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).

## ◆ setLoopCheckEnabled()

virtual void ISvcManager::setLoopCheckEnabled | ( | bool | en = `true` | ) |
| pure virtual

Set the value of the initialization loop check flag.

## ◆ setPriority()

virtual StatusCode ISvcManager::setPriority | ( | const std::string & | name,
|  | int | pri
| ) |  |
| pure virtual

## ◆ startServices()

virtual StatusCode ISvcManager::startServices | ( |  | ) |
| inline virtual

Starts the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 152 of file ISvcManager.h.

152 { return start(); }
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).

## ◆ stopServices()

virtual StatusCode ISvcManager::stopServices | ( |  | ) |
| inline virtual

Stops the list of "active" services.

Returns
  StatusCode indicating success or failure.

Definition at line 158 of file ISvcManager.h.

158 { return stop(); }
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).

## Member Data Documentation

## ◆ DEFAULT_SVC_PRIORITY

const int ISvcManager::DEFAULT_SVC_PRIORITY = 100
| static

Definition at line 33 of file ISvcManager.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/ISvcManager.h