The Gaudi Framework  master (594c33fa)
Gaudi::TestSuite::Conditions::CondSvc Class Reference

Implementation of ICondSvc used for testing Allows declaration of one or more algorithms or data objects as belonging to the "conditions realm" The scheduler will then treat them differently. More...

#include </builds/gaudi/Gaudi/GaudiTestSuite/include/Gaudi/TestSuite/Conditions/CondSvc.h>

Inheritance diagram for Gaudi::TestSuite::Conditions::CondSvc:
Collaboration diagram for Gaudi::TestSuite::Conditions::CondSvc:

Public Member Functions

StatusCode initialize () override
 
StatusCode regHandle (IAlgorithm *, const Gaudi::DataHandle &) override
 
bool isValidID (const EventContext &, const DataObjID &) const override
 check to see if a specific condition object ID is valid for this event More...
 
const std::set< IAlgorithm * > & condAlgs () const override
 get list of all registered condition Algorithms More...
 
bool isRegistered (IAlgorithm *alg) const override
 query if a specific Algorithm is a registered condition Algorithm More...
 
bool isRegistered (const DataObjID &id) const override
 query if a condition Object ID is registered More...
 
const DataObjIDCollconditionIDs () const override
 get collection of all registered condition Object IDs More...
 
void dump (std::ostream &) const override
 dump the condition store More...
 
StatusCode validRanges (std::vector< EventIDRange > &, const DataObjID &) const override
 retrieve all valid ranges for one Object ID More...
 
ConditionSlotFuture * startConditionSetup (const EventContext &) override
 Asynchronously setup conditions. More...
 
StatusCode registerConditionIOSvc (IConditionIOSvc *) override
 register an IConditionIOSvc (alternative to Algorithm processing of Conditions) More...
 
- Public Member Functions inherited from extends< Service, ICondSvc >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from Service
const std::stringname () const override
 Retrieve name of the service
More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service
More...
 
StatusCode sysStart () override
 Initialize Service
More...
 
StatusCode sysStop () override
 Initialize Service
More...
 
StatusCode sysFinalize () override
 Finalize Service
More...
 
StatusCode sysReinitialize () override
 Re-initialize the Service. More...
 
StatusCode sysRestart () override
 Re-initialize the Service. More...
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor
More...
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator
More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Private Attributes

std::set< IAlgorithm * > m_condAlgs
 
Gaudi::Property< std::vector< std::string > > m_algNames { this, "Algs", {}, "Names of conditions algorithms" }
 
DataObjIDColl m_condData
 
Gaudi::Property< std::vector< std::string > > m_dataNames { this, "Data", {}, "Names of conditions data" }
 
SmartIF< IAlgResourcePoolm_algResourcePool
 

Additional Inherited Members

- Public Types inherited from extends< Service, ICondSvc >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 Standard Destructor
More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state
More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state
More...
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
Gaudi::Property< bool > m_auditInit { this, "AuditServices", false, "[[deprecated]] unused" }
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service
More...
 

Detailed Description

Implementation of ICondSvc used for testing Allows declaration of one or more algorithms or data objects as belonging to the "conditions realm" The scheduler will then treat them differently.

Definition at line 25 of file CondSvc.h.

Member Function Documentation

◆ condAlgs()

const std::set<IAlgorithm*>& Gaudi::TestSuite::Conditions::CondSvc::condAlgs ( ) const
inlineoverride

get list of all registered condition Algorithms

Definition at line 38 of file CondSvc.h.

38 { return m_condAlgs; };

◆ conditionIDs()

const DataObjIDColl& Gaudi::TestSuite::Conditions::CondSvc::conditionIDs ( ) const
inlineoverride

get collection of all registered condition Object IDs

Definition at line 47 of file CondSvc.h.

47 { return m_condData; }

◆ dump()

void Gaudi::TestSuite::Conditions::CondSvc::dump ( std::ostream ) const
inlineoverride

dump the condition store

Definition at line 50 of file CondSvc.h.

50 {};

◆ initialize()

StatusCode Gaudi::TestSuite::Conditions::CondSvc::initialize ( )
override

Definition at line 16 of file CondSvc.cpp.

16  {
17 
18  // Convert alg names vector to a set for easier search
19  std::set<std::string> algNameSet( m_algNames.begin(), m_algNames.end() );
20 
21  // Get conditions alg pointers
22  m_algResourcePool = serviceLocator()->service( "AlgResourcePool" );
23  for ( auto& alg : m_algResourcePool->getFlatAlgList() ) {
24  if ( algNameSet.find( alg->name() ) != algNameSet.end() ) { m_condAlgs.insert( alg ); }
25  }
26 
27  // Get conditions data ids
28  for ( auto& name : m_dataNames ) { m_condData.insert( DataObjID( name ) ); }
29 
30  return StatusCode::SUCCESS;
31  }

