![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
30 : m_standalone (standalone),
50 : m_standalone (
other.m_standalone),
51 m_decorations (
other.m_decorations),
52 m_auxids (
other.m_auxids),
53 m_locked (
other.m_locked)
57 for (
size_t i = 0;
i <
size;
i++) {
94 return m_vecs[auxid]->toPtr();
137 if (
m_vecs.size() <= auxid) {
142 if (
m_vecs[auxid]) std::abort();
145 if (!
vec->isLinked()) {
147 if (vec->size() <
sz)
185 if (
m_vecs.size() <= auxid) {
191 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
192 auxid_t linked_id = null_auxid;
194 linked_id = linked->auxid();
195 m_vecs[linked_id] = std::move (linked);
200 if (linked_id != null_auxid) {
208 return m_vecs[auxid]->toPtr();
233 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
234 if (
v && !
v->isLinked()) {
256 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
257 if (
v && !
v->isLinked())
290 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
291 if (
v && !
v->isLinked())
292 v->shift (
pos, offs);
326 size_t other_size =
other.size();
335 if (
other.getData (
id)) {
336 void* src_ptr =
other.getData (
id, other_size, other_size);
338 if (!v_dst->
insertMove (
pos, src_ptr,
reinterpret_cast<char*
>(src_ptr) + other_size*
r.getEltSize(
id),
344 const void* orig = v_dst->
toPtr();
346 if (orig != v_dst->
toPtr())
356 if (
r.isLinked (
id))
continue;
357 if (
other.getData (
id)) {
358 void* src_ptr =
other.getData (
id, other_size, other_size);
361 if (
sz < other_size)
sz = other_size +
pos;
364 m_vecs[
id]->insertMove (
pos, src_ptr,
reinterpret_cast<char*
>(src_ptr) + other_size*
r.getEltSize(
id),
429 std::ostringstream
ss;
430 ss <<
"Requested variable "
432 <<
" (" << auxid <<
") doesn't exist";
440 return m_vecs[auxid]->toPtr();
442 return m_vecs[auxid]->toVector();
462 std::ostringstream
ss;
463 ss <<
"Requested variable "
465 <<
" (" << auxid <<
") doesn't exist";
473 return m_vecs[auxid]->toPtr();
475 return m_vecs[auxid]->toVector();
510 if (!
r.isLinked (auxid))
511 return r.getType (auxid);
515 const std::type_info*
ret =
m_vecs[auxid]->objType();
558 bool anycleared =
false;
638 return m_vecs[
id]->setOption (option);
662 if (
m_vecs.size() <= auxid) {
669 m_vecs[auxid] =
r.makeVector (auxid,
size, capacity);
671 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
673 auxid_t linked_id = linked->auxid();
674 m_vecs[linked_id] = std::move (linked);
684 m_vecs[auxid]->reserve (capacity);
687 return m_vecs[auxid]->toPtr();
745 auxid_t linked_id =
r.linkedVariable (auxid);
747 if (linked_id <
m_vecs.size())
748 return m_vecs[linked_id].get();
765 auxid_t linked_id =
r.linkedVariable (auxid);
767 if (linked_id <
m_vecs.size())
768 return m_vecs[linked_id].get();
virtual void reserve(size_t sz) override
Change the capacity of all aux data vectors.
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
void addVector(std::unique_ptr< IAuxTypeVector > vec, bool isDecoration)
Explicitly add a vector to the store.
bool isLinked() const
Return true if this variable is linked from another one.
void addAuxID(auxid_t auxid)
Add a new auxid to the set of those being managed by this store.
size_t size_noLock() const
Return the number of elements in the store; no locking.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
virtual const void * getData(SG::auxid_t auxid) const override
Return the data vector for one aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
SG::auxid_set_t m_auxids
Set of auxid's for which we've created a vector.
AthContainers_detail::lock_guard< mutex_t > guard_t
#define ATHCONTAINERS_ERROR(ctx, msg)
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
bool standalone() const
Return the standalone flag.
Exception — Attempted to modify auxiliary data in a locked store.
Exceptions that can be thrown from AthContainers.
virtual ~AuxStoreInternal()
Destructor.
SG::auxid_set_t m_decorations
Record which variables are decorations.
Describe how the contents of a PackedContainer are to be saved.
std::vector< size_t > vec
AuxStoreInternal(bool standalone=false)
Constructor.
bool m_locked
Has this container been locked?
ConcurrentBitset & clear()
Clear all bits in the set.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const override
Get the list of all variables that need to be handled.
virtual const SG::auxid_set_t & getAuxIDs() const override
Return a set of identifiers for existing data items in this store.
Handle mappings between names and auxid_t.
std::vector< std::unique_ptr< IAuxTypeVector > > m_vecs
The collection of vectors of aux data that we're managing, indexed by auxid.
size_t auxid_t
Identifier for a particular aux data item.
H5::CompType packed(H5::CompType in)
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
virtual bool clearDecorations() override
Clear all decorations.
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
virtual void lock() override
Lock the container.
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
const void * getIODataInternal(auxid_t auxid, bool quiet) const
Return a pointer to the data to be stored for one aux data item.
Helper for emitting error messages.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.
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.
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
virtual bool setOption(auxid_t id, const AuxDataOption &option) override
Set an option for an auxiliary data variable.
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 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 size_t size() const override
Return the number of elements in the store.
virtual IAuxTypeVector * linkedVector(SG::auxid_t auxid) override
Return interface for a linked variable.
virtual const void * getIOData(SG::auxid_t auxid) const override
Return a pointer to the data to be stored for one aux data item.
Hold information about an option setting request.
std::unique_ptr< IAuxTypeVector > makeVector(SG::auxid_t auxid, size_t size, size_t capacity) const
Construct a new vector to hold an aux item.
static bool isValidOption(const AuxDataOption &option)
Test to see if option is a recognized packing option.
Interface for non-const operations on an auxiliary store.
An auxiliary data store that holds data internally.
bool m_standalone
Are we being written in standalone mode?
virtual bool insertMove(size_t pos, void *beg, void *end, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Abstract interface for manipulating vectors of arbitrary types.
Handle mappings between names and auxid_t.
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
A set of aux data identifiers.
virtual const SG::auxid_set_t & getWritableAuxIDs() const override
Return a set of identifiers for writable data items in this store.
ConcurrentBitset & erase(bit_t bit)
Turn off one bit.
An auxiliary data store that holds data internally.
virtual void * getDataInternal_noLock(SG::auxid_t auxid, size_t size, size_t capacity, bool no_lock_check)
Implementation of getDataInternal; no locking.
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
bool test(bit_t bit) const
Test to see if a bit is set.