| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AlgContextSvc Class Reference

`#include <AlgContextSvc.h>`

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

## Public Member Functions
virtual StatusCode | setCurrentAlg (IAlgorithm *a)
| set the currently executing algorithm ("push_back")
virtual StatusCode | unSetCurrentAlg (IAlgorithm *a)
| remove the algorithm ("pop_back")
virtual IAlgorithm * | currentAlg () const
| accessor to current algorithm:
virtual const IAlgContextSvc::Algorithms & | algorithms () const
| get the stack of executed algorithms
virtual void | handle (const Incident &)
| handle incident
virtual StatusCode | initialize ()
| standard initialization of the service
virtual StatusCode | finalize ()
| standard finalization of the service
| AlgContextSvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor.
virtual | ~AlgContextSvc ()
| Standard Destructor.
Public Member Functions inherited from extends2< Service, IAlgContextSvc, IIncidentListener >
| extends2 (A1 a1, A2 a2, A3 a3)
| Templated constructor with 3 arguments.
| extends2 (A1 a1, A2 a2)
| Templated constructor with 2 arguments.
| extends2 (A1 a1)
| Templated constructor with 1 argument.
| extends2 ()
| Default constructor.
virtual void * | i_cast (const InterfaceID &tid) const
| Implementation of IInterface::i_cast.
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)
| Implementation of IInterface::queryInterface.
virtual std::vector< std::string > | getInterfaceNames () const
| Implementation of IInterface::getInterfaceNames.
virtual | ~extends2 ()
| Virtual destructor.
Public Member Functions inherited from Service
virtual unsigned long | release ()
| Release Interface instance.
virtual const std::string & | name () const
| Retrieve name of the service.
virtual StatusCode | configure ()
virtual StatusCode | start ()
virtual StatusCode | stop ()
virtual StatusCode | terminate ()
virtual Gaudi::StateMachine::State | FSMState () const
virtual Gaudi::StateMachine::State | targetFSMState () const
virtual StatusCode | reinitialize ()
virtual StatusCode | restart ()
virtual StatusCode | sysInitialize ()
| Initialize Service.
virtual StatusCode | sysStart ()
| Initialize Service.
virtual StatusCode | sysStop ()
| Initialize Service.
virtual StatusCode | sysFinalize ()
| Finalize Service.
virtual StatusCode | sysReinitialize ()
| Re-initialize the Service.
virtual StatusCode | sysRestart ()
| Re-initialize the Service.
virtual StatusCode | setProperty (const Property &p)
virtual StatusCode | setProperty (const std::string &s)
virtual StatusCode | setProperty (const std::string &n, const std::string &v)
virtual StatusCode | getProperty (Property *p) const
virtual const Property & | getProperty (const std::string &name) const
virtual StatusCode | getProperty (const std::string &n, std::string &v) const
virtual const std::vector < Property * > & | getProperties () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value
| Service (const std::string &name, ISvcLocator *svcloc)
| Standard Constructor.
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator.
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job.
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist.
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist.
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property.
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties.
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
| CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
| Templated constructor with 3 arguments.
| CommonMessaging (const A1 &a1, const A2 &a2)
| Templated constructor with 2 arguments.
| CommonMessaging (const A1 &a1)
| Templated constructor with 1 argument.
| CommonMessaging ()
| Default constructor.
virtual | ~CommonMessaging ()
| Virtual destructor.
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service.
MsgStream & | msgStream () const
| Return an uninitialized MsgStream.
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts.
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL)
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING)
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO)
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG)
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE)
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO)
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream
Public Member Functions inherited from extend_interfaces2< I1, I2 >
virtual | ~extend_interfaces2 ()
| Virtual destructor.

## Private Member Functions
| AlgContextSvc ()
| no default constructor
| AlgContextSvc (const AlgContextSvc &)
| no copy constructor
AlgContextSvc & | operator= (const AlgContextSvc &)
| no assignment

## Private Attributes
IAlgContextSvc::Algorithms | m_algorithms
| the stack of current algorithms
IIncidentSvc * | m_inc
| pointer to Incident Service
bool | m_check

## Additional Inherited Members
Public Types inherited from extends2< Service, IAlgContextSvc, IIncidentListener >
typedef extends2 | base_class
| Typedef to this class.
typedef extend_interfaces2 < IAlgContextSvc, IIncidentListener > | extend_interfaces_base
| Typedef to the base of this class.
typedef extend_interfaces_base::ext_iids | interfaces
| MPL set of all the implemented interfaces.
Protected Member Functions inherited from Service
virtual | ~Service ()
| Standard Destructor.
int | outputLevel () const
| get the `Service's` output level
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel
| Service output level.
Gaudi::StateMachine::State | m_state
| Service state.
Gaudi::StateMachine::State | m_targetState
| Service state.

## Detailed Description

Definition at line 27 of file AlgContextSvc.h.

## Constructor & Destructor Documentation

AlgContextSvc::AlgContextSvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Standard Constructor.

Instantiation of a static factory class used by clients to create instances of this service.

See Also
  Service

Definition at line 29 of file AlgContextSvc.cpp.

: base_class ( name , svc )
, m_algorithms ( 0 )
, m_inc ( 0 )
, m_check ( true )
{
declareProperty ( "Check" , m_check , "Flag to perform more checks" );
}

