ATLAS Offline Software
Loading...
Searching...
No Matches
CondCont.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
65
66#ifndef ATHENAKERNEL_CONDCONT_H
67#define ATHENAKERNEL_CONDCONT_H
68
79
80#include "GaudiKernel/EventIDBase.h"
81#include "GaudiKernel/EventIDRange.h"
82#include "GaudiKernel/DataObjID.h"
83#include "GaudiKernel/StatusCode.h"
84#include "GaudiKernel/ServiceHandle.h"
85#include "boost/preprocessor/facilities/overload.hpp"
86
87#include <iostream>
88#include <set>
89#include <vector>
90#include <typeinfo>
91#include <mutex>
92#include <type_traits>
93
94
95namespace SG {
96 class DataProxy;
97}
98namespace Athena {
99 class IRCUSvc;
100}
101
102
107enum class CondContStatusCode : StatusCode::code_t
108{
112
113 // Attempt to insert an item in a CondCont with a range duplicating
114 // an existing one. The original contents of the container are unchanged,
115 // and the new item has been deleted.
116 // This is classified as Success.
118
119 // Attempt to insert an item in a CondCont with a range that partially
120 // overlaps with an existing one.
121 // This is classified as Success.
123
124 // Attempt to insert an item in a CondCont where the new range is an extension
125 // of the last range. That is, the start time of the new range matches
126 // that of the last range in the container, and the end time of the new range
127 // is larger than that of the last range in the container. The end time
128 // of the last range has been extended to match the new range.
129 // The payload of the existing range is unchanged, and the new
130 // item has been deleted.
132};
133STATUSCODE_ENUM_DECL (CondContStatusCode)
134
135
136
140{
141public:
147 class Category : public StatusCode::Category
148 {
149 public:
150 typedef StatusCode::code_t code_t;
151
153 virtual const char* name() const override;
154
156 virtual std::string message (code_t code) const override;
157
159 virtual bool isSuccess (code_t code) const override;
160
162 static bool isDuplicate (code_t code);
164 static bool isDuplicate (StatusCode code);
165
167 static bool isOverlap (code_t code);
169 static bool isOverlap (StatusCode code);
170
172 static bool isExtended (code_t code);
174 static bool isExtended (StatusCode code);
175 };
176
177
179 enum class KeyType
180 {
184
187
190
193 };
194
195
198 typedef void Payload;
199
200
204 typedef uint64_t key_type;
205
206
208 virtual ~CondContBase() {};
209
210
214 CLID clid() const;
215
216
221
222
226 const DataObjID& id() const;
227
228
233
234
238 const SG::DataProxy* proxy() const;
239
240
245 void setProxy(SG::DataProxy*);
246
247
252 virtual
253 void list (std::ostream& ost) const = 0;
254
255
259 void print() const;
260
261
265 virtual size_t entries() const;
266
267
271 virtual
272 std::vector<EventIDRange> ranges() const = 0;
273
274
295 virtual
296 StatusCode typelessInsert (const EventIDRange& r,
297 void* obj,
298 const EventContext& ctx = Gaudi::Hive::currentContext()) = 0;
299
300
305 virtual
306 bool valid( const EventIDBase& t) const = 0;
307
308
316 virtual
317 bool range (const EventIDBase& t, EventIDRange& r) const = 0;
318
319
325 virtual
326 StatusCode erase (const EventIDBase& t,
327 const EventContext& ctx = Gaudi::Hive::currentContext()) = 0;
328
329
353 virtual
354 size_t trim (const std::vector<key_type>& runLbnKeys, const std::vector<key_type>& TSKeys);
355
356
361 void clear();
362
363
371 void quiescent (const EventContext& ctx = Gaudi::Hive::currentContext());
372
373
377 size_t nInserts() const;
378
379
383 size_t maxSize() const;
384
385
396 virtual
397 StatusCode extendLastRange (const EventIDRange& newRange,
398 const EventContext& ctx = Gaudi::Hive::currentContext()) = 0;
399
400
405 static
406 key_type keyFromRunLBN (const EventIDBase& b);
407
408
413 static
414 key_type keyFromTimestamp (const EventIDBase& b);
415
416
424 struct RangeKey
425 {
428
430 RangeKey (const EventIDRange& r,
431 key_type start,
432 key_type stop);
433
434
437
440
442 EventIDRange m_range;
443 };
444
445
449 struct Compare
450 {
451 bool operator() (const RangeKey& r1, const RangeKey& r2) const
452 { return r1.m_start < r2.m_start; }
453 bool operator() (key_type t, const RangeKey& r2) const
454 { return t < r2.m_start; }
455 bool inRange (key_type t, const RangeKey& r) const
456 {
457 return t >= r.m_start && t< r.m_stop;
458 }
459
460
475 int overlap (const EventContext& ctx,
476 const RangeKey& oldRange, RangeKey& newRange) const;
477
478
489 int extendRange (RangeKey& range, const RangeKey& newRange) const;
490 };
491
492
497 void addDep (CondContBase* dep);
498
499
503 std::vector<CondContBase*> getDeps();
504
505
511 static void setCleanerSvcName ATLAS_NOT_THREAD_SAFE (const std::string& name);
512
513
514protected:
518
521
533 KeyType keytype,
534 CLID clid,
535 const DataObjID& id,
537 std::shared_ptr<CondContSet::IPayloadDeleter> payloadDeleter,
538 size_t capacity);
539
540
556 StatusCode insertBase (const EventIDRange& r,
558 const EventContext& ctx = Gaudi::Hive::currentContext());
559
560
566 StatusCode eraseBase (const EventIDBase& t,
567 const EventContext& ctx = Gaudi::Hive::currentContext());
568
569
580 StatusCode
581 extendLastRangeBase (const EventIDRange& newRange,
582 const EventContext& ctx = Gaudi::Hive::currentContext());
583
584
594 const void* findBase (const EventIDBase& t,
595 EventIDRange const** r) const;
596
597
607 const void* cast (CLID clid, const void* ptr) const;
608
609
622 virtual const void* doCast (CLID clid, const void* ptr) const = 0;
623
624
632 template <class FUNC>
633 void forEach (const FUNC& func) const;
634
635
639 StatusCode inserted (const EventContext& ctx);
640
641
646 void insertError (CLID usedCLID) const;
647
648
652 delete_function* delfcn() const;
653
654
658 std::string title() const;
659
660
661private:
663 std::atomic<KeyType> m_keyType;
664
667
669 DataObjID m_id;
670
673
676
679
684
686 static std::string s_cleanerSvcName ATLAS_THREAD_SAFE;
687};
688
689
690CLASS_DEF( CondContBase , 34480459 , 1 )
691
692
693
694
695
696
701 : public CondContBase
702{
703public:
708 virtual
709 void list (std::ostream& ost) const override final;
710
711
715 virtual
716 std::vector<EventIDRange> ranges() const override final;
717
718
739 virtual
740 StatusCode typelessInsert (const EventIDRange& r,
741 void* obj,
742 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
743
744
749 virtual
750 bool valid( const EventIDBase& t) const override final;
751
752
760 virtual
761 bool range (const EventIDBase& t, EventIDRange& r) const override final;
762
763
769 virtual
770 StatusCode erase (const EventIDBase& t,
771 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
772
773
784 virtual
785 StatusCode extendLastRange (const EventIDRange& newRange,
786 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
787
788
799 CondContSingleBase (Athena::IRCUSvc& rcusvc,
800 CLID clid,
801 const DataObjID& id,
803 std::shared_ptr<CondContSet::IPayloadDeleter> payloadDeleter,
804 size_t capacity);
805};
806
807
809
810
811template <class T> class CondCont;
812
813
821template <typename T>
823{
824public:
826};
827
828
829namespace SG {
830template <typename T>
831struct Bases<CondCont<T> >
832{
834};
835} // namespace SG
836
837
838
839
846#define CONDCONT_BASE(D, B) \
847template <> \
848class CondContBaseInfo<D> \
849{ \
850public: \
851 typedef CondCont<B> Base; \
852}; \
853SG_BASES(CondCont<D>, CondCont<B>);\
854SG_BASES(D, B)
855
856
857
858
887template <typename T>
889{
890public:
893
895
897 typedef T Payload;
898
900
901
910 const DataObjID& id,
911 SG::DataProxy* proxy = nullptr,
912 size_t capacity = 16);
913
914
916 virtual ~CondCont();
917
919 CondCont (const CondCont&) = delete;
920 CondCont& operator= (const CondCont&) = delete;
921
922
942 StatusCode insert (const EventIDRange& r,
943 std::unique_ptr<T> obj,
944 const EventContext& ctx = Gaudi::Hive::currentContext());
945
946
955 bool find (const EventIDBase& t,
956 T const*& obj,
957 EventIDRange const** r = nullptr) const;
958
959
968 const T* find (const EventIDBase& t) const;
969
970
971protected:
982 CLID clid,
983 const DataObjID& id,
985 std::shared_ptr<typename CondContSet::IPayloadDeleter> payloadDeleter,
986 size_t capacity);
987
988
998 const void* cast (CLID clid, const void* ptr) const;
999
1000
1013 virtual const void* doCast (CLID clid, const void* ptr) const override;
1014
1015
1016public:
1019 static void registerBaseInit();
1020};
1021
1022
1024
1025
1031 : public CondContBase
1032{
1033public:
1038 virtual
1039 void list (std::ostream& ost) const override final;
1040
1041
1045 virtual size_t entries() const override final;
1046
1047
1051 virtual
1052 std::vector<EventIDRange> ranges() const override final;
1053
1054
1073 virtual
1074 StatusCode typelessInsert (const EventIDRange& r,
1075 void* obj,
1076 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
1077
1078
1083 virtual
1084 bool valid( const EventIDBase& t) const override final;
1085
1086
1094 virtual
1095 bool range (const EventIDBase& t, EventIDRange& r) const override final;
1096
1097
1105 virtual
1106 StatusCode erase (const EventIDBase& t,
1107 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
1108
1109
1122 virtual
1123 StatusCode extendLastRange (const EventIDRange& newRange,
1124 const EventContext& ctx = Gaudi::Hive::currentContext()) override final;
1125
1126
1127protected:
1137 CondContMixedBase (Athena::IRCUSvc& rcusvc,
1138 CLID clid,
1139 const DataObjID& id,
1140 SG::DataProxy* proxy,
1141 std::shared_ptr<CondContSet::IPayloadDeleter> payloadDeleter,
1142 size_t capacity);
1143
1144
1158 StatusCode insertMixed (const EventIDRange& r,
1159 CondContBase::CondContSet::payload_unique_ptr t,
1160 const EventContext& ctx = Gaudi::Hive::currentContext());
1161
1162
1172 const void* findMixed (const EventIDBase& t,
1173 EventIDRange const** r) const;
1174
1175
1180
1181
1182private:
1185 Athena::IRCUSvc& m_rcusvc;
1186
1188 std::shared_ptr<CondContSet::IPayloadDeleter> m_payloadDeleter;
1189
1192};
1193
1194
1196
1197
1198template <class T> class CondContMixed;
1199
1200
1208template <typename T>
1210{
1211public:
1213};
1214
1215
1216namespace SG {
1217template <typename T>
1219{
1221};
1222} // namespace SG
1223
1224
1231#define CONDCONT_MIXED_BASE(D, B) \
1232template <> \
1233class CondContMixedBaseInfo<D> \
1234{ \
1235public: \
1236 static_assert (std::is_base_of_v<CondContMixed<B>, CondCont<B> >, \
1237 "CondCont<" #B "> is not a mixed conditions container."); \
1238 typedef CondCont<B> Base; \
1239}; \
1240SG_BASES(CondContMixed<D>, CondCont<B>); \
1241SG_BASES(D, B)
1242
1243
1244
1245
1253template <typename T>
1255{
1256public:
1259
1261
1263 typedef T Payload;
1264
1266
1267
1270
1272 CondContMixed (const CondContMixed&) = delete;
1273 CondContMixed& operator= (const CondContMixed&) = delete;
1274
1275
1293 StatusCode insert (const EventIDRange& r,
1294 std::unique_ptr<T> obj,
1295 const EventContext& ctx = Gaudi::Hive::currentContext());
1296
1297
1306 bool find (const EventIDBase& t,
1307 T const*& obj,
1308 EventIDRange const** r = nullptr) const;
1309
1310
1319 const T* find (const EventIDBase& t) const;
1320
1321
1322protected:
1333 CLID clid,
1334 const DataObjID& id,
1336 std::shared_ptr<typename CondContSet::IPayloadDeleter> payloadDeleter,
1337 size_t capacity);
1338
1339
1349 CLID clid,
1350 const DataObjID& id,
1352 size_t capacity);
1353
1354
1364 const void* cast (CLID clid, const void* ptr) const;
1365
1366
1379 virtual const void* doCast (CLID clid, const void* ptr) const override;
1380
1381
1382public:
1385 static void registerBaseInit();
1386};
1387
1388
1390
1391
1394
1395#define CONCATUNF_(x,y) x##y
1396#define CONCATUNF(x,y) CONCATUNF_(x,y)
1397#define UNIQUEVARNAME CONCATUNF(CONCATUNF(REGCCM_,__COUNTER__),__LINE__)
1398
1399
1401// For a conditions container not deriving from another, do
1402// CONDCONT_DEF(TYPE, CLID);
1403//
1404// For a conditions container with a payload deriving from BASE, do
1405// CONDCONT_DEF(TYPE, CLID, BASE);
1406//
1407#define CONDCONT_DEF_2(T, CLID_) \
1408 CLASS_DEF( CondCont<T>, CLID_, 1) \
1409 static CondContainer::CondContMaker<T> maker_ ## CLID_ {}
1410#define CONDCONT_DEF_3(T, CLID_, BASE) \
1411 CONDCONT_BASE(T, BASE); \
1412 CONDCONT_DEF_2(T, CLID_)
1413#define CONDCONT_DEF(...) \
1414 BOOST_PP_OVERLOAD(CONDCONT_DEF_, __VA_ARGS__)(__VA_ARGS__)
1415
1416
1418// For a conditions container not deriving from another, do
1419// CONDCONT_MIXED_DEF(TYPE, CLID);
1420//
1421// For a conditions container with a payload deriving from BASE, do
1422// CONDCONT_MIXED_DEF(TYPE, CLID, BASE);
1423//
1424// The BASE class must have earlier been named in another CONDCONT_MIXED_DEF.
1425//
1426#define CONDCONT_MIXED_DEF_2(T, CLID_) \
1427 template<> class CondCont<T> : public CondContMixed<T> { \
1428 public: \
1429 CondCont (Athena::IRCUSvc& rcusvc, const DataObjID& id, \
1430 SG::DataProxy* proxy =nullptr, size_t capacity = 16) \
1431 : CondContMixed<T> (rcusvc, CLID_, id, proxy, capacity) {} \
1432 protected: \
1433 CondCont (Athena::IRCUSvc& rcusvc, CLID clid, const DataObjID& id, \
1434 SG::DataProxy* proxy, \
1435 std::shared_ptr<typename CondContSet::IPayloadDeleter> payloadDeleter, \
1436 size_t capacity = 16) \
1437 : CondContMixed<T> (rcusvc, clid, id, proxy, \
1438 std::move(payloadDeleter), capacity) {} \
1439 }; \
1440 CLASS_DEF( CondCont<T>, CLID_, 1) \
1441 SG_BASES(CondCont<T>, CondContMixed<T>); \
1442 static CondContainer::CondContMaker<T> maker_ ## CLID_ {}
1443#define CONDCONT_MIXED_DEF_3(T, CLID_, BASE) \
1444 CONDCONT_MIXED_BASE(T, BASE); \
1445 CONDCONT_MIXED_DEF_2(T, CLID_)
1446#define CONDCONT_MIXED_DEF(...) \
1447 BOOST_PP_OVERLOAD(CONDCONT_MIXED_DEF_, __VA_ARGS__)(__VA_ARGS__)
1448
1449
1450#endif // not ATHENAKERNEL_CONDCONT_H
1451
A set of pointers, alowing concurrent, lockless reads.
Map from range to payload object, allowing concurrent, lockless reads.
CondContStatusCode
Define extended status codes used by CondCont.
Definition CondCont.h:108
Deletion object for conditions payloads.
Provide an interface for finding inheritance information at run time.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
uint32_t CLID
The Class ID type.
#define protected
Interface for doing garbage collection of conditions objects.
Implementation of Updater for RCUSvc.
Simple (non-deleting) Updater implementation.
void print(char *figname, TCanvas *c1)
string trim(string s)
Define macros for attributes used to control the static checker.
Interface for RCU service.
Definition IRCUSvc.h:40
Implementation of Updater for RCUSvc.
Definition RCUUpdater.h:39
Traits class to find the base for CondCont.
Definition CondCont.h:823
CondContSingleBase Base
Definition CondCont.h:825
Status code category for ContCont.
Definition CondCont.h:148
StatusCode::code_t code_t
Definition CondCont.h:150
static bool isOverlap(code_t code)
Helper to test whether a code is OVERLAP.
Definition CondCont.cxx:242
virtual const char * name() const override
Name of the category.
Definition CondCont.cxx:191
virtual bool isSuccess(code_t code) const override
Is code considered success?
Definition CondCont.cxx:218
virtual std::string message(code_t code) const override
Description for code within this category.
Definition CondCont.cxx:200
static bool isExtended(code_t code)
Helper to test whether a code is EXTENDED.
Definition CondCont.cxx:256
static bool isDuplicate(code_t code)
Helper to test whether a code is DUPLICATE.
Definition CondCont.cxx:228
Base class for all conditions containers.
Definition CondCont.h:140
StatusCode insertBase(const EventIDRange &r, CondContSet::payload_unique_ptr t, const EventContext &ctx=Gaudi::Hive::currentContext())
Insert a new conditions object.
Definition CondCont.cxx:446
CLID m_clid
CLID of the most-derived CondCont.
Definition CondCont.h:666
StatusCode extendLastRangeBase(const EventIDRange &newRange, const EventContext &ctx=Gaudi::Hive::currentContext())
Extend the range of the last IOV.
Definition CondCont.cxx:583
void insertError(CLID usedCLID) const
Helper to report an error due to using a base class for insertion.
Definition CondCont.cxx:727
void forEach(const FUNC &func) const
Call func on each entry in the container.
virtual ~CondContBase()
Destructor.
Definition CondCont.h:208
CondContSet::Updater_t Updater_t
Definition CondCont.h:519
size_t nInserts() const
Return the number times an item was inserted into the map.
Definition CondCont.cxx:384
void setProxy(SG::DataProxy *)
Set the associated DataProxy.
Definition CondCont.cxx:276
size_t maxSize() const
Return the maximum size of the map.
Definition CondCont.cxx:393
KeyType
Type of key used for this container.
Definition CondCont.h:180
@ SINGLE
Either TIMESTAMP or RUNLBN, but nothing's been put in the container yet, so we don't know which one.
Definition CondCont.h:183
@ MIXED
Mixed Run+lbn / timestamp container.
Definition CondCont.h:192
@ TIMESTAMP
Container uses timestamp keys.
Definition CondCont.h:186
@ RUNLBN
Container uses run+lbn keys.
Definition CondCont.h:189
std::string title() const
Description of this container to use for MsgStream.
Definition CondCont.cxx:749
void clear()
Remove all entries in the container.
Definition CondCont.cxx:361
std::atomic< KeyType > m_keyType
Key type of this container.
Definition CondCont.h:663
virtual StatusCode typelessInsert(const EventIDRange &r, void *obj, const EventContext &ctx=Gaudi::Hive::currentContext())=0
Insert a new conditions object.
void Payload
Payload type held by this class.
Definition CondCont.h:198
const void * findBase(const EventIDBase &t, EventIDRange const **r) const
Internal lookup function.
Definition CondCont.cxx:637
CondContSet m_condSet
Set of mapped objects.
Definition CondCont.h:675
virtual std::vector< EventIDRange > ranges() const =0
Return all IOV validity ranges defined in this container.
virtual const void * doCast(CLID clid, const void *ptr) const =0
Do pointer conversion for the payload type.
static std::string s_cleanerSvcName ATLAS_THREAD_SAFE
Name of the global conditions cleaner service.
Definition CondCont.h:686
StatusCode eraseBase(const EventIDBase &t, const EventContext &ctx=Gaudi::Hive::currentContext())
Erase the first element not less than t.
Definition CondCont.cxx:539
delete_function * delfcn() const
Return the deletion function for this container.
Definition CondCont.cxx:740
static void setCleanerSvcName ATLAS_NOT_THREAD_SAFE(const std::string &name)
Allow overriding the name of the global conditions cleaner service (for testing purposes).
virtual StatusCode extendLastRange(const EventIDRange &newRange, const EventContext &ctx=Gaudi::Hive::currentContext())=0
Extend the range of the last IOV.
void quiescent(const EventContext &ctx=Gaudi::Hive::currentContext())
Mark that this thread is no longer accessing data from this container.
Definition CondCont.cxx:375
virtual StatusCode erase(const EventIDBase &t, const EventContext &ctx=Gaudi::Hive::currentContext())=0
Erase the first element not less than t.
ServiceHandle< Athena::IConditionsCleanerSvc > m_cleanerSvc
Handle to the cleaner service.
Definition CondCont.h:678
static key_type keyFromTimestamp(const EventIDBase &b)
Make a timestamp key from an EventIDBase.
virtual bool valid(const EventIDBase &t) const =0
Test to see if a given IOV time is mapped in the container.
DepSet m_deps
Definition CondCont.h:683
static key_type keyFromRunLBN(const EventIDBase &b)
Make a run+lbn key from an EventIDBase.
DataObjID m_id
CLID+key for this container.
Definition CondCont.h:669
CxxUtils::ConcurrentRangeMap< RangeKey, key_type, void, Compare, Athena::RCUUpdater > CondContSet
Definition CondCont.h:517
StatusCode inserted(const EventContext &ctx)
Tell the cleaner that a new object was added to the container.
Definition CondCont.cxx:686
const void * cast(CLID clid, const void *ptr) const
Do pointer conversion for the payload type.
KeyType keyType() const
Return the key type for this container.
CondContBase(Athena::IRCUSvc &rcusvc, KeyType keytype, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity)
Internal constructor.
Definition CondCont.cxx:409
CLID clid() const
Return the CLID of the most-derived CondCont.
uint64_t key_type
Type used to store an IOV time internally.
Definition CondCont.h:204
SG::DataProxy * m_proxy
Associated DataProxy.
Definition CondCont.h:672
virtual bool range(const EventIDBase &t, EventIDRange &r) const =0
Return the mapped validity range for an IOV time.
const SG::DataProxy * proxy() const
Return the associated DataProxy, if any.
SG::DataProxy * proxy()
Return the associated DataProxy, if any.
const DataObjID & id() const
Return CLID/key corresponding to this container.
CondContSet::delete_function delete_function
Definition CondCont.h:520
virtual void list(std::ostream &ost) const =0
Dump the container contents for debugging.
CxxUtils::ConcurrentPtrSet< CondContBase, CxxUtils::SimpleUpdater > DepSet
Other conditions dependencies that depend on this one, as inferred by addDependency calls.
Definition CondCont.h:682
Traits class to find the base for CondContMixed.
Definition CondCont.h:1210
CondContMixedBase Base
Definition CondCont.h:1212
Base class for conditions containers for which keys are ranges in both Run+LBN and timestamp.
Definition CondCont.h:1032
delete_function * payloadDelfcn() const
Return the payload deletion function for this container.
virtual void list(std::ostream &ost) const override final
Dump the container contents for debugging.
Definition CondCont.cxx:920
const void * findMixed(const EventIDBase &t, EventIDRange const **r) const
Internal lookup function.
virtual std::vector< EventIDRange > ranges() const override final
Return all IOV validity ranges defined in this container.
Definition CondCont.cxx:959
StatusCode insertMixed(const EventIDRange &r, CondContBase::CondContSet::payload_unique_ptr t, const EventContext &ctx=Gaudi::Hive::currentContext())
Insert a new conditions object.
virtual size_t entries() const override final
Return the number of conditions objects in the container.
Definition CondCont.cxx:943
virtual StatusCode erase(const EventIDBase &t, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Erase the first element not less than t.
virtual bool valid(const EventIDBase &t) const override final
Test to see if a given IOV time is mapped in the container.
Athena::IRCUSvc & m_rcusvc
Need to remember the RCU svc here in order to pass it to the TS maps.
Definition CondCont.h:1185
std::shared_ptr< CondContSet::IPayloadDeleter > m_payloadDeleter
Deletion object for actual payload objects.
Definition CondCont.h:1188
virtual StatusCode typelessInsert(const EventIDRange &r, void *obj, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Insert a new conditions object.
Definition CondCont.cxx:996
std::mutex m_mutex
Mutex for insertions.
Definition CondCont.h:1191
virtual StatusCode extendLastRange(const EventIDRange &newRange, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Extend the range of the last IOV.
CondContMixedBase(Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity)
Internal constructor.
Definition CondCont.cxx:901
virtual bool range(const EventIDBase &t, EventIDRange &r) const override final
Return the mapped validity range for an IOV time.
Conditions container for which keys are ranges in both Run+LBN and timestamp.
Definition CondCont.h:1255
CondContMixed(Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< typename CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity)
Internal Constructor.
CondContMixed(const CondContMixed &)=delete
No copying.
StatusCode insert(const EventIDRange &r, std::unique_ptr< T > obj, const EventContext &ctx=Gaudi::Hive::currentContext())
Insert a new conditions object.
virtual const void * doCast(CLID clid, const void *ptr) const override
Do pointer conversion for the payload type.
static void registerBaseInit()
Helper to ensure that the inheritance information for this class gets initialized.
CondContBase::key_type key_type
Definition CondCont.h:1265
T Payload
Payload type held by this class.
Definition CondCont.h:1263
const void * cast(CLID clid, const void *ptr) const
Do pointer conversion for the payload type.
CondContMixedBaseInfo< T >::Base Base
Base class.
Definition CondCont.h:1258
Base::CondContSet CondContSet
Definition CondCont.h:1260
bool find(const EventIDBase &t, T const *&obj, EventIDRange const **r=nullptr) const
Look up a conditions object for a given time.
CondContMixed(Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, size_t capacity)
Internal Constructor.
const T * find(const EventIDBase &t) const
Look up a conditions object for a given time.
virtual ~CondContMixed()
Destructor.
Base class for conditions containers that are either Run+LBN or timestamp.
Definition CondCont.h:702
virtual StatusCode erase(const EventIDBase &t, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Erase the first element not less than t.
Definition CondCont.cxx:843
CondContSingleBase(Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity)
Internal constructor.
Definition CondCont.cxx:877
virtual bool range(const EventIDBase &t, EventIDRange &r) const override final
Return the mapped validity range for an IOV time.
Definition CondCont.cxx:826
virtual void list(std::ostream &ost) const override final
Dump the container contents for debugging.
Definition CondCont.cxx:762
virtual StatusCode extendLastRange(const EventIDRange &newRange, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Extend the range of the last IOV.
Definition CondCont.cxx:861
virtual StatusCode typelessInsert(const EventIDRange &r, void *obj, const EventContext &ctx=Gaudi::Hive::currentContext()) override final
Insert a new conditions object.
Definition CondCont.cxx:808
virtual std::vector< EventIDRange > ranges() const override final
Return all IOV validity ranges defined in this container.
Definition CondCont.cxx:775
virtual bool valid(const EventIDBase &t) const override final
Test to see if a given IOV time is mapped in the container.
Hold mapping of ranges to condition objects.
Definition CondCont.h:889
CondContBase::key_type key_type
Definition CondCont.h:899
CondCont(const CondCont &)=delete
No copying.
CondCont(Athena::IRCUSvc &rcusvc, const DataObjID &id, SG::DataProxy *proxy=nullptr, size_t capacity=16)
Constructor.
virtual ~CondCont()
Destructor.
static void registerBaseInit()
Helper to ensure that the inheritance information for this class gets initialized.
const T * find(const EventIDBase &t) const
Look up a conditions object for a given time.
CondCont & operator=(const CondCont &)=delete
const void * cast(CLID clid, const void *ptr) const
Do pointer conversion for the payload type.
CondContBaseInfo< T >::Base Base
Base class.
Definition CondCont.h:892
CondCont(Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< typename CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity)
Internal constructor.
virtual const void * doCast(CLID clid, const void *ptr) const override
Do pointer conversion for the payload type.
T Payload
Payload type held by this class.
Definition CondCont.h:897
StatusCode insert(const EventIDRange &r, std::unique_ptr< T > obj, const EventContext &ctx=Gaudi::Hive::currentContext())
Insert a new conditions object.
bool find(const EventIDBase &t, T const *&obj, EventIDRange const **r=nullptr) const
Look up a conditions object for a given time.
Base::CondContSet CondContSet
Definition CondCont.h:894
A set of pointers, allowing concurrent, lockless queries.
Map from range to payload object, allowing concurrent, lockless reads.
DataProxy provides the registry services for StoreGate.
STL class.
int r
Definition globals.cxx:22
double entries
Definition listroot.cxx:49
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
=============================================================================
Forward declaration.
STL namespace.
Comparison object needed by ConcurrentRangeMap.
Definition CondCont.h:450
bool inRange(key_type t, const RangeKey &r) const
Definition CondCont.h:455
Range object to store in ConcurrentRangeMap.
Definition CondCont.h:425
key_type m_start
Packed start time.
Definition CondCont.h:436
RangeKey()
Default constructor.
key_type m_stop
Packed stop time.
Definition CondCont.h:439
EventIDRange m_range
Original range object.
Definition CondCont.h:442
RangeKey(const EventIDRange &r, key_type start, key_type stop)
Constructor from range+start/stop.
Represent a list of base classes.
Definition Bases.h:79
BaseList< CondContBase > bases
Definition CondCont.h:1220
BaseList< CondContBase > bases
Definition CondCont.h:833
Traits class to hold derivation information.
Definition Bases.h:115
#define private