 |
ATLAS Offline Software
|
Go to the documentation of this file.
59 for (
size_t i = 0;
i <
size;
i++) {
112 return m_vecs[auxid].get();
155 if (
m_vecs.size() <= auxid) {
160 if (
m_vecs[auxid]) std::abort();
163 if (!
vec->isLinked()) {
165 if (vec->size() <
sz)
176 std::atomic_thread_fence (std::memory_order_seq_cst);
207 if (
m_vecs.size() <= auxid) {
212 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
213 auxid_t linked_id = null_auxid;
215 linked_id = linked->auxid();
216 m_vecs[linked_id] = std::move (linked);
222 if (linked_id != null_auxid) {
225 std::atomic_thread_fence (std::memory_order_seq_cst);
228 if (linked_id != null_auxid) {
235 return m_vecs[auxid]->toPtr();
260 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
261 if (
v && !
v->isLinked()) {
283 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
284 if (
v && !
v->isLinked())
317 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
318 if (
v && !
v->isLinked())
319 v->shift (
pos, offs);
353 size_t other_size =
other.size();
362 if (
other.getData (
id)) {
363 void* src_ptr =
other.getData (
id, other_size, other_size);
371 const void* orig = v_dst->
toPtr();
373 if (orig != v_dst->
toPtr())
383 if (
r.isLinked (
id))
continue;
384 if (
other.getData (
id)) {
385 void* src_ptr =
other.getData (
id, other_size, other_size);
388 if (
sz < other_size)
sz = other_size +
pos;
390 v->resize (
sz - other_size);
391 (void)
v->insertMove (
pos, src_ptr, 0, other_size,
466 std::ostringstream
ss;
467 ss <<
"Requested variable "
469 <<
" (" << auxid <<
") doesn't exist";
477 return m_vecs[auxid]->toPtr();
479 return m_vecs[auxid]->toVector();
499 std::ostringstream
ss;
500 ss <<
"Requested variable "
502 <<
" (" << auxid <<
") doesn't exist";
510 return m_vecs[auxid]->toPtr();
512 return m_vecs[auxid]->toVector();
547 if (!
r.isLinked (auxid))
548 return r.getType (auxid);
552 const std::type_info* ret =
m_vecs[auxid]->objType();
595 bool anycleared =
false;
675 return m_vecs[
id]->setOption (option);
700 if (
m_vecs.size() <= auxid) {
707 m_vecs[auxid] =
r.makeVector (auxid,
size, capacity);
709 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
711 auxid_t linked_id = linked->auxid();
712 m_vecs[linked_id] = std::move (linked);
722 m_vecs[auxid]->reserve (capacity);
725 return m_vecs[auxid].get();
783 auxid_t linked_id =
r.linkedVariable (auxid);
785 if (linked_id <
m_vecs.size())
786 return m_vecs[linked_id].get();
803 auxid_t linked_id =
r.linkedVariable (auxid);
805 if (linked_id <
m_vecs.size())
806 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.
virtual bool insertMove(size_t pos, void *src, size_t src_pos, size_t src_n, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
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.
virtual IAuxTypeVector * getVectorInternal_noLock(SG::auxid_t auxid, size_t size, size_t capacity, bool no_lock_check)
Implementation of getVectorInternal; no locking.
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 const IAuxTypeVector * getVector(SG::auxid_t auxid) const override
Return vector interface for one aux data item.
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.
virtual const SG::auxid_set_t & getDecorIDs() const override
Return a set of identifiers for decorations in this store.
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 * 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.