The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
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
const std::set< IAlgorithm * > & condAlgs () const override
 get list of all registered condition Algorithms
bool isRegistered (IAlgorithm *alg) const override
 query if a specific Algorithm is a registered condition Algorithm
bool isRegistered (const DataObjID &id) const override
 query if a condition Object ID is registered
const DataObjIDColl & conditionIDs () const override
 get collection of all registered condition Object IDs
void dump (std::ostream &) const override
 dump the condition store
StatusCode validRanges (std::vector< EventIDRange > &, const DataObjID &) const override
 retrieve all valid ranges for one Object ID
ConditionSlotFuture * startConditionSetup (const EventContext &) override
 Asynchronously setup conditions.
StatusCode registerConditionIOSvc (IConditionIOSvc *) override
 register an IConditionIOSvc (alternative to Algorithm processing of Conditions)
Public Member Functions inherited from extends< Service, ICondSvc >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
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.
StatusCode sysStart () override
 Initialize Service.
StatusCode sysStop () override
 Initialize Service.
StatusCode sysFinalize () override
 Finalize Service.
StatusCode sysReinitialize () override
 Re-initialize the Service.
StatusCode sysRestart () override
 Re-initialize the Service.
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
template<class T>
Gaudi::Details::PropertyBase * declareProperty (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, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
template<class T>
Gaudi::Details::PropertyBase * declareProperty (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.
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 PropertyHolder ()=default
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
Gaudi::Details::PropertyBase * declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
Gaudi::Details::PropertyBase * property (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
PropertyHolder & operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
MsgStream & msgStream () const
 Return an uninitialized MsgStream.
MsgStream & msgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
MsgStream & always () const
 shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & fatal () const
 shortcut for the method msgStream(MSG::FATAL)
MsgStream & err () const
 shortcut for the method msgStream(MSG::ERROR)
MsgStream & error () const
 shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning () const
 shortcut for the method msgStream(MSG::WARNING)
MsgStream & info () const
 shortcut for the method msgStream(MSG::INFO)
MsgStream & debug () const
 shortcut for the method msgStream(MSG::DEBUG)
MsgStream & verbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
MsgStream & msg () const
 shortcut for the method msgStream(MSG::INFO)
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream

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< IAlgResourcePool > m_algResourcePool

Additional Inherited Members

Public Types inherited from extends< Service, ICondSvc >
using base_class
 Typedef to this class.
using extend_interfaces_base
 Typedef to the base of this class.
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
 Typedef used to refer to this class from derived classes, as in.
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 ~Service () override
int outputLevel () const
 get the Service's output level
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const override final
 Set up local caches.
MSG::Level resetMessaging ()
 Reinitialize internal states.
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
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< IAuditorSvc > m_pAuditorSvc
 Auditor Service.

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; };
std::set< IAlgorithm * > m_condAlgs
Definition CondSvc.h:65

◆ 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
31 }
SmartIF< IAlgResourcePool > m_algResourcePool
Definition CondSvc.h:71
Gaudi::Property< std::vector< std::string > > m_algNames
Definition CondSvc.h:66
Gaudi::Property< std::vector< std::string > > m_dataNames
Definition CondSvc.h:69
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333
constexpr static const auto SUCCESS
Definition StatusCode.h:99

◆ 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 {
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.

66{ this, "Algs", {}, "Names of conditions algorithms" };

◆ 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.

69{ this, "Data", {}, "Names of conditions data" };

The documentation for this class was generated from the following files:
  • GaudiTestSuite/include/Gaudi/TestSuite/Conditions/CondSvc.h
  • GaudiTestSuite/src/ConditionAccessor/CondSvc.cpp