The Gaudi Framework  master (37c0b60a)
CondSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 #include <Gaudi/Property.h>
15 #include <GaudiKernel/ICondSvc.h>
16 #include <GaudiKernel/Service.h>
17 #include <GaudiKernel/SmartIF.h>
18 
20 
25  class CondSvc : public extends<Service, ICondSvc> {
26 
27  public:
28  using extends::extends;
29 
30  StatusCode initialize() override;
31 
33 
35  bool isValidID( const EventContext&, const DataObjID& ) const override { return false; };
36 
38  const std::set<IAlgorithm*>& condAlgs() const override { return m_condAlgs; };
39 
41  bool isRegistered( IAlgorithm* alg ) const override { return ( m_condAlgs.find( alg ) != m_condAlgs.end() ); };
42 
44  bool isRegistered( const DataObjID& id ) const override { return ( m_condData.find( id ) != m_condData.end() ); };
45 
47  const DataObjIDColl& conditionIDs() const override { return m_condData; }
48 
50  void dump( std::ostream& ) const override{};
51 
54  return StatusCode::SUCCESS;
55  };
56 
58  ConditionSlotFuture* startConditionSetup( const EventContext& ) override { return nullptr; };
59 
62  StatusCode registerConditionIOSvc( IConditionIOSvc* ) override { return StatusCode::SUCCESS; }
63 
64  private:
66  Gaudi::Property<std::vector<std::string>> m_algNames{ this, "Algs", {}, "Names of conditions algorithms" };
67 
69  Gaudi::Property<std::vector<std::string>> m_dataNames{ this, "Data", {}, "Names of conditions data" };
70 
72  };
73 
75 } // namespace Gaudi::TestSuite::Conditions
IAlgResourcePool.h
std::unordered_set< DataObjID, DataObjID_Hasher >
Gaudi::TestSuite::Conditions::CondSvc::isValidID
bool isValidID(const EventContext &, const DataObjID &) const override
check to see if a specific condition object ID is valid for this event
Definition: CondSvc.h:35
std::vector
STL class.
std::set::find
T find(T... args)
Gaudi::TestSuite::Conditions::CondSvc::isRegistered
bool isRegistered(IAlgorithm *alg) const override
query if a specific Algorithm is a registered condition Algorithm
Definition: CondSvc.h:41
Gaudi::DataHandle
Definition: DataHandle.h:38
Gaudi::TestSuite::Conditions::CondSvc::m_dataNames
Gaudi::Property< std::vector< std::string > > m_dataNames
Definition: CondSvc.h:69
Gaudi::TestSuite::Conditions::CondSvc::registerConditionIOSvc
StatusCode registerConditionIOSvc(IConditionIOSvc *) override
register an IConditionIOSvc (alternative to Algorithm processing of Conditions)
Definition: CondSvc.h:62
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
SmartIF.h
Gaudi::TestSuite::Conditions::CondSvc::conditionIDs
const DataObjIDColl & conditionIDs() const override
get collection of all registered condition Object IDs
Definition: CondSvc.h:47
StatusCode
Definition: StatusCode.h:65
IAlgorithm
Definition: IAlgorithm.h:38
Gaudi::TestSuite::Conditions::CondSvc::regHandle
StatusCode regHandle(IAlgorithm *, const Gaudi::DataHandle &) override
Definition: CondSvc.h:32
std::ostream
STL class.
Gaudi::TestSuite::Conditions::CondSvc::isRegistered
bool isRegistered(const DataObjID &id) const override
query if a condition Object ID is registered
Definition: CondSvc.h:44
Gaudi::TestSuite::Conditions::CondSvc::m_condAlgs
std::set< IAlgorithm * > m_condAlgs
Definition: CondSvc.h:65
Gaudi::TestSuite::Conditions
Definition: ConditionAccessorHolder.h:21
SmartIF< IAlgResourcePool >
Gaudi::TestSuite::Conditions::CondSvc::condAlgs
const std::set< IAlgorithm * > & condAlgs() const override
get list of all registered condition Algorithms
Definition: CondSvc.h:38
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
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
DataObjID
Definition: DataObjID.h:47
Service.h
Gaudi::TestSuite::Conditions::CondSvc::startConditionSetup
ConditionSlotFuture * startConditionSetup(const EventContext &) override
Asynchronously setup conditions.
Definition: CondSvc.h:58
Gaudi::TestSuite::Conditions::CondSvc
Implementation of ICondSvc used for testing Allows declaration of one or more algorithms or data obje...
Definition: CondSvc.h:25
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
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
EventContext
Definition: EventContext.h:34
Gaudi::TestSuite::Conditions::CondSvc::initialize
StatusCode initialize() override
Definition: CondSvc.cpp:16
Gaudi::TestSuite::Conditions::CondSvc::dump
void dump(std::ostream &) const override
dump the condition store
Definition: CondSvc.h:50
std::set::end
T end(T... args)
Gaudi::TestSuite::Conditions::CondSvc::validRanges
StatusCode validRanges(std::vector< EventIDRange > &, const DataObjID &) const override
retrieve all valid ranges for one Object ID
Definition: CondSvc.h:53
std::set< IAlgorithm * >
ICondSvc.h
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:37
Property.h