22 template <
typename FUN>
130 if ( jos->setMyProperties(
name(),
this ).isFailure() ) {
152 if ( pprop && pprop->
hasProperty(
"OutputLevel" ) ) {
159 if (
Algorithm* _alg = dynamic_cast<Algorithm*>( _p ) ) {
162 }
else if (
Service* _svc = dynamic_cast<Service*>( _p ) ) {
165 }
else if (
AlgTool* _too = dynamic_cast<AlgTool*>( _p ) ) {
168 }
else if (
Auditor* _aud = dynamic_cast<Auditor*>( _p ) ) {
172 throw GaudiException(
"Failure to create tool '" + type +
"/" + name +
"': illegal parent type '" +
205 return attempt( *
this,
"sysInitialize", [&]() {
211 if ( !sc )
return sc;
237 return attempt( *
this,
"sysStart", [&]() {
260 return attempt( *
this,
"sysStop", [&]() {
283 return attempt( *
this,
"sysFinalize", [&]() {
308 error() <<
"sysReinitialize(): cannot reinitialize tool not initialized" <<
endmsg;
312 return attempt( *
this,
"SysReinitialize()", [&]() {
350 error() <<
"sysRestart(): cannot reinitialize tool not started" <<
endmsg;
354 return attempt( *
this,
"sysRestart", [&]() {
370 error() <<
"restart(): cannot be stopped" <<
endmsg;
375 error() <<
"restart(): cannot be started" <<
endmsg;
395 if ( !thArr->retrieved() ) {
397 debug() <<
"ToolHandleArray " << thArr->propertyName() <<
" not used: not registering any of its Tools" 401 debug() <<
"Registering all Tools in ToolHandleArray " << thArr->propertyName() <<
endmsg;
403 for (
auto toolHandle : thArr->getBaseArray() ) {
410 debug() <<
"Adding " << ( bth->
isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->
name()
411 <<
" (" << tool->
type() <<
") from ToolHandleArray " << thArr->propertyName() <<
endmsg;
417 if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool,
this, false ).isSuccess() ) {
419 debug() <<
"Adding private" 420 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 421 << thArr->propertyName() <<
endmsg;
424 }
else if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool, 0, false ).isSuccess() ) {
426 debug() <<
"Adding public" 427 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 428 << thArr->propertyName() <<
endmsg;
432 warning() <<
"Error retrieving Tool " << toolHandle->typeAndName() <<
" in ToolHandleArray " 433 << thArr->propertyName() <<
". Not registered" <<
endmsg;
445 debug() <<
"Adding " << ( th->isPublic() ?
"Public" :
"Private" ) <<
" ToolHandle tool " << tool->
name() <<
" (" 473 return helper.
getService( svcName, createIf, iid, ppSvc );
487 return helper.
service( name, quiet, createIf );
509 for (
auto tool :
tools() ) {
Definition of the MsgStream class used to transmit messages.
an helper to share the implementation of service() among the various kernel base classes ...
Define general base for Gaudi exception.
Implementation of property with value of concrete type.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual bool hasProperty(const std::string &name) const =0
Return true if we have a property with the given name.
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
Data provider interface definition.
bool isFailure() const
Test for a status code of FAILURE.
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
TYPE * get() const
Get interface pointer.
virtual void visit(const IDataHandleHolder *)=0
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Main interface for the JobOptions service.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
virtual const std::string & tag() const
name tag for the exception, or exception type
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Base class from which all concrete algorithm classes should be derived.
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...
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
double fun(const std::vector< double > &x)
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool assign(const Details::PropertyBase &source) override
get the value from another property
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
The IProperty is the basic interface for all components which have properties that can be set or get...
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.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.
StatusCode getService(const std::string &name, bool createIf, const InterfaceID &iid, void **ppSvc) const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual const std::string & name() const =0
Retrieve the name of the instance.
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
StatusCode createService(const std::string &name, const InterfaceID &iid, void **ppSvc) const
Base class from which all concrete auditor classes should be derived.