1 #ifndef GAUDIKERNEL_ALGTOOL_H
2 #define GAUDIKERNEL_ALGTOOL_H
61 const std::string&
name()
const override;
64 const std::string&
type()
const override;
153 template <
class TYPE>
166 const std::string& name,
195 (
const std::string& name, T*& svc,
bool createIf =
true )
const {
196 return service_i(name, createIf, T::interfaceID(), (
void**)&svc);
203 return service_i(type, name, T::interfaceID(), (
void**)&svc);
207 SmartIF<IService> service(
const std::string& name,
const bool createIf =
true,
const bool quiet =
false)
const;
209 template <
typename T>
210 SmartIF<T> service(
const std::string& name,
const bool createIf =
true,
const bool quiet =
false)
const
211 {
return SmartIF<T>( service(name,createIf,quiet) ); }
214 template <
typename I>
249 (
const std::string& name ,
251 const std::string& doc =
"none" )
const
253 return m_propertyMgr -> declareProperty ( name , property , doc ) ;
257 (
const std::string& name ,
259 const std::string& rname =
"" )
const
261 return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
268 const std::string& doc =
"none" )
const {
273 return m_propertyMgr->declareProperty(name, hndl, doc);
279 std::string toolTypeAndName =
"",
280 bool createIf =
true) {
282 return declarePublicTool(handle, toolTypeAndName, createIf);
284 return declarePrivateTool(handle, toolTypeAndName, createIf);
293 const std::string& doc =
"none" )
const {
294 m_toolHandleArrays.push_back( &hndlArr );
295 return m_propertyMgr->declareProperty(name, hndlArr, doc);
300 m_inputHandles.push_back(im);
304 m_outputHandles.push_back(im);
309 return m_inputHandles; }
311 return m_outputHandles; }
314 return m_extInputDataObjs;
317 return m_extOutputDataObjs;
326 void commitHandles()
override;
342 m_tools.push_back(tool);
346 auto it =
std::find(m_tools.begin(), m_tools.end(), tool);
347 if (it != m_tools.end()) {
366 std::string toolTypeAndName =
"",
367 bool createIf =
true) {
369 if (toolTypeAndName ==
"")
374 throw GaudiException{
"Cannot create handle for public tool " + toolTypeAndName,
378 m_toolHandles.push_back(&handle);
392 std::string toolTypeAndName =
"",
393 bool createIf =
true) {
395 if (toolTypeAndName ==
"")
400 throw GaudiException{
"Cannot create handle for private tool " + toolTypeAndName,
404 m_toolHandles.push_back(&handle);
420 void initToolHandles()
const;
440 if ( !m_pMonitorSvc ) m_pMonitorSvc = service(m_monitorSvcName,
false,
true);
441 return m_pMonitorSvc.get();
452 const std::string& desc )
const
466 const std::string&
format,
469 const std::string& desc )
const
472 if ( mS ) mS->
declareInfo(name, format, var, size, desc,
this);
499 mutable bool m_toolHandlesInit =
false;
502 StatusCode service_i(
const std::string& algName,
506 StatusCode service_i(
const std::string& svcType,
507 const std::string& svcName,
514 bool m_auditorInitialize =
false;
515 bool m_auditorStart =
false;
516 bool m_auditorStop =
false;
517 bool m_auditorFinalize =
false;
518 bool m_auditorReinitialize =
false;
519 bool m_auditorRestart =
false;
526 #ifndef GAUDI_NEW_PLUGIN_SERVICE
529 template <
typename S,
typename... Args>
531 return new T(std::forward<Args>(
args)...);
536 #define DECLARE_TOOL_FACTORY(x) \
537 DECLARE_FACTORY_WITH_CREATOR(x, ToolFactory< x >, AlgTool::Factory)
538 #define DECLARE_NAMESPACE_TOOL_FACTORY(n, x) \
539 DECLARE_TOOL_FACTORY(n::x)
544 #define DECLARE_TOOL_FACTORY(x) DECLARE_COMPONENT(x)
545 #define DECLARE_NAMESPACE_TOOL_FACTORY(n,x) DECLARE_COMPONENT(n::x)
550 #endif // GAUDIKERNEL_ALGTOOL_H
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
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 format(const char *,...)
MsgStream format utility "a la sprintf(...)".
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
Data provider interface definition.
const char *PyHelper() getProperty(IInterface *p, char *name)
Property manager helper class.
virtual const std::string & name() const =0
Retrieve the name of the instance.
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Property base class allowing Property* collections to be "homogeneous".
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Class wrapping the signature for a factory with any number of arguments.
The IProperty is the basic interface for all components which have properties that can be set or get...
The interface implemented by the IAuditorSvc base class.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.