2 #include "GaudiKernel/AlgTool.h"
3 #include "GaudiKernel/IMessageSvc.h"
4 #include "GaudiKernel/ISvcLocator.h"
5 #include "GaudiKernel/IJobOptionsSvc.h"
7 #include "GaudiKernel/Algorithm.h"
8 #include "GaudiKernel/Service.h"
9 #include "GaudiKernel/Auditor.h"
10 #include "GaudiKernel/System.h"
11 #include "GaudiKernel/GaudiException.h"
12 #include "GaudiKernel/ServiceLocatorHelper.h"
13 #include "GaudiKernel/ThreadGaudi.h"
14 #include "GaudiKernel/Guards.h"
28 for ( InterfaceList::iterator it = m_interfaceList.begin() ;
29 m_interfaceList.end() != it ; ++it )
31 if ( !it->first.versionMatch ( riid ) ) { continue ; }
123 return m_propertyMgr->getProperty(p);
136 return m_propertyMgr->getProperty(
n,v);
166 if(jos->setMyProperties(
name(),
this ).isFailure()) {
184 const std::string& name,
187 : m_outputLevel (
MSG::
NIL )
190 , m_parent ( parent )
194 , m_pMonitorSvc ( NULL )
196 , m_interfaceList ( )
198 , m_pAuditorSvc ( 0 )
199 , m_auditInit (
false )
200 , m_auditorInitialize(
false)
201 , m_auditorStart(
false)
202 , m_auditorStop(
false)
203 , m_auditorFinalize(
false)
204 , m_auditorReinitialize(
false)
205 , m_auditorRestart(
false)
222 if (
Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
228 else if (
Service* _svc = dynamic_cast<Service*> ( _p ) )
234 else if (
AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
240 else if (
Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
249 (
"Failure to create tool '"
250 + type +
"/" + name +
"': illegal parent type '"
257 if ( !
appMgr.isValid() ) {
258 throw GaudiException(
"Could not locate ApplicationMgr",
"AlgTool",0);
293 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
294 <<
" is caught " <<
endmsg;
297 catch(
const std::exception& Exception ) {
337 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
338 <<
" is caught " <<
endmsg;
341 catch(
const std::exception& Exception ) {
379 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
380 <<
" is caught " <<
endmsg;
383 catch(
const std::exception& Exception ) {
421 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
422 <<
" is caught " <<
endmsg;
425 catch(
const std::exception& Exception ) {
453 <<
"sysReinitialize(): cannot reinitialize tool not initialized"
468 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
469 <<
" is caught" <<
endmsg;
472 catch(
const std::exception& Exception ) {
518 <<
"sysRestart(): cannot reinitialize tool not started"
534 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
535 <<
" is caught" <<
endmsg;
538 catch(
const std::exception& Exception ) {
587 void** ppSvc)
const {
589 return helper.
getService(svcName, createIf, iid, ppSvc);
595 const std::string& svcName,
597 void** ppSvc)
const {
604 return helper.
service(name, quiet, createIf);
Definition of the MsgStream class used to transmit messages.
an helper to share the implementation of service() among the various kernel base classes $Id: ...
StatusCode setProperty(const Property &p)
set the property form another property
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
bool isSuccess() const
Test for a status code of SUCCESS.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Property manager helper class.
bool hasProperty(const std::string &name) const
Return true if we have a property with the given name.
bool isFailure() const
Test for a status code of FAILURE.
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
The IMessage is the interface implemented by the message service.
StatusCode getProperty(Property *p) const
get the property
virtual const std::string & tag() const
name tag for the exception, or exception type
const TYPE & value() const
explicit conversion
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
virtual bool assign(const Property &source)
get the value from another property
Base class from which all concrete algorithm classes should be derived.
const std::vector< Property * > & getProperties() const
get all properties
Property base class allowing Property* collections to be "homogeneous".
virtual unsigned long release()=0
Release Interface instance.
Print levels enumeration.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
The interface implemented by the IAuditorSvc base class.
Base class for all services.
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.
StatusCode getService(const std::string &name, bool createIf, const InterfaceID &iid, void **ppSvc) const
Helper functions to set/get the application return code.
StatusCode createService(const std::string &name, const InterfaceID &iid, void **ppSvc) const
Base class from which all concrete auditor classes should be derived.