 |
ATLAS Offline Software
|
Go to the documentation of this file.
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++) {
110 return m_vecs[auxid].get();
153 if (
m_vecs.size() <= auxid) {
158 if (
m_vecs[auxid]) std::abort();
161 if (!
vec->isLinked()) {
163 if (vec->size() <
sz)
201 if (
m_vecs.size() <= auxid) {
207 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
208 auxid_t linked_id = null_auxid;
210 linked_id = linked->auxid();
211 m_vecs[linked_id] = std::move (linked);
216 if (linked_id != null_auxid) {
224 return m_vecs[auxid]->toPtr();
249 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
250 if (
v && !
v->isLinked()) {
272 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
273 if (
v && !
v->isLinked())
306 for (std::unique_ptr<IAuxTypeVector>&
v :
m_vecs) {
307 if (
v && !
v->isLinked())
308 v->shift (
pos, offs);
342 size_t other_size =
other.size();
351 if (
other.getData (
id)) {
352 void* src_ptr =
other.getData (
id, other_size, other_size);
360 const void* orig = v_dst->
toPtr();
362 if (orig != v_dst->
toPtr())
372 if (
r.isLinked (
id))
continue;
373 if (
other.getData (
id)) {
374 void* src_ptr =
other.getData (
id, other_size, other_size);
377 if (
sz < other_size)
sz = other_size +
pos;
379 v->resize (
sz - other_size);
380 v->insertMove (
pos, src_ptr, 0, other_size,
455 std::ostringstream
ss;
456 ss <<
"Requested variable "
458 <<
" (" << auxid <<
") doesn't exist";
466 return m_vecs[auxid]->toPtr();
468 return m_vecs[auxid]->toVector();
488 std::ostringstream
ss;
489 ss <<
"Requested variable "
491 <<
" (" << auxid <<
") doesn't exist";
499 return m_vecs[auxid]->toPtr();
501 return m_vecs[auxid]->toVector();
536 if (!
r.isLinked (auxid))
537 return r.getType (auxid);
541 const std::type_info* ret =
m_vecs[auxid]->objType();
584 bool anycleared =
false;
664 return m_vecs[
id]->setOption (option);
689 if (
m_vecs.size() <= auxid) {
696 m_vecs[auxid] =
r.makeVector (auxid,
size, capacity);
698 std::unique_ptr<IAuxTypeVector> linked =
m_vecs[auxid]->linkedVector();
700 auxid_t linked_id = linked->auxid();
701 m_vecs[linked_id] = std::move (linked);
711 m_vecs[auxid]->reserve (capacity);
714 return m_vecs[auxid].get();
772 auxid_t linked_id =
r.linkedVariable (auxid);
774 if (linked_id <
m_vecs.size())
775 return m_vecs[linked_id].get();
792 auxid_t linked_id =
r.linkedVariable (auxid);
794 if (linked_id <
m_vecs.size())
795 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.