|
ATLAS Offline Software
|
Go to the documentation of this file.
26 size_t AuxVectorData::s_minCacheLen = 1024;
48 : m_cache (std::move (rhs.m_cache)),
49 m_constCache (std::move (rhs.m_constCache)),
50 m_decorCache (std::move (rhs.m_decorCache)),
51 m_spanCache (std::move (rhs.m_spanCache)),
52 m_store (rhs.m_store),
53 m_constStore (rhs.m_constStore),
54 m_constStoreLink (std::move (rhs.m_constStoreLink))
58 rhs.m_constStoreLink.clear();
69 m_cache = std::move (rhs.m_cache);
70 m_constCache = std::move (rhs.m_constCache);
71 m_decorCache = std::move (rhs.m_decorCache);
72 m_spanCache = std::move (rhs.m_spanCache);
79 rhs.m_constStoreLink.
clear();
152 if (
id == null_auxid)
return false;
154 if (!
store)
return false;
155 return store->setOption (
id, option);
187 const std::string& clsname,
207 return store->getAuxIDs();
248 if (!
store)
return false;
252 const void*
ptr =
store->getData (
id);
259 m_constCache.store (
id, vp);
273 if (!
store)
return false;
274 return store->getWritableAuxIDs().test(
id);
330 m_cache.store (auxid,
ptr);
333 m_constCache.store (auxid,
ptr);
334 m_decorCache.store (auxid,
ptr);
336 else if (!allowMissing)
354 bool allowMissing)
const
374 m_constCache.store (auxid, vp);
376 else if (!allowMissing)
408 ptr =
store->getDecoration (auxid, 0, 0);
422 ptr =
store->getDecoration (auxid, 0, 0);
435 m_decorCache.store (auxid,
ptr);
438 m_constCache.store (auxid,
ptr);
465 v =
store->getVector (auxid);
472 ptr = &
v->getDataSpan();
478 m_spanCache.store (auxid, vp);
480 else if (!allowMissing)
502 : m_cache_len (rhs.m_cache_len),
503 m_allcache (std::move (rhs.m_allcache))
521 m_cache_len = rhs.m_cache_len;
522 m_allcache = std::move (rhs.m_allcache);
524 m_cache[0] = rhs.m_cache[0];
525 m_cache[1] = rhs.m_cache[1];
539 for (
size_t i=0;
i < m_allcache.size();
i++)
delete [] m_allcache[
i];
549 m_allcache.swap (
other.m_allcache);
560 if (m_cache_len > 0) {
561 if (m_allcache.size() > 1) {
562 for (
size_t i=0;
i < m_allcache.size()-1;
i++)
563 delete [] m_allcache[
i];
564 m_allcache[0] = m_allcache.back();
565 m_allcache.resize(1);
567 std::fill (m_cache[0], m_cache[0] + m_cache_len,
static_cast<void*
>(0));
581 if (auxid < m_cache_len) {
582 m_cache[0][auxid] =
nullptr;
596 if (auxid >= m_cache_len) {
601 void** newcache =
new void*[newlen];
602 m_allcache.push_back (newcache);
603 void** oldcache = m_cache[0];
606 std::copy (oldcache, oldcache + m_cache_len, newcache);
607 std::fill (newcache + m_cache_len, newcache + newlen,
608 static_cast<void*
>(0));
616 m_cache[0] = newcache;
617 m_cache[1] = newcache;
619 m_cache_len = newlen;
623 m_cache[0][auxid] =
ptr;
659 ret =
store->clearDecorations();
661 m_constCache.clear();
662 m_decorCache.clear();
671 ret =
store->clearDecorations();
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
bool isAvailableOol(auxid_t id) const
Out-of-line portion of isAvailable.
virtual void lock() override
Lock the container.
virtual void lockDecoration(SG::auxid_t auxid)=0
Lock a decoration.
void * getDataOol(SG::auxid_t auxid, bool allowMissing)
Out-of-line portion of data access.
DataLink< SG::IConstAuxStore > m_constStoreLink
Associated store link, const.
static size_t s_minCacheLen ATLAS_THREAD_SAFE
Minimum length to use for the cache vector.
void clearDecorCache(SG::auxid_t auxid)
Clear the cached decoration pointer for a single variable.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
void clear()
Clear the link (make it null).
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
SG::auxid_t findAuxID(const std::string &name, const std::string &clsname="") const
Look up a name -> auxid_t mapping.
const SG::auxid_set_t & getWritableAuxIDs() const
Return a set of identifiers for writable data items in this store.
AthContainers_detail::lock_guard< mutex_t > guard_t
void * getDecorationOol(SG::auxid_t auxid) const
Out-of-line portion of data access (decorator version).
Exception — Attempted to modify auxiliary data in a locked store.
const AuxDataSpanBase * getDataSpanOol(SG::auxid_t auxid, bool allowMissing) const
Return a reference to a description of this vector's start+size, out-of-line portion.
Exceptions that can be thrown from AthContainers.
void ** m_cache[2]
Pointer to the cache vector.
AuxVectorData & operator=(AuxVectorData &&rhs)
Move assignment.
Manage cache of pointers to aux element vectors.
const SG::IConstAuxStore * getConstStoreOol() const
Same as getConstStore.
Cache()
Cache manager constructor.
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
bool isAvailableWritableAsDecorationOol(auxid_t id) const
Out-of-line portion of isAvailableWritableAsDecoration.
Exception — Non-const operation performed on const aux data.
void * getDecorationArray(SG::auxid_t auxid) const
Return a pointer to the start of an aux data vector for a decoration.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
void fence_seq_cst()
A sequentially-consistent fence.
const SG::IConstAuxStore * m_constStore
Associated store, const.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
size_t auxid_t
Identifier for a particular aux data item.
virtual ~AuxVectorData()
Destructor.
static const SG::auxid_set_t s_emptySet
Empty auxid set, used for a return value when we have no associated store.
Exception — Attempt to retrieve nonexistent aux data item.
Cache & operator=(Cache &&rhs)
Cache manager move assignment.
SG::IAuxStore * getStore()
Return the current store, as a non-const interface.
Helper for emitting error messages.
AuxVectorData()
Constructor.
Manage lookup of vectors of auxiliary data.
void fill(H5::Group &out_file, size_t iterations)
Hold information about an option setting request.
Minimal span-like object describing the range of an auxiliary variable.
bool isLinked(SG::auxid_t auxid) const
Test whether this is a linked variable.
void clearCache()
Clear the cached aux data pointers.
void clear()
Clear the cache (and free any old cache vectors).
SG::IAuxStore * m_store
Associated store, non-const.
virtual const SG::auxid_set_t & getWritableAuxIDs() const =0
Return a set of identifiers for writable data items in this store.
Interface for non-const operations on an auxiliary store.
bool clearDecorations() const
Clear all decorations.
virtual void * getData(auxid_t auxid, size_t size, size_t capacity)=0
Return the data vector for one aux data item.
void swap(Cache &other)
Swap this cache object with another.
Abstract interface for manipulating vectors of arbitrary types.
virtual const SG::auxid_set_t & getDecorIDs() const =0
Return a set of identifiers for decorations in this store.
~Cache()
Cache manager destructor.
void store(SG::auxid_t auxid, void *ptr)
Store a pointer for auxid in the cache.
Handle mappings between names and auxid_t.
Interface for non-const operations on an auxiliary store.
virtual void lock()=0
Lock the container.
bool isAvailableWritableOol(auxid_t id)
Out-of-line portion of isAvailableWritable.
A set of aux data identifiers.
Manage lookup of vectors of auxiliary data.
Interface for const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
Exception — Aux data requested from object with no store.
Define macros for attributes used to control the static checker.
virtual size_t capacity_v() const =0
Return the capacity of the container.
virtual size_t size_v() const =0
Return the size of the container.
bool setOption(auxid_t id, const AuxDataOption &option)
Set an option for an auxiliary data variable.