The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CondSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2020 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::Examples::Conditions
Gaudi::Examples::Conditions::CondSvc::validRanges
StatusCode validRanges(std::vector< EventIDRange > &, const DataObjID &) const override
retrieve all valid ranges for one Object ID
Definition: CondSvc.h:53
IAlgResourcePool.h
Gaudi::Examples::Conditions::CondSvc::conditionIDs
const DataObjIDColl & conditionIDs() const override
get collection of all registered condition Object IDs
Definition: CondSvc.h:47
Gaudi::Examples::Conditions::CondSvc::m_condAlgs
std::set< IAlgorithm * > m_condAlgs
Definition: CondSvc.h:65
std::unordered_set< DataObjID, DataObjID_Hasher >
Gaudi::Examples::Conditions::CondSvc::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Definition: CondSvc.h:71
std::vector
STL class.
std::set::find
T find(T... args)
Gaudi::DataHandle
Definition: DataHandle.h:38
Gaudi::Examples::Conditions::CondSvc::m_condData
DataObjIDColl m_condData
Definition: CondSvc.h:68
basic.alg
alg
Definition: basic.py:15
Gaudi::Examples::Conditions::CondSvc::initialize
StatusCode initialize() override
Definition: CondSvc.cpp:16
SmartIF.h
Gaudi::Examples::Conditions::CondSvc::registerConditionIOSvc
StatusCode registerConditionIOSvc(IConditionIOSvc *) override
register an IConditionIOSvc (alternative to Algorithm processing of Conditions)
Definition: CondSvc.h:62
StatusCode
Definition: StatusCode.h:65
Gaudi::Examples::Conditions::CondSvc::isRegistered
bool isRegistered(const DataObjID &id) const override
query if a condition Object ID is registered
Definition: CondSvc.h:44
Gaudi::Examples::Conditions::CondSvc::startConditionSetup
ConditionSlotFuture * startConditionSetup(const EventContext &) override
Asynchronously setup conditions.
Definition: CondSvc.h:58
IAlgorithm
Definition: IAlgorithm.h:38
std::ostream
STL class.
Gaudi::Examples::Conditions::CondSvc
Implementation of ICondSvc used for testing Allows declaration of one or more algorithms or data obje...
Definition: CondSvc.h:25
Gaudi::Examples::Conditions
Definition: ConditionAccessorHolder.h:21
SmartIF< IAlgResourcePool >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
DataObjID
Definition: DataObjID.h:47
Service.h
Gaudi::Examples::Conditions::CondSvc::regHandle
StatusCode regHandle(IAlgorithm *, const Gaudi::DataHandle &) override
Definition: CondSvc.h:32
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Examples::Conditions::CondSvc::m_dataNames
Gaudi::Property< std::vector< std::string > > m_dataNames
Definition: CondSvc.h:69
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
Gaudi::Examples::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
EventContext
Definition: EventContext.h:34
Gaudi::Examples::Conditions::CondSvc::isRegistered
bool isRegistered(IAlgorithm *alg) const override
query if a specific Algorithm is a registered condition Algorithm
Definition: CondSvc.h:41
Gaudi::Examples::Conditions::CondSvc::m_algNames
Gaudi::Property< std::vector< std::string > > m_algNames
Definition: CondSvc.h:66
std::set::end
T end(T... args)
Gaudi::Examples::Conditions::CondSvc::dump
void dump(std::ostream &) const override
dump the condition store
Definition: CondSvc.h:50
Gaudi::Examples::Conditions::CondSvc::condAlgs
const std::set< IAlgorithm * > & condAlgs() const override
get list of all registered condition Algorithms
Definition: CondSvc.h:38
std::set< IAlgorithm * >
ICondSvc.h
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:39
Property.h