All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ComponentManager Class Reference

Base class for a component manager. More...

#include <GaudiKernel/ComponentManager.h>

Inheritance diagram for ComponentManager:
Collaboration diagram for ComponentManager:

Public Member Functions

 ComponentManager (IInterface *application, const InterfaceID &baseIID)
 Constructor. More...
 
virtual const InterfaceIDcomponentBaseInterface () const
 Basic interface id of the managed components. More...
 
virtual ~ComponentManager ()
 Virtual destructor. More...
 
StatusCode queryInterface (const InterfaceID &iid, void **pinterface)
 Specialized queryInterface implementation. More...
 
virtual SmartIF< ISvcLocator > & serviceLocator () const
 Needed to locate the message service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode initialize ()
 Initialization (from CONFIGURED to INITIALIZED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode finalize ()
 Finalize (from INITIALIZED to CONFIGURED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual StatusCode reinitialize ()
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
- Public Member Functions inherited from CommonMessaging< implements1< IComponentManager > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
virtual const std::string & name () const =0
 This is needed to avoid ambiguous calls to name() More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces1< IComponentManager >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IComponentManager
 DeclareInterfaceID (IComponentManager, 1, 0)
 InterfaceID. More...
 
virtual ~IComponentManager ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- 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 ~IInterface ()
 Virtual destructor. More...
 

Protected Attributes

SmartIF< IInterfacem_application
 Pointer to the owner of the manager. More...
 
SmartIF< IStatefulm_stateful
 Pointer to the IStateful interface of the owner. More...
 
InterfaceID m_basicInterfaceId
 Basic interface id of the managed components. More...
 
SmartIF< ISvcLocatorm_svcLocator
 Service locator (needed to access the MessageSvc) More...
 
- Protected Attributes inherited from CommonMessaging< implements1< IComponentManager > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Additional Inherited Members

- Public Types inherited from CommonMessaging< implements1< IComponentManager > >
typedef CommonMessaging base_class
 
- Public Types inherited from implements1< IComponentManager >
typedef implements1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1
< IComponentManager
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces1< IComponentManager >
typedef
IComponentManager::iid::iids::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Member Functions inherited from CommonMessaging< implements1< IComponentManager > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Detailed Description

Base class for a component manager.

Author
Marco Clemencic

Definition at line 14 of file ComponentManager.h.

Constructor & Destructor Documentation

ComponentManager::ComponentManager ( IInterface application,
const InterfaceID baseIID 
)

Constructor.

Parameters
applicationthe manager of managers

Definition at line 12 of file ComponentManager.cpp.

12  :
13  m_application(application), m_stateful(application), m_basicInterfaceId(baseIID)
14 {
15 }
SmartIF< IStateful > m_stateful
Pointer to the IStateful interface of the owner.
InterfaceID m_basicInterfaceId
Basic interface id of the managed components.
SmartIF< IInterface > m_application
Pointer to the owner of the manager.
ComponentManager::~ComponentManager ( )
virtual

Virtual destructor.

Definition at line 25 of file ComponentManager.cpp.

25  {
26 }

Member Function Documentation

const InterfaceID & ComponentManager::componentBaseInterface ( ) const
virtual

Basic interface id of the managed components.

Implements IComponentManager.

Definition at line 19 of file ComponentManager.cpp.

19  {
20  return m_basicInterfaceId;
21 }
InterfaceID m_basicInterfaceId
Basic interface id of the managed components.
virtual StatusCode ComponentManager::configure ( )
inlinevirtual

Configuration (from OFFLINE to CONFIGURED).

Implements IStateful.

Definition at line 38 of file ComponentManager.h.

virtual StatusCode ComponentManager::finalize ( )
inlinevirtual

Finalize (from INITIALIZED to CONFIGURED).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 50 of file ComponentManager.h.

virtual Gaudi::StateMachine::State ComponentManager::FSMState ( ) const
inlinevirtual

Get the current state.

Implements IStateful.

Definition at line 63 of file ComponentManager.h.

63 {return m_stateful->FSMState();}
SmartIF< IStateful > m_stateful
Pointer to the IStateful interface of the owner.
virtual StatusCode ComponentManager::initialize ( )
inlinevirtual

Initialization (from CONFIGURED to INITIALIZED).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 41 of file ComponentManager.h.

StatusCode ComponentManager::queryInterface ( const InterfaceID iid,
void **  pinterface 
)
virtual

Specialized queryInterface implementation.

If an interface is not fount in the implemented ones, we fall back on the owner.

Implements IInterface.

Reimplemented in extends2< ComponentManager, ISvcManager, ISvcLocator >, and extends1< ComponentManager, IAlgManager >.

Definition at line 30 of file ComponentManager.cpp.

31 {
32  // try local interfaces
33  StatusCode sc = base_class::queryInterface(iid,pinterface);
34  if (sc.isSuccess()) return sc;
35  // fall back on the owner
36  return m_application->queryInterface(iid, pinterface);
37 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
SmartIF< IInterface > m_application
Pointer to the owner of the manager.
virtual StatusCode ComponentManager::reinitialize ( )
inlinevirtual

Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 57 of file ComponentManager.h.

virtual StatusCode ComponentManager::restart ( )
inlinevirtual

Initialization (from RUNNING to RUNNING, via INITIALIZED).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 60 of file ComponentManager.h.

virtual SmartIF<ISvcLocator>& ComponentManager::serviceLocator ( ) const
inlinevirtual

Needed to locate the message service.

Implements CommonMessaging< implements1< IComponentManager > >.

Reimplemented in ServiceManager.

Definition at line 32 of file ComponentManager.h.

32  {
34  return m_svcLocator;
35  }
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
SmartIF< IInterface > m_application
Pointer to the owner of the manager.
virtual StatusCode ComponentManager::start ( )
inlinevirtual

Start (from INITIALIZED to RUNNING).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 44 of file ComponentManager.h.

virtual StatusCode ComponentManager::stop ( )
inlinevirtual

Stop (from RUNNING to INITIALIZED).

Implements IStateful.

Reimplemented in ServiceManager, and AlgorithmManager.

Definition at line 47 of file ComponentManager.h.

virtual Gaudi::StateMachine::State ComponentManager::targetFSMState ( ) const
inlinevirtual

When we are in the middle of a transition, get the state where the transition is leading us.

Otherwise it returns the same state as state().

Implements IStateful.

Definition at line 67 of file ComponentManager.h.

67 {return m_stateful->targetFSMState();}
SmartIF< IStateful > m_stateful
Pointer to the IStateful interface of the owner.
virtual StatusCode ComponentManager::terminate ( )
inlinevirtual

Initialization (from CONFIGURED to OFFLINE).

Implements IStateful.

Definition at line 53 of file ComponentManager.h.

Member Data Documentation

SmartIF<IInterface> ComponentManager::m_application
protected

Pointer to the owner of the manager.

Definition at line 72 of file ComponentManager.h.

InterfaceID ComponentManager::m_basicInterfaceId
protected

Basic interface id of the managed components.

Definition at line 78 of file ComponentManager.h.

SmartIF<IStateful> ComponentManager::m_stateful
protected

Pointer to the IStateful interface of the owner.

Definition at line 75 of file ComponentManager.h.

SmartIF<ISvcLocator> ComponentManager::m_svcLocator
mutableprotected

Service locator (needed to access the MessageSvc)

Definition at line 81 of file ComponentManager.h.


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