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-2024 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
241 virtual bool isDecoration (auxid_t auxid) const override;
242
243
250 virtual const SG::auxid_set_t& getWritableAuxIDs() const override;
251
252
263 virtual const void* getIOData (SG::auxid_t auxid) const override;
264
265
277 virtual const std::type_info* getIOType (SG::auxid_t auxid) const override;
278
279
283 virtual const SG::auxid_set_t& getDynamicAuxIDs() const override;
284
285
292 virtual void lock() override;
293
294
305 virtual bool clearDecorations() override;
306
307
313 virtual size_t size() const override;
314
315
325 virtual bool setOption (auxid_t id, const AuxDataOption& option) override;
326
327
336 virtual void lockDecoration (SG::auxid_t auxid) override;
337
338
348 virtual IAuxTypeVector* linkedVector (SG::auxid_t auxid) override;
349
350
360 virtual const IAuxTypeVector* linkedVector (SG::auxid_t auxid) const override;
361
362
363protected:
375 const void* getIODataInternal (auxid_t auxid, bool quiet) const;
376
377
389 void* getIODataInternal (auxid_t auxid, bool quiet);
390
391
396 void addAuxID (auxid_t auxid);
397
398
416 virtual void* getDataInternal (SG::auxid_t auxid,
417 size_t size,
418 size_t capacity,
419 bool no_lock_check);
420
421
429 void addVector (std::unique_ptr<IAuxTypeVector> vec,
430 bool isDecoration);
431
432
433private:
436 size_t size,
437 size_t capacity,
438 bool no_lock_check);
439
441 size_t size_noLock() const;
442
445
448 std::vector<std::unique_ptr<IAuxTypeVector> > m_vecs;
449
452
455
458
460 typedef AthContainers_detail::mutex mutex_t;
461 typedef AthContainers_detail::lock_guard<mutex_t> guard_t;
463};
464
465
466} // namespace SG
467
468
469
470#ifndef XAOD_STANDALONE
471
475CLASS_DEF( SG::AuxStoreInternal , 16428258 , 1 )
476
477#endif // not XAOD_STANDALONE
478
479
480#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.
An auxiliary data store that holds data internally.
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.
virtual bool setOption(auxid_t id, const AuxDataOption &option) override
Set an option for an auxiliary data variable.
bool standalone() const
Return the standalone flag.
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 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.
virtual IAuxTypeVector * getVectorInternal_noLock(SG::auxid_t auxid, size_t size, size_t capacity, bool no_lock_check)
Implementation of getVectorInternal; no locking.
const void * getIODataInternal(auxid_t auxid, bool quiet) const
Return a pointer to the data to be stored for one aux data item.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const override
Get the list of all variables that need to be handled.
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
std::vector< std::unique_ptr< IAuxTypeVector > > m_vecs
The collection of vectors of aux data that we're managing, indexed by auxid.
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
SG::auxid_set_t m_decorations
Record which variables are decorations.
virtual const SG::auxid_set_t & getAuxIDs() const override
Return a set of identifiers for existing data items in this store.
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
SG::auxid_set_t m_auxids
Set of auxid's for which we've created a vector.
virtual const SG::auxid_set_t & getWritableAuxIDs() const override
Return a set of identifiers for writable data items in this store.
void addVector(std::unique_ptr< IAuxTypeVector > vec, bool isDecoration)
Explicitly add a vector to the store.
virtual const IAuxTypeVector * getVector(SG::auxid_t auxid) const override
Return vector interface for one aux data item.
size_t size_noLock() const
Return the number of elements in the store; no locking.
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.
virtual size_t size() const override
Return the number of elements in the store.
virtual ~AuxStoreInternal()
Destructor.
virtual const SG::auxid_set_t & getDecorIDs() const override
Return a set of identifiers for decorations in this store.
AuxStoreInternal & operator=(const AuxStoreInternal &)=delete
Don't allow assignment.
AthContainers_detail::mutex mutex_t
Mutex used to synchronize modifications to the cache vector.
virtual void reserve(size_t sz) override
Change the capacity of all aux data vectors.
virtual bool clearDecorations() override
Clear all decorations.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
virtual void lock() override
Lock the container.
AuxStoreInternal(bool standalone=false)
Constructor.
virtual IAuxTypeVector * linkedVector(SG::auxid_t auxid) override
Return interface for a linked variable.
void addAuxID(auxid_t auxid)
Add a new auxid to the set of those being managed by this store.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.
virtual const void * getIOData(SG::auxid_t auxid) const override
Return a pointer to the data to be stored for one aux data item.
bool m_standalone
Are we being written in standalone mode?
AthContainers_detail::lock_guard< mutex_t > guard_t
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:48
Abstract interface for manipulating vectors of arbitrary types.
A set of aux data identifiers.
Definition AuxTypes.h:47
Forward declaration.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Threading definitions.