20 template <
typename FUN>
54 return Status::NO_INTERFACE;
122 return jos->setMyProperties(
name(),
this );
136 if (
Algorithm* _alg = dynamic_cast<Algorithm*>( _p ) ) {
138 }
else if (
Service* _svc = dynamic_cast<Service*>( _p ) ) {
140 }
else if (
AlgTool* _too = dynamic_cast<AlgTool*>( _p ) ) {
142 }
else if (
Auditor* _aud = dynamic_cast<Auditor*>( _p ) ) {
145 throw GaudiException(
"Failure to create tool '" + type +
"/" + name +
"': illegal parent type '" +
153 if ( pprop && pprop->
hasProperty(
"OutputLevel" ) ) {
181 return attempt( *
this,
"sysInitialize", [&]() {
187 if ( !sc )
return sc;
199 error() <<
"Explicit circular data dependency detected for id " << key <<
endmsg;
200 return CircularDepAction::Abort;
202 if ( !sc )
return sc;
205 for (
auto i_tool :
tools() ) {
206 auto tool =
dynamic_cast<AlgTool*
>( i_tool );
235 m_toolsAwaitingInit.clear();
254 return attempt( *
this,
"sysStart", [&]() {
277 return attempt( *
this,
"sysStop", [&]() {
300 return attempt( *
this,
"sysFinalize", [&]() {
325 error() <<
"sysReinitialize(): cannot reinitialize tool not initialized" <<
endmsg;
329 return attempt( *
this,
"SysReinitialize()", [&]() {
367 error() <<
"sysRestart(): cannot reinitialize tool not started" <<
endmsg;
371 return attempt( *
this,
"sysRestart", [&]() {
387 error() <<
"restart(): cannot be stopped" <<
endmsg;
392 error() <<
"restart(): cannot be started" <<
endmsg;
412 if ( !thArr->retrieved() ) {
414 debug() <<
"ToolHandleArray " << thArr->propertyName() <<
" not used: not registering any of its Tools" 418 debug() <<
"Registering all Tools in ToolHandleArray " << thArr->propertyName() <<
endmsg;
420 for (
auto toolHandle : thArr->getBaseArray() ) {
427 debug() <<
"Adding " << ( bth->
isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->
name()
428 <<
" (" << tool->
type() <<
") from ToolHandleArray " << thArr->propertyName() <<
endmsg;
434 if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool,
this, false ).isSuccess() ) {
436 debug() <<
"Adding private" 437 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 438 << thArr->propertyName() <<
endmsg;
441 }
else if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool, 0, false ).isSuccess() ) {
443 debug() <<
"Adding public" 444 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 445 << thArr->propertyName() <<
endmsg;
449 warning() <<
"Error retrieving Tool " << toolHandle->typeAndName() <<
" in ToolHandleArray " 450 << thArr->propertyName() <<
". Not registered" <<
endmsg;
458 if ( !th->isEnabled() ) {
460 debug() <<
"ToolHandle " << th->typeAndName() <<
" not used" <<
endmsg;
464 auto sc = th->retrieve();
471 debug() <<
"Adding " << ( th->isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->name() <<
" (" 472 << tool->type() <<
")" <<
endmsg;
480 if ( tool ==
this )
return;
511 return helper.
getService( svcName, createIf, iid, ppSvc );
525 return helper.
service( name, quiet, createIf );
constexpr static const auto FAILURE
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.
void initializeDataHandleHolder()
Initialize the DataHandles.
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.
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.
void updateDataDependencies(const DataObjIDMapping &keyMap)
Update the key of each registered data dependency, using a user-defined mapping from the old to the n...
TYPE * get() const
Get interface pointer.
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)
CircularDepAction
A circular dependency handling action.
This class is used for returning status codes from appropriate routines.
void collectImplicitDataDependencies(const IDataHandleHolder *child)
Add the dependencies of another DataHandleHolder to our dependency list.
Definition of the basic interface.
virtual const std::string & tag() const
name tag for the exception, or exception type
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
constexpr static const auto SUCCESS
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)
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...
StatusCode handleCircularDataDependencies(CircularDepHandler &&circularDepHandler)
Look for circular dependencies and let a user-specified handler deal with each of them...
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
void collectExplicitDataDependencies()
Collect all explicit data dependencies in a single place.
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.
StatusCode createService(const std::string &name, const InterfaceID &iid, void **ppSvc) const
Base class from which all concrete auditor classes should be derived.
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)