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& io,
60 const std::string& storeName) override;
61
62 virtual StatusCode getRange(const CLID& clid, const std::string& key,
63 IOVRange& io) const override;
64
66 virtual StatusCode regProxy( SG::DataProxy *proxy,
67 const std::string& key,
68 const std::string& storeName) override;
69
71 virtual StatusCode replaceProxy( SG::DataProxy *pOld,
72 SG::DataProxy *pNew,
73 const std::string& storeName) override;
74
75
77 virtual StatusCode regProxy( const CLID& clid, const std::string& key,
78 const std::string& storeName ) override;
79
80
81 virtual StatusCode deregProxy( SG::DataProxy *proxy ) override;
82 virtual StatusCode deregProxy( const CLID& clid, const std::string& key ) override;
83
84
85
87 virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
88 IOVRange& range, std::string &tag,
89 std::unique_ptr<IOpaqueAddress>& ioa,
90 const EventIDBase& now) const override;
91
93 virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
94 const IOVTime& time,
95 IOVRange& range, std::string &tag,
96 std::unique_ptr<IOpaqueAddress>& ioa) const override;
97
99 virtual StatusCode setRangeInDB(const CLID& clid, const std::string& key,
100 const IOVRange& range,
101 const std::string &tag) override;
102
104 virtual StatusCode dropObjectFromDB(const CLID& clid, const std::string& key,
105 const std::string& storeName) override;
106
108 virtual StatusCode preLoadTAD( const SG::TransientAddress *,
109 const std::string& storeName ) override;
110
112 virtual StatusCode preLoadDataTAD( const SG::TransientAddress *,
113 const std::string& storeName ) override;
114
115 virtual void resetAllProxies() override;
116
117 virtual void ignoreProxy(const CLID& clid, const std::string& key,
118 const std::string& storeName) override;
119
120 virtual StatusCode createCondObj(CondContBase*, const DataObjID&,
121 const EventIDBase&) override;
122
123
124private:
125
126 StatusCode createIOVTool(const std::string& storeName, IIOVSvcTool*& tool);
127 IIOVSvcTool* getTool( const std::string& storeName,
128 bool createIF=true );
129 IIOVSvcTool* getTool( const CLID& clid, const std::string& key) const;
130 IIOVSvcTool* getTool( SG::DataProxy* proxy ) const;
131 std::string fullProxyName( const SG::DataProxy* proxy ) const;
132 std::string fullProxyName( const CLID& clid, const std::string& key ) const;
133
134 Gaudi::Property<bool> m_preLoadRanges{this, "preLoadRanges", false};
135 Gaudi::Property<bool> m_preLoadData{this, "preLoadData", false};
136 Gaudi::Property<bool> m_partialPreLoadData{this, "partialPreloadData", true};
137 Gaudi::Property<bool> m_preLoadExtensibleFolders{this, "preLoadExtensibleFolders", true};
138 Gaudi::Property<bool> m_sortKeys{this, "sortKeys", true};
139 Gaudi::Property<bool> m_forceReset{this, "forceResetAtBeginRun", false};
140 Gaudi::Property<std::string> m_updateInterval{this, "updateInterval", "Event"};
141
146
147 std::map< std::string, IIOVSvcTool* > m_toolMap;
148
149 // Recursive because createCondObj dereferences a DataProxy, which can
150 // eventually recursively call back to IOVSvc.
151 mutable std::recursive_mutex m_lock;
152
153};
154
155#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:140
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:147
Gaudi::Property< bool > m_preLoadRanges
Definition IOVSvc.h:134
virtual std::vector< std::string > getStoreNames() const override
Definition IOVSvc.cxx:601
virtual StatusCode createIOVTool(const std::string &storeName) override
Definition IOVSvc.cxx:503
ServiceHandle< StoreGateSvc > p_detStore
Definition IOVSvc.h:144
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:137
Gaudi::Property< bool > m_preLoadData
Definition IOVSvc.h:135
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:364
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:143
virtual void resetAllProxies() override
Definition IOVSvc.cxx:611
Gaudi::Property< bool > m_partialPreLoadData
Definition IOVSvc.h:136
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:139
std::recursive_mutex m_lock
Definition IOVSvc.h:151
IIOVSvcTool * getTool(const std::string &storeName, bool createIF=true)
Definition IOVSvc.cxx:513
virtual StatusCode setRange(const CLID &clid, const std::string &key, IOVRange &io, const std::string &storeName) override
Update Range from dB.
Definition IOVSvc.cxx:290
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:381
ServiceHandle< StoreGateSvc > p_sgs
Definition IOVSvc.h:144
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:432
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:624
ServiceHandle< IToolSvc > p_toolSvc
Definition IOVSvc.h:142
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:449
virtual StatusCode initialize() override
Definition IOVSvc.cxx:77
std::string fullProxyName(const SG::DataProxy *proxy) const
Definition IOVSvc.cxx:567
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:325
Gaudi::Property< bool > m_sortKeys
Definition IOVSvc.h:138
ServiceHandle< ICondSvc > p_condSvc
Definition IOVSvc.h:145
Basic time unit for IOVSvc.
Definition IOVTime.h:33
The Athena Transient Store API.
Forward declaration.