ATLAS Offline Software
Loading...
Searching...
No Matches
IOVSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef IOVSVC_IOVSVC_H
6#define IOVSVC_IOVSVC_H
7
8/*****************************************************************************
9 *
10 * IOVSvc.h
11 * IOVSvc
12 *
13 * Author: Charles Leggett
14 *
15 * Provides automatic updating and callbacks for time dependent data
16 *
17 *****************************************************************************/
18
19#include "IOVEntry.h"
20
24#include "IOVSvc/IIOVSvcTool.h"
25
26#include "GaudiKernel/StatusCode.h"
27#include "GaudiKernel/ClassID.h"
28#include "GaudiKernel/ServiceHandle.h"
29#include "GaudiKernel/ICondSvc.h"
30
31#include <map>
32#include <string>
33#include <mutex>
34
35
36class StoreGateSvc;
37class IClassIDSvc;
38class IToolSvc;
39
40namespace SG {
41 class TransientAddress;
42 class DataProxy;
43}
44
45class IOVSvc: public extends<AthService, IIOVSvc>
46{
47public:
48
49 IOVSvc( const std::string& name, ISvcLocator* svc );
50
51 virtual StatusCode initialize() override;
52 virtual StatusCode reinitialize() override;
53
54 virtual StatusCode createIOVTool( const std::string& storeName ) override;
55 virtual std::vector<std::string> getStoreNames() const override;
56
58 virtual StatusCode setRange(const CLID& clid, const std::string& key,
59 IOVRange&) override;
60 virtual StatusCode setRange(const CLID& clid, const std::string& key,
61 IOVRange& io,
62 const std::string& storeName) override;
63
64 virtual StatusCode getRange(const CLID& clid, const std::string& key,
65 IOVRange& io) const override;
66
68 virtual StatusCode regProxy( SG::DataProxy *proxy,
69 const std::string& key,
70 const std::string& storeName) override;
71
73 virtual StatusCode replaceProxy( SG::DataProxy *pOld,
74 SG::DataProxy *pNew,
75 const std::string& storeName) override;
76
77
79 virtual StatusCode regProxy( const CLID& clid, const std::string& key,
80 const std::string& storeName ) override;
81
82
83 virtual StatusCode deregProxy( SG::DataProxy *proxy ) override;
84 virtual StatusCode deregProxy( const CLID& clid, const std::string& key ) override;
85
86
87
89 virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
90 IOVRange& range, std::string &tag,
91 std::unique_ptr<IOpaqueAddress>& ioa,
92 const EventIDBase& now) const override;
93
95 virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
96 const IOVTime& time,
97 IOVRange& range, std::string &tag,
98 std::unique_ptr<IOpaqueAddress>& ioa) const override;
99
101 virtual StatusCode setRangeInDB(const CLID& clid, const std::string& key,
102 const IOVRange& range,
103 const std::string &tag) override;
104
106 virtual StatusCode dropObjectFromDB(const CLID& clid, const std::string& key,
107 const std::string& storeName) override;
108
110 virtual StatusCode preLoadTAD( const SG::TransientAddress *,
111 const std::string& storeName ) override;
112
114 virtual StatusCode preLoadDataTAD( const SG::TransientAddress *,
115 const std::string& storeName ) override;
116
117 virtual void resetAllProxies() override;
118
119 virtual void ignoreProxy(const CLID& clid, const std::string& key,
120 const std::string& storeName) override;
121
122 virtual StatusCode createCondObj(CondContBase*, const DataObjID&,
123 const EventIDBase&) override;
124
125
126private:
127
128 StatusCode createIOVTool(const std::string& storeName, IIOVSvcTool*& tool);
129 IIOVSvcTool* getTool( const std::string& storeName,
130 bool createIF=true );
131 IIOVSvcTool* getTool( const CLID& clid, const std::string& key) const;
132 IIOVSvcTool* getTool( SG::DataProxy* proxy ) const;
133 std::string fullProxyName( const SG::DataProxy* proxy ) const;
134 std::string fullProxyName( const CLID& clid, const std::string& key ) const;
135
136 Gaudi::Property<bool> m_preLoadRanges{this, "preLoadRanges", false};
137 Gaudi::Property<bool> m_preLoadData{this, "preLoadData", false};
138 Gaudi::Property<bool> m_partialPreLoadData{this, "partialPreloadData", true};
139 Gaudi::Property<bool> m_preLoadExtensibleFolders{this, "preLoadExtensibleFolders", true};
140 Gaudi::Property<bool> m_sortKeys{this, "sortKeys", true};
141 Gaudi::Property<bool> m_forceReset{this, "forceResetAtBeginRun", false};
142 Gaudi::Property<std::string> m_updateInterval{this, "updateInterval", "Event"};
143
148
149 std::map< std::string, IIOVSvcTool* > m_toolMap;
150
151 // Recursive because createCondObj dereferences a DataProxy, which can
152 // eventually recursively call back to IOVSvc.
153 mutable std::recursive_mutex m_lock;
154
155};
156
157#endif
uint32_t CLID
The Class ID type.
Basic time unit for IOVSvc.
Base class for all conditions containers.
Definition CondCont.h:140
Validity Range object.
Definition IOVRange.h:30
Gaudi::Property< std::string > m_updateInterval
Definition IOVSvc.h:142
virtual StatusCode preLoadDataTAD(const SG::TransientAddress *, const std::string &storeName) override
supply a list of TADs whose data will be preloaded
Definition IOVSvc.cxx:273
std::map< std::string, IIOVSvcTool * > m_toolMap
Definition IOVSvc.h:149
Gaudi::Property< bool > m_preLoadRanges
Definition IOVSvc.h:136
virtual std::vector< std::string > getStoreNames() const override
Definition IOVSvc.cxx:627
virtual StatusCode createIOVTool(const std::string &storeName) override
Definition IOVSvc.cxx:529
ServiceHandle< StoreGateSvc > p_detStore
Definition IOVSvc.h:146
virtual StatusCode preLoadTAD(const SG::TransientAddress *, const std::string &storeName) override
supply a list of TADs whose proxies will be preloaded
Definition IOVSvc.cxx:252
Gaudi::Property< bool > m_preLoadExtensibleFolders
Definition IOVSvc.h:139
Gaudi::Property< bool > m_preLoadData
Definition IOVSvc.h:137
IOVSvc(const std::string &name, ISvcLocator *svc)
Definition IOVSvc.cxx:65
virtual StatusCode getRange(const CLID &clid, const std::string &key, IOVRange &io) const override
Definition IOVSvc.cxx:390
virtual StatusCode replaceProxy(SG::DataProxy *pOld, SG::DataProxy *pNew, const std::string &storeName) override
replace a registered DataProxy with a new version
Definition IOVSvc.cxx:230
ServiceHandle< IClassIDSvc > p_CLIDSvc
Definition IOVSvc.h:145
virtual void resetAllProxies() override
Definition IOVSvc.cxx:637
Gaudi::Property< bool > m_partialPreLoadData
Definition IOVSvc.h:138
virtual StatusCode deregProxy(SG::DataProxy *proxy) override
Deregister a DataProxy with the service.
Definition IOVSvc.cxx:170
Gaudi::Property< bool > m_forceReset
Definition IOVSvc.h:141
virtual StatusCode setRange(const CLID &clid, const std::string &key, IOVRange &) override
Update Range from dB.
Definition IOVSvc.cxx:290
std::recursive_mutex m_lock
Definition IOVSvc.h:153
IIOVSvcTool * getTool(const std::string &storeName, bool createIF=true)
Definition IOVSvc.cxx:539
virtual StatusCode getRangeFromDB(const CLID &clid, const std::string &key, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa, const EventIDBase &now) const override
Get IOVRange from db for current event.
Definition IOVSvc.cxx:407
ServiceHandle< StoreGateSvc > p_sgs
Definition IOVSvc.h:146
virtual StatusCode setRangeInDB(const CLID &clid, const std::string &key, const IOVRange &range, const std::string &tag) override
Set a particular IOVRange in db (and memory)
Definition IOVSvc.cxx:458
virtual StatusCode regProxy(SG::DataProxy *proxy, const std::string &key, const std::string &storeName) override
Subscribe method for DataProxy. key StoreGate key.
Definition IOVSvc.cxx:95
virtual StatusCode createCondObj(CondContBase *, const DataObjID &, const EventIDBase &) override
Definition IOVSvc.cxx:650
ServiceHandle< IToolSvc > p_toolSvc
Definition IOVSvc.h:144
virtual void ignoreProxy(const CLID &clid, const std::string &key, const std::string &storeName) override
ignore proxy
Definition IOVSvc.cxx:210
virtual StatusCode reinitialize() override
Definition IOVSvc.cxx:475
virtual StatusCode initialize() override
Definition IOVSvc.cxx:77
std::string fullProxyName(const SG::DataProxy *proxy) const
Definition IOVSvc.cxx:593
virtual StatusCode dropObjectFromDB(const CLID &clid, const std::string &key, const std::string &storeName) override
Drop the associated object from the db and trigger reload.
Definition IOVSvc.cxx:351
Gaudi::Property< bool > m_sortKeys
Definition IOVSvc.h:140
ServiceHandle< ICondSvc > p_condSvc
Definition IOVSvc.h:147
Basic time unit for IOVSvc.
Definition IOVTime.h:33
The Athena Transient Store API.
Forward declaration.