AlgContextSvc::~AlgContextSvc | ( |  | ) |
| virtual

Standard Destructor.

Definition at line 41 of file AlgContextSvc.cpp.

{}

AlgContextSvc::AlgContextSvc | ( |  | ) |
| private

no default constructor

AlgContextSvc::AlgContextSvc | ( | const AlgContextSvc & |  | ) |
| private

no copy constructor

## Member Function Documentation

virtual const IAlgContextSvc::Algorithms& AlgContextSvc::algorithms | ( |  | ) | const
| inline virtual

get the stack of executed algorithms

See Also
  IAlgContextSvc

Definition at line 37 of file AlgContextSvc.h.

{ return m_algorithms ; }

IAlgorithm * AlgContextSvc::currentAlg | ( |  | ) | const
| virtual

accessor to current algorithm:

See Also
  IAlgContextSvc

Definition at line 150 of file AlgContextSvc.cpp.

{ return m_algorithms.empty() ? 0 : m_algorithms.back() ; }

StatusCode AlgContextSvc::finalize | ( |  | ) |
| virtual

standard finalization of the service

See Also
  IService

Reimplemented from Service.

Definition at line 88 of file AlgContextSvc.cpp.

{
if ( !m_algorithms.empty() )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::WARNING
<< "Non-empty stack of algorithms #"
<< m_algorithms.size() << endmsg ;
}
// Incident Service
if ( 0 != m_inc )
{
m_inc -> removeListener ( this ) ;
m_inc -> release() ;
m_inc = 0 ;
}
// finalize the base class
return Service::finalize () ;
}

void AlgContextSvc::handle | ( | const Incident & |  | ) |
| virtual

handle incident

See Also
  IIncidentListener

Definition at line 155 of file AlgContextSvc.cpp.

{
if ( !m_algorithms.empty() )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::ERROR
<< "Non-empty stack of algorithms #"
<< m_algorithms.size() << endmsg ;
}
}

StatusCode AlgContextSvc::initialize | ( |  | ) |
| virtual

standard initialization of the service

See Also
  IService

Reimplemented from Service.

Definition at line 45 of file AlgContextSvc.cpp.

{
// Initialize the base class
StatusCode sc = Service::initialize () ;
if ( sc.isFailure () ) { return sc ; }
// Incident Service
if ( 0 != m_inc )
{
m_inc -> removeListener ( this ) ;
m_inc -> release() ;
m_inc = 0 ;
}
// perform more checks?
if ( m_check )
{
sc = Service::service ( "IncidentSvc" , m_inc , true ) ;
if ( sc.isFailure() )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::ERROR << "Could not locate 'IncidentSvc'" << sc << endmsg ;
return sc ; // RETURN
}
if ( 0 == m_inc )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::ERROR << "Invalid pointer to IIncindentSvc" << endmsg ;
return StatusCode::FAILURE ; // RETURN
}
m_inc -> addListener ( this , IncidentType::BeginEvent ) ;
m_inc -> addListener ( this , IncidentType::EndEvent ) ;
}
if ( !m_algorithms.empty() )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::WARNING
<< "Non-empty stack of algorithms #"
<< m_algorithms.size() << endmsg ;
}
return StatusCode::SUCCESS ;
}

AlgContextSvc& AlgContextSvc::operator= | ( | const AlgContextSvc & |  | ) |
| private

no assignment

StatusCode AlgContextSvc::setCurrentAlg | ( | IAlgorithm * | a | ) |
| virtual

set the currently executing algorithm ("push_back")

See Also
  IAlgContextSvc

Definition at line 110 of file AlgContextSvc.cpp.

{
if ( 0 == a )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::WARNING << "IAlgorithm* points to NULL" << endmsg ;
//
return StatusCode::RECOVERABLE ; // RETURN
}
m_algorithms.push_back ( a ) ;
//
return StatusCode::SUCCESS ; // RETURN
}

StatusCode AlgContextSvc::unSetCurrentAlg | ( | IAlgorithm * | a | ) |
| virtual

remove the algorithm ("pop_back")

See Also
  IAlgContextSvc

Definition at line 126 of file AlgContextSvc.cpp.

{
if ( 0 == a )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::WARNING << "IAlgorithm* points to NULL" << endmsg ;
//
return StatusCode::RECOVERABLE ; // RETURN
}
if ( m_algorithms.empty() || m_algorithms.back() != a )
{
MsgStream log ( msgSvc() , name() ) ;
log << MSG::ERROR << "Algorithm stack is invalid" << endmsg ;
//
return StatusCode::FAILURE ;
}
//
m_algorithms.pop_back() ; // POP_BACK
//
return StatusCode::SUCCESS ;
}

## Member Data Documentation

IAlgContextSvc::Algorithms AlgContextSvc::m_algorithms
| private

the stack of current algorithms

Definition at line 63 of file AlgContextSvc.h.

bool AlgContextSvc::m_check
| private

Definition at line 67 of file AlgContextSvc.h.

IIncidentSvc* AlgContextSvc::m_inc
| private

pointer to Incident Service

Definition at line 65 of file AlgContextSvc.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/AlgContextSvc.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/AlgContextSvc.cpp