|
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_store (rhs.m_store),
52 m_constStore (rhs.m_constStore),
53 m_constStoreLink (std::move (rhs.m_constStoreLink))
57 rhs.m_constStoreLink.clear();
68 m_cache = std::move (rhs.m_cache);
69 m_constCache = std::move (rhs.m_constCache);
70 m_decorCache = std::move (rhs.m_decorCache);
77 rhs.m_constStoreLink.
clear();
150 if (
id == null_auxid)
return false;
152 if (!
store)
return false;
153 return store->setOption (
id, option);
185 const std::string& clsname,
234 if (!
store)
return false;
238 const void* ptr =
store->getData (
id);
245 m_constCache.store (
id, vp);
259 if (!
store)
return false;
260 return store->getWritableAuxIDs().test(
id);
310 m_cache.store (auxid, ptr);
313 m_constCache.store (auxid, ptr);
314 m_decorCache.store (auxid, ptr);
316 else if (!allowMissing)
334 bool allowMissing)
const
353 m_constCache.store (auxid, vp);
355 else if (!allowMissing)
404 m_decorCache.store (auxid, ptr);
407 m_constCache.store (auxid, ptr);
428 : m_cache_len (rhs.m_cache_len),
429 m_allcache (std::move (rhs.m_allcache))
447 m_cache_len = rhs.m_cache_len;
448 m_allcache = std::move (rhs.m_allcache);
450 m_cache[0] = rhs.m_cache[0];
451 m_cache[1] = rhs.m_cache[1];
465 for (
size_t i=0;
i < m_allcache.size();
i++)
delete [] m_allcache[
i];
475 m_allcache.swap (
other.m_allcache);
486 if (m_cache_len > 0) {
487 if (m_allcache.size() > 1) {
488 for (
size_t i=0;
i < m_allcache.size()-1;
i++)
489 delete [] m_allcache[
i];
490 m_allcache[0] = m_allcache.back();
491 m_allcache.resize(1);
493 std::fill (m_cache[0], m_cache[0] + m_cache_len,
static_cast<void*
>(0));
507 if (auxid < m_cache_len) {
508 m_cache[0][auxid] =
nullptr;
522 if (auxid >= m_cache_len) {
527 void** newcache =
new void*[newlen];
528 m_allcache.push_back (newcache);
529 void** oldcache = m_cache[0];
532 std::copy (oldcache, oldcache + m_cache_len, newcache);
533 std::fill (newcache + m_cache_len, newcache + newlen,
534 static_cast<void*
>(0));
542 m_cache[0] = newcache;
543 m_cache[1] = newcache;
545 m_cache_len = newlen;
549 m_cache[0][auxid] = ptr;
563 m_decorCache.clear (auxid);
601 m_constCache.clear();
602 m_decorCache.clear();
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 const void * getData(SG::auxid_t auxid) const =0
Return the data vector for one aux data item.
virtual void lock() override
Lock the container.
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).
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.
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.
Cache()
Cache manager constructor.
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.
Hold information about an option setting request.
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.
~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 const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
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.