Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
AlgContextSvc Class Reference

#include <AlgContextSvc.h>

Inheritance diagram for AlgContextSvc:
Inheritance graph
[legend]
Collaboration diagram for AlgContextSvc:
Collaboration graph
[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 IAlgorithmcurrentAlg () 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::stringgetInterfaceNames () 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::stringname () 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 PropertygetProperty (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 >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
 
PropertydeclareRemoteProperty (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.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () 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
 
AlgContextSvcoperator= (const AlgContextSvc &)
 no assignment
 

Private Attributes

IAlgContextSvc::Algorithms m_algorithms
 the stack of current algorithms
 
IIncidentSvcm_inc
 pointer to Incident Service
 
bool m_check
 

Friends

class SvcFactory< AlgContextSvc >
 friend factory for instantiations
 

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 28 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 31 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 43 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
inlinevirtual

get the stack of executed algorithms

See Also
IAlgContextSvc

Definition at line 41 of file AlgContextSvc.h.

{ return m_algorithms ; }
IAlgorithm * AlgContextSvc::currentAlg ( ) const
virtual

accessor to current algorithm:

See Also
IAlgContextSvc

Definition at line 152 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 90 of file AlgContextSvc.cpp.

{
if ( !m_algorithms.empty() )
{
MsgStream log ( msgSvc() , name() ) ;
<< "Non-empty stack of algorithms #"
}
// 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 157 of file AlgContextSvc.cpp.

{
if ( !m_algorithms.empty() )
{
MsgStream log ( msgSvc() , name() ) ;
<< "Non-empty stack of algorithms #"
}
}
StatusCode AlgContextSvc::initialize ( )
virtual

standard initialization of the service

See Also
IService

Reimplemented from Service.

Definition at line 47 of file AlgContextSvc.cpp.

{
// Initialize the base class
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() ) ;
<< "Non-empty stack of algorithms #"
}
}
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 112 of file AlgContextSvc.cpp.

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

remove the algorithm ("pop_back")

See Also
IAlgContextSvc

Definition at line 128 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 ;
//
}
//
m_algorithms.pop_back() ; // POP_BACK
//
}

Friends And Related Function Documentation

friend class SvcFactory< AlgContextSvc >
friend

friend factory for instantiations

Definition at line 32 of file AlgContextSvc.h.

Member Data Documentation

IAlgContextSvc::Algorithms AlgContextSvc::m_algorithms
private

the stack of current algorithms

Definition at line 67 of file AlgContextSvc.h.

bool AlgContextSvc::m_check
private

Definition at line 71 of file AlgContextSvc.h.

IIncidentSvc* AlgContextSvc::m_inc
private

pointer to Incident Service

Definition at line 69 of file AlgContextSvc.h.


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

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