58 #ifndef PACKAGE_VERSION 59 # define PACKAGE_VERSION "unknown" 91 PropertyHolder<CommonMessaging<implements<IAlgorithm, IDataHandleHolder, IProperty, IStateful>>>>> {
104 , m_version(
std::move( version ) )
105 , m_pSvcLocator( svcloc ) {}
171 unsigned int index()
const override;
196 bool isEnabled()
const override;
202 unsigned int errorCount()
const;
207 return service_i(
name, createIf, T::interfaceID(), (
void**)&psvc );
213 return service_i( svcType, svcName, T::interfaceID(), reinterpret_cast<void**>( &psvc ) );
217 SmartIF<IService> service( std::string_view
name,
const bool createIf =
true,
const bool quiet =
false )
const;
221 return service(
name, createIf, quiet ).as<T>();
308 using PropertyHolderImpl::declareProperty;
314 this->declareTool( hndl, hndl.
typeAndName() ).ignore();
315 return PropertyHolderImpl::declareProperty(
name, hndl, doc );
324 addToolsArray( hndlArr );
325 return PropertyHolderImpl::declareProperty(
name, hndlArr, doc );
340 if ( !m_pMonitorSvc ) {
341 m_pMonitorSvc = service( m_monitorSvcName,
false,
true );
343 return m_pMonitorSvc;
373 void registerTool(
IAlgTool* tool )
const;
374 void deregisterTool(
IAlgTool* tool )
const;
378 return this->declareTool( handle, handle.
typeAndName(), createIf );
387 " tool " + toolTypeAndName,
391 m_toolHandles.push_back( &handle );
398 m_toolHandleArrays.push_back( &hndlArr );
416 void initToolHandles()
const;
423 unsigned int cardinality()
const override {
return m_cardinality; }
435 void setIndex(
const unsigned int& idx )
override;
454 unsigned int m_index = 0;
462 template <
typename IFace>
501 "[[deprecated]] unused"};
503 "trigger auditor on initialize()"};
505 "trigger auditor on reinitialize()"};
509 "trigger auditor on finalize()"};
516 "name to use for Monitor Service"};
519 "flag to enforce the registration for Algorithm Context Service"};
521 Gaudi::Property<int> m_cardinality{
this,
"Cardinality", 0,
"how many clones to create - 0 means algo is reentrant"};
523 this,
"NeededResources", {},
"named resources needed during event looping"};
526 this,
"Blocking",
false,
527 "if algorithm invokes CPU-blocking system calls (offloads computations to accelerators or " 528 "quantum processors, performs disk or network I/O, is bound by resource synchronization, etc)"};
532 "filter out circular data dependencies"};
534 mutable bool m_toolHandlesInit =
false;
541 StatusCode service_i( std::string_view svcName,
bool createIf,
const InterfaceID& iid,
void** ppSvc )
const;
543 void** ppSvc )
const;
StatusCode declareTool(ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
void setBlocking(bool value)
void addToolsArray(ToolHandleArray< T > &hndlArr)
constexpr auto size(const T &, Args &&...) noexcept
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
SmartIF< T > service(std::string_view name, bool createIf=true, bool quiet=false) const
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(...)".
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
Implementation of property with value of concrete type.
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
StatusCode service(std::string_view svcType, std::string_view svcName, T *&psvc) const
Access a service by name and type, creating it if it doesn't already exist.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
void declareInfo(const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
Declare monitoring information (special case)
constexpr static const auto SUCCESS
bool isReEntrant() const override
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
void declareInfo(const std::string &name, const T &var, const std::string &desc) const
Declare monitoring information.
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
This class represents an entry point to all the event specific data.
The helper class to represent the efficient "key" for access.
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
std::string m_version
Algorithm's version.
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
bool getDefaultAuditorValue(ISvcLocator *loc)
SmartIF< IConversionSvc > m_ECS
Event conversion service.
This class is used for returning status codes from appropriate routines.
StatusCode service(std::string_view name, T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
const ValueType & value() const
Backward compatibility (.
const std::string & type() const override
The type of the algorithm object.
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
SmartIF< IMessageSvc > m_MS
Message service.
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
StatusCode terminate() override
Dummy implementation of IStateful::terminate() method.
Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> Factory
std::vector< IAlgTool * > m_tools
SmartIF< IConversionSvc > m_DCS
Detector conversion service.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
bool registerContext() const
register for Algorithm Context Service?
The IAlgorithm is the interface implemented by the Algorithm base class.
const std::vector< std::string > & neededResources() const override
SmartIF< INTupleSvc > m_NTS
N tuple service.
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
bool isInitialized() const override
Has the Algorithm already been initialized?
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
std::string m_type
Algorithm's type.
unsigned int maxErrors() const
Base class from which all concrete algorithm classes should be derived.
SmartIF< ISvcLocator > & svcLoc() const
shortcut for method serviceLocator
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
bool isSequence() const override
Are we a Sequence?
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
Gaudi::StringKey m_name
Algorithm's name for identification.
bool isFinalized() const override
Has the Algorithm already been finalized?
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
bool m_isFinalized
Algorithm has been finalized flag.
unsigned int cardinality() const override
Return the cardinality.
StatusCode configure() override
Dummy implementation of IStateful::configure() method.
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
std::vector< BaseToolHandle * > m_toolHandles
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Gaudi::StateMachine::State targetFSMState() const override
returns the state the algorithm will be in after the ongoing transition
Header file for std:chrono::duration-based Counters.
void setType(std::string type) override