ATLAS Offline Software
Loading...
Searching...
No Matches
AuxStoreInternal.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
11
12
13#ifndef ATHCONTAINERS_AUXSTOREINTERNAL_H
14#define ATHCONTAINERS_AUXSTOREINTERNAL_H
15
16
20#include <vector>
21#include <memory>
22
23
24namespace SG {
25
26
27class IAuxTypeVector;
28
29
42 : public IAuxStore, public IAuxStoreIO
43{
44public:
49 AuxStoreInternal (bool standalone = false);
50
51
57 virtual ~AuxStoreInternal();
58
59
64
65
68
69
73 bool standalone() const;
74
75
86 virtual const void* getData (SG::auxid_t auxid) const override;
87
88
95 virtual const IAuxTypeVector* getVector (SG::auxid_t auxid) const override;
96
97
114 virtual void* getData (SG::auxid_t auxid, size_t size, size_t capacity)
115 override;
116
117
139 virtual void* getDecoration (auxid_t auxid, size_t size, size_t capacity)
140 override;
141
142
158 virtual bool resize (size_t sz) override;
159
160
169 virtual void reserve (size_t sz) override;
170
171
194 virtual void shift (size_t pos, ptrdiff_t offs) override;
195
196
216 virtual bool insertMove (size_t pos,
217 IAuxStore& other,
218 const SG::auxid_set_t& ignore = SG::auxid_set_t(0)) override;
219
220
228 virtual const SG::auxid_set_t& getAuxIDs() const override;
229
230
234 virtual const SG::auxid_set_t& getDecorIDs() const override;
235
236
244 virtual SG::auxid_set_t
245 getCopyIDs (bool warnUnlocked = false) const override;
246
247
252 virtual bool isDecoration (auxid_t auxid) const override;
253
254
261 virtual const SG::auxid_set_t& getWritableAuxIDs() const override;
262
263
274 virtual const void* getIOData (SG::auxid_t auxid) const override;
275
276
288 virtual const std::type_info* getIOType (SG::auxid_t auxid) const override;
289
290
294 virtual const SG::auxid_set_t& getDynamicAuxIDs() const override;
295
296
303 virtual void lock() override;
304
305
316 virtual bool clearDecorations() override;
317
318
324 virtual size_t size() const override;
325
326
336 virtual bool setOption (auxid_t id, const AuxDataOption& option) override;
337
338
347 virtual void lockDecoration (SG::auxid_t auxid) override;
348
349
359 virtual IAuxTypeVector* linkedVector (SG::auxid_t auxid) override;
360
361
371 virtual const IAuxTypeVector* linkedVector (SG::auxid_t auxid) const override;
372
373
384 void toTransient (const EventContext& ctx, SG::auxid_t auxid);
385
386
397 virtual void toTransient (const EventContext& ctx) override;
398
399
400protected:
412 const void* getIODataInternal (auxid_t auxid, bool quiet) const;
413
414
426 void* getIODataInternal (auxid_t auxid, bool quiet);
427
428
434
435
453 virtual void* getDataInternal (SG::auxid_t auxid,
454 size_t size,
455 size_t capacity,
456 bool no_lock_check);
457
458
466 IAuxTypeVector* addVector (std::unique_ptr<IAuxTypeVector> vec,
467 bool isDecoration);
468
469
470private:
473 size_t size,
474 size_t capacity,
475 bool no_lock_check);
476
478 size_t size_noLock() const;
479
482
485 std::vector<std::unique_ptr<IAuxTypeVector> > m_vecs;
486
489
492
495
497 typedef AthContainers_detail::mutex mutex_t;
498 typedef AthContainers_detail::lock_guard<mutex_t> guard_t;
500};
501
502
514 const SG::auxid_set_t& decors,
515 bool warnUnlocked,
516 std::span<const std::string> noWarn);
517
518
519} // namespace SG
520
521
522
523#ifndef XAOD_STANDALONE
524
528CLASS_DEF( SG::AuxStoreInternal , 16428258 , 1 )
529
530#endif // not XAOD_STANDALONE
531
532
533#endif // not ATHCONTAINERS_AUXSTOREINTERNAL_H
std::vector< size_t > vec
Provide an interface for finding inheritance information at run time.
#define SG_BASE(D, B)
Declare that class D derives from class B.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Interface providing I/O for a generic auxiliary store.
Interface for non-const operations on an auxiliary store.
static Double_t sz
Hold information about an option setting request.
Interface providing I/O for a generic auxiliary store.
Definition IAuxStoreIO.h:44
Interface for non-const operations on an auxiliary store.
Definition IAuxStore.h:51
Abstract interface for manipulating vectors of arbitrary types.
A set of aux data identifiers.
Definition AuxTypes.h:47
Forward declaration.
virtual void * getDataInternal(SG::auxid_t auxid, size_t size, size_t capacity, bool no_lock_check)
Return the data vector for one aux data item.
bool standalone() const
Return the standalone flag.
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
virtual const std::type_info * getIOType(SG::auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
ArenaHeapAllocator & operator=(const ArenaHeapAllocator &)=delete
virtual const SG::auxid_set_t & getDynamicAuxIDs() const override
Get the list of all variables that need to be handled.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
void addAuxID(auxid_t auxid)
Add a new auxid to the set of those being managed by this store.
virtual SG::auxid_set_t getCopyIDs(bool warnUnlocked=false) const override
Return the set of variables to copy in a deep copy.
void toTransient(const EventContext &ctx, SG::auxid_t auxid)
Perform post-read processing for a single variable.
virtual IAuxTypeVector * getVectorInternal_noLock(SG::auxid_t auxid, size_t size, size_t capacity, bool no_lock_check)
Implementation of getVectorInternal; no locking.
IAuxTypeVector * addVector(std::unique_ptr< IAuxTypeVector > vec, bool isDecoration)
Explicitly add a vector to the store.
SG::auxid_set_t m_decorations
Record which variables are decorations.
SG::auxid_t auxid() const
Return the aux id for this variable.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.
const void * getIODataInternal(auxid_t auxid, bool quiet) const
Return a pointer to the data to be stored for one aux data item.
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t(0)) override
Move all elements from other to this store.
AthContainers_detail::mutex mutex_t
Mutex used to synchronize modifications to the cache vector.
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
AthContainers_detail::lock_guard< mutex_t > guard_t
virtual IAuxTypeVector * linkedVector(SG::auxid_t auxid) override
Return interface for a linked variable.
std::vector< std::unique_ptr< IAuxTypeVector > > m_vecs
The collection of vectors of aux data that we're managing, indexed by auxid.
virtual void lock() override
Lock the container.
virtual ~AuxStoreInternal()
Destructor.
virtual const SG::auxid_set_t & getWritableAuxIDs() const override
Return a set of identifiers for writable data items in this store.
SG::auxid_set_t m_auxids
Set of auxid's for which we've created a vector.
virtual size_t size() const override
Return the number of elements in the store.
virtual const IAuxTypeVector * getVector(SG::auxid_t auxid) const override
Return vector interface for one aux data item.
bool m_locked
Has this container been locked?
virtual const void * getData(SG::auxid_t auxid) const override
Return the data vector for one aux data item.
virtual void reserve(size_t sz) override
Change the capacity of all aux data vectors.
bool clearDecorations() const
Clear all decorations.
AuxStoreInternal(bool standalone=false)
An auxiliary data store that holds data internally.
virtual bool setOption(auxid_t id, const AuxDataOption &option) override
Set an option for an auxiliary data variable.
mutex_t m_mutex
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
virtual const void * getIOData(SG::auxid_t auxid) const override
Return a pointer to the data to be stored for one aux data item.
size_t size_noLock() const
Return the number of elements in the store; no locking.
bool m_standalone
Are we being written in standalone mode?
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Threading definitions.