◆ isRegistered() [1/2]

bool Gaudi::TestSuite::Conditions::CondSvc::isRegistered ( const DataObjID id) const
inlineoverride

query if a condition Object ID is registered

Definition at line 44 of file CondSvc.h.

44 { return ( m_condData.find( id ) != m_condData.end() ); };

◆ isRegistered() [2/2]

bool Gaudi::TestSuite::Conditions::CondSvc::isRegistered ( IAlgorithm alg) const
inlineoverride

query if a specific Algorithm is a registered condition Algorithm

Definition at line 41 of file CondSvc.h.

41 { return ( m_condAlgs.find( alg ) != m_condAlgs.end() ); };

◆ isValidID()

bool Gaudi::TestSuite::Conditions::CondSvc::isValidID ( const EventContext ,
const DataObjID  
) const
inlineoverride

check to see if a specific condition object ID is valid for this event

Definition at line 35 of file CondSvc.h.

35 { return false; };

◆ regHandle()

StatusCode Gaudi::TestSuite::Conditions::CondSvc::regHandle ( IAlgorithm ,
const Gaudi::DataHandle  
)
inlineoverride

Definition at line 32 of file CondSvc.h.

32 { return StatusCode::SUCCESS; };

◆ registerConditionIOSvc()

StatusCode Gaudi::TestSuite::Conditions::CondSvc::registerConditionIOSvc ( IConditionIOSvc *  )
inlineoverride

register an IConditionIOSvc (alternative to Algorithm processing of Conditions)

Definition at line 62 of file CondSvc.h.

62 { return StatusCode::SUCCESS; }

◆ startConditionSetup()

ConditionSlotFuture* Gaudi::TestSuite::Conditions::CondSvc::startConditionSetup ( const EventContext )
inlineoverride

Asynchronously setup conditions.

Definition at line 58 of file CondSvc.h.

58 { return nullptr; };

◆ validRanges()

StatusCode Gaudi::TestSuite::Conditions::CondSvc::validRanges ( std::vector< EventIDRange > &  ,
const DataObjID  
) const
inlineoverride

retrieve all valid ranges for one Object ID

Definition at line 53 of file CondSvc.h.

53  {
54  return StatusCode::SUCCESS;
55  };

Member Data Documentation

◆ m_algNames

Gaudi::Property<std::vector<std::string> > Gaudi::TestSuite::Conditions::CondSvc::m_algNames { this, "Algs", {}, "Names of conditions algorithms" }
private

Definition at line 66 of file CondSvc.h.

◆ m_algResourcePool

SmartIF<IAlgResourcePool> Gaudi::TestSuite::Conditions::CondSvc::m_algResourcePool
private

Definition at line 71 of file CondSvc.h.

◆ m_condAlgs

std::set<IAlgorithm*> Gaudi::TestSuite::Conditions::CondSvc::m_condAlgs
private

Definition at line 65 of file CondSvc.h.

◆ m_condData

DataObjIDColl Gaudi::TestSuite::Conditions::CondSvc::m_condData
private

Definition at line 68 of file CondSvc.h.

◆ m_dataNames

Gaudi::Property<std::vector<std::string> > Gaudi::TestSuite::Conditions::CondSvc::m_dataNames { this, "Data", {}, "Names of conditions data" }
private

Definition at line 69 of file CondSvc.h.


The documentation for this class was generated from the following files:
std::unordered_set::find
T find(T... args)
Gaudi::TestSuite::Conditions::CondSvc::m_dataNames
Gaudi::Property< std::vector< std::string > > m_dataNames
Definition: CondSvc.h:69
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
Gaudi::TestSuite::Conditions::CondSvc::m_condAlgs
std::set< IAlgorithm * > m_condAlgs
Definition: CondSvc.h:65
Gaudi::TestSuite::Conditions::CondSvc::m_condData
DataObjIDColl m_condData
Definition: CondSvc.h:68
Gaudi::TestSuite::Conditions::CondSvc::m_algNames
Gaudi::Property< std::vector< std::string > > m_algNames
Definition: CondSvc.h:66
DataObjID
Definition: DataObjID.h:47
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::TestSuite::Conditions::CondSvc::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Definition: CondSvc.h:71
std::set::insert
T insert(T... args)
std::unordered_set::end
T end(T... args)
std::set< std::string >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:335