|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
#include <AlgContextSvc.h>


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. | |
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 |
Friends | |
| class | SvcFactory< AlgContextSvc > |
| friend factory for instantiations | |
Definition at line 28 of file AlgContextSvc.h.
| 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.
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] |
| AlgContextSvc::AlgContextSvc | ( | ) | [private] |
no default constructor
| AlgContextSvc::AlgContextSvc | ( | const AlgContextSvc & | ) | [private] |
no copy constructor
| virtual const IAlgContextSvc::Algorithms& AlgContextSvc::algorithms | ( | ) | const [inline, virtual] |
get the stack of executed algorithms
Definition at line 41 of file AlgContextSvc.h.
{ return m_algorithms ; }
| IAlgorithm * AlgContextSvc::currentAlg | ( | ) | const [virtual] |
accessor to current algorithm:
Definition at line 152 of file AlgContextSvc.cpp.
{ return m_algorithms.empty() ? 0 : m_algorithms.back() ; }
| StatusCode AlgContextSvc::finalize | ( | void | ) | [virtual] |
standard finalization of the service
Reimplemented from Service.
Definition at line 90 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
Definition at line 157 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
Reimplemented from Service.
Definition at line 47 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")
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
}
m_algorithms.push_back ( a ) ;
//
return StatusCode::SUCCESS ; // RETURN
}
| StatusCode AlgContextSvc::unSetCurrentAlg | ( | IAlgorithm * | a ) | [virtual] |
remove the algorithm ("pop_back")
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 ;
//
return StatusCode::FAILURE ;
}
//
m_algorithms.pop_back() ; // POP_BACK
//
return StatusCode::SUCCESS ;
}
friend class SvcFactory< AlgContextSvc > [friend] |
friend factory for instantiations
Definition at line 32 of file AlgContextSvc.h.
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] |
Definition at line 69 of file AlgContextSvc.h.