21 template <
typename FUN>
55 return Status::NO_INTERFACE;
123 return jos->setMyProperties(
name(),
this );
137 if (
Algorithm* _alg = dynamic_cast<Algorithm*>( _p ) ) {
139 }
else if (
Service* _svc = dynamic_cast<Service*>( _p ) ) {
141 }
else if (
AlgTool* _too = dynamic_cast<AlgTool*>( _p ) ) {
143 }
else if (
Auditor* _aud = dynamic_cast<Auditor*>( _p ) ) {
146 throw GaudiException(
"Failure to create tool '" + type +
"/" + name +
"': illegal parent type '" +
154 if ( pprop && pprop->
hasProperty(
"OutputLevel" ) ) {
182 return attempt( *
this,
"sysInitialize", [&]() {
188 if ( !sc )
return sc;
196 if ( !h->objKey().empty() ) out.
emplace( h->fullKey() );
199 if ( !h->objKey().empty() && out.find( h->fullKey() ) != out.end() ) {
200 error() <<
"Explicit circular data dependency found for id " << h->fullKey() <<
endmsg;
205 if ( !sc )
return sc;
231 return attempt( *
this,
"sysStart", [&]() {
254 return attempt( *
this,
"sysStop", [&]() {
277 return attempt( *
this,
"sysFinalize", [&]() {
302 error() <<
"sysReinitialize(): cannot reinitialize tool not initialized" <<
endmsg;
306 return attempt( *
this,
"SysReinitialize()", [&]() {
344 error() <<
"sysRestart(): cannot reinitialize tool not started" <<
endmsg;
348 return attempt( *
this,
"sysRestart", [&]() {
364 error() <<
"restart(): cannot be stopped" <<
endmsg;
369 error() <<
"restart(): cannot be started" <<
endmsg;
389 if ( !thArr->retrieved() ) {
391 debug() <<
"ToolHandleArray " << thArr->propertyName() <<
" not used: not registering any of its Tools" 395 debug() <<
"Registering all Tools in ToolHandleArray " << thArr->propertyName() <<
endmsg;
397 for (
auto toolHandle : thArr->getBaseArray() ) {
404 debug() <<
"Adding " << ( bth->
isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->
name()
405 <<
" (" << tool->
type() <<
") from ToolHandleArray " << thArr->propertyName() <<
endmsg;
411 if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool,
this, false ).isSuccess() ) {
413 debug() <<
"Adding private" 414 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 415 << thArr->propertyName() <<
endmsg;
418 }
else if (
toolSvc()->retrieveTool( toolHandle->typeAndName(), tool, 0, false ).isSuccess() ) {
420 debug() <<
"Adding public" 421 <<
" ToolHandle tool " << tool->
name() <<
" (" << tool->
type() <<
") from ToolHandleArray " 422 << thArr->propertyName() <<
endmsg;
426 warning() <<
"Error retrieving Tool " << toolHandle->typeAndName() <<
" in ToolHandleArray " 427 << thArr->propertyName() <<
". Not registered" <<
endmsg;
435 if ( !th->isEnabled() ) {
437 debug() <<
"ToolHandle " << th->typeAndName() <<
" not used" <<
endmsg;
441 auto sc = th->retrieve();
448 debug() <<
"Adding " << ( th->isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->name() <<
" (" 449 << tool->type() <<
")" <<
endmsg;
474 return helper.
getService( svcName, createIf, iid, ppSvc );
488 return helper.
service( name, quiet, createIf );
510 for (
auto tool :
tools() ) vis->
visit( dynamic_cast<AlgTool*>( tool ) );
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.
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.
void initDataHandleHolder()
initializes all handles - called by the sysInitialize method of any descendant of this ...
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
Data provider interface definition.
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)
DataObjIDColl m_inputDataObjs
std::vector< Gaudi::DataHandle * > outputHandles() const override
Main interface for the JobOptions service.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
std::vector< Gaudi::DataHandle * > inputHandles() const override
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...
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
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.
DataObjIDColl m_outputDataObjs
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)