26size_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)),
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();
154 if (!store)
return false;
155 return store->setOption (
id, option);
187 const std::string& clsname,
207 return store->getAuxIDs();
234 return m_store->getWritableAuxIDs();
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);
317 ptr =
m_store->getData (auxid, 0, 0);
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
363 ptr = store->getData (auxid);
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)
562 for (
size_t i=0; i <
m_allcache.size()-1; i++)
599 std::max (
static_cast<SG::auxid_t>(AuxVectorData::s_minCacheLen),
601 void** newcache =
new void*[newlen];
606 std::copy (oldcache, oldcache +
m_cache_len, newcache);
607 std::fill (newcache +
m_cache_len, newcache + newlen,
608 static_cast<void*
>(0));
659 ret = store->clearDecorations();
661 m_constCache.clear();
662 m_decorCache.clear();
671 ret = store->clearDecorations();
Handle mappings between names and auxid_t.
Manage lookup of vectors of auxiliary data.
Exceptions that can be thrown from AthContainers.
Interface for non-const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
Define macros for attributes used to control the static checker.
Hold information about an option setting request.
SG::auxid_t findAuxID(const std::string &name, const std::string &clsname="") const
Look up a name -> auxid_t mapping.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Manage cache of pointers to aux element vectors.
void ** m_cache[2]
Pointer to the cache vector.
std::vector< void ** > m_allcache
All cache vectors that have been allocated.
size_t m_cache_len
Length of the cache vector.
void swap(Cache &other)
Swap this cache object with another.
Cache()
Cache manager constructor.
Cache & operator=(Cache &&rhs)
Cache manager move assignment.
void clear()
Clear the cache (and free any old cache vectors).
void store(SG::auxid_t auxid, void *ptr)
Store a pointer for auxid in the cache.
~Cache()
Cache manager destructor.
bool clearDecorations() const
Clear all decorations.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
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.
bool isAvailableOol(auxid_t id) const
Out-of-line portion of isAvailable.
const SG::IConstAuxStore * getConstStoreOol() const
Same as getConstStore.
static size_t s_minCacheLen ATLAS_THREAD_SAFE
Minimum length to use for the cache vector.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
DataLink< SG::IConstAuxStore > m_constStoreLink
Associated store link, const.
void * getDataOol(SG::auxid_t auxid, bool allowMissing)
Out-of-line portion of data access.
void * getDecorationArray(SG::auxid_t auxid) const
Return a pointer to the start of an aux data vector for a decoration.
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
AuxVectorData & operator=(AuxVectorData &&rhs)
Move assignment.
SG::IAuxStore * m_store
Associated store, non-const.
void clearDecorCache(SG::auxid_t auxid)
Clear the cached decoration pointer for a single variable.
void clearCache()
Clear the cached aux data pointers.
void * getDecorationOol(SG::auxid_t auxid) const
Out-of-line portion of data access (decorator version).
virtual size_t size_v() const =0
Return the size of the container.
static const SG::auxid_set_t s_emptySet
Empty auxid set, used for a return value when we have no associated store.
virtual size_t capacity_v() const =0
Return the capacity of the container.
AthContainers_detail::lock_guard< mutex_t > guard_t
const SG::IConstAuxStore * m_constStore
Associated store, const.
bool isAvailableWritableOol(auxid_t id)
Out-of-line portion of isAvailableWritable.
AuxVectorData()
Constructor.
bool isAvailableWritableAsDecorationOol(auxid_t id) const
Out-of-line portion of isAvailableWritableAsDecoration.
SG::IAuxStore * getStore()
Return the current store, as a non-const interface.
virtual ~AuxVectorData()
Destructor.
bool setOption(auxid_t id, const AuxDataOption &option)
Set an option for an auxiliary data variable.
const SG::auxid_set_t & getWritableAuxIDs() const
Return a set of identifiers for writable data items in this store.
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
virtual void lock() override
Lock the container.
Exception — Attempt to retrieve nonexistent aux data item.
Exception — Non-const operation performed on const aux data.
Exception — Aux data requested from object with no store.
Exception — Attempted to modify auxiliary data in a locked store.
Interface for non-const operations on an auxiliary store.
Abstract interface for manipulating vectors of arbitrary types.
Interface for const operations on an auxiliary store.
virtual const SG::auxid_set_t & getDecorIDs() const =0
Return a set of identifiers for decorations in this store.
virtual void lockDecoration(SG::auxid_t auxid)=0
Lock a decoration.
A set of aux data identifiers.
Helper for emitting error messages.
void fence_seq_cst()
A sequentially-consistent fence.
static const auxid_t null_auxid
To signal no aux data item.
size_t auxid_t
Identifier for a particular aux data item.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
Minimal span-like object describing the range of an auxiliary variable.