ATLAS Offline Software
|
Manage cache of pointers to aux element vectors. More...
Public Member Functions | |
Cache () | |
Cache manager constructor. More... | |
Cache (Cache &&rhs) | |
Cache manager move constructor. More... | |
Cache & | operator= (Cache &&rhs) |
Cache manager move assignment. More... | |
~Cache () | |
Cache manager destructor. More... | |
void * | cachePtr (SG::auxid_t auxid) |
Test to see if auxid is valid in the cache. More... | |
void * | getDataArray (SG::auxid_t auxid, AuxVectorData &parent) |
Return a pointer to the start of an aux data vector. More... | |
const void * | getDataArray (SG::auxid_t auxid, const AuxVectorData &parent) |
Return a const pointer to the start of an aux data vector. More... | |
const void * | getDataArrayAllowMissing (SG::auxid_t auxid, const AuxVectorData &parent) |
Return a const pointer to the start of an aux data vector. More... | |
void * | getDecorationArray (SG::auxid_t auxid, const AuxVectorData &parent) |
Return a pointer to the start of an aux decoration vector. More... | |
const AuxDataSpanBase * | getDataSpan (SG::auxid_t auxid, const AuxVectorData &parent) |
Return a reference to a description of this vector's start+size. More... | |
void | swap (Cache &other) |
Swap this cache object with another. More... | |
void | clear () |
Clear the cache (and free any old cache vectors). More... | |
void | clear (SG::auxid_t auxid) |
Clear the cached pointer for a single variable. More... | |
void | store (SG::auxid_t auxid, void *ptr) |
Store a pointer for auxid in the cache. More... | |
Public Attributes | |
void ** | m_cache [2] |
Pointer to the cache vector. More... | |
size_t | m_cache_len |
Length of the cache vector. More... | |
std::vector< void ** > | m_allcache |
All cache vectors that have been allocated. More... | |
Private Member Functions | |
Cache (const Cache &) | |
Cache & | operator= (const Cache &) |
Manage cache of pointers to aux element vectors.
See the thread-safety comments at the start of this file for notes on what's going on here.
Definition at line 722 of file AuxVectorData.h.
SG::AuxVectorData::Cache::Cache | ( | ) |
Cache manager constructor.
Definition at line 490 of file AuxVectorData.cxx.
SG::AuxVectorData::Cache::Cache | ( | Cache && | rhs | ) |
Cache manager move constructor.
rhs | The cache from which to copy. |
Definition at line 501 of file AuxVectorData.cxx.
SG::AuxVectorData::Cache::~Cache | ( | ) |
Cache manager destructor.
Definition at line 537 of file AuxVectorData.cxx.
void* SG::AuxVectorData::Cache::cachePtr | ( | SG::auxid_t | auxid | ) |
Test to see if auxid
is valid in the cache.
auxid
is valid, return the pointer to the vector, else 0. void SG::AuxVectorData::Cache::clear | ( | ) |
void SG::AuxVectorData::Cache::clear | ( | SG::auxid_t | auxid | ) |
Clear the cached pointer for a single variable.
auxid | ID of the variable to clear. |
Not really safe to use if another thread may be accessing the same variable.
Definition at line 579 of file AuxVectorData.cxx.
void* SG::AuxVectorData::Cache::getDataArray | ( | SG::auxid_t | auxid, |
AuxVectorData & | parent | ||
) |
Return a pointer to the start of an aux data vector.
auxid | The desired aux data item. |
parent | The containing AuxVectorData object. |
This will return a pointer to the start of the data for aux data item auxid
. If the item doesn't exist, it will be created. Errors are signaled by raising an exception.
const void* SG::AuxVectorData::Cache::getDataArray | ( | SG::auxid_t | auxid, |
const AuxVectorData & | parent | ||
) |
Return a const pointer to the start of an aux data vector.
auxid | The desired aux data item. |
parent | The containing AuxVectorData object. |
This will return a pointer to the start of the data for aux data item auxid
. Errors are signaled by raising an exception.
const void* SG::AuxVectorData::Cache::getDataArrayAllowMissing | ( | SG::auxid_t | auxid, |
const AuxVectorData & | parent | ||
) |
Return a const pointer to the start of an aux data vector.
auxid | The desired aux data item. |
parent | The containing AuxVectorData object. |
This will return a pointer to the start of the data for aux data item auxid
. If the item does not exist, this will return nullptr rather than raising an exception.
const AuxDataSpanBase* SG::AuxVectorData::Cache::getDataSpan | ( | SG::auxid_t | auxid, |
const AuxVectorData & | parent | ||
) |
Return a reference to a description of this vector's start+size.
auxid | The desired aux data item. |
void* SG::AuxVectorData::Cache::getDecorationArray | ( | SG::auxid_t | auxid, |
const AuxVectorData & | parent | ||
) |
Return a pointer to the start of an aux decoration vector.
auxid | The desired aux decoration item. |
parent | The containing AuxVectorData object. |
This will return a pointer to the start of the data for aux decoration item auxid
. If the item doesn't exist, it will be created. Errors are signaled by raising an exception.
The difference between getDecorationArray
and getDataArray
is that getDecorationArray
takes a const container as input, but returns a non-const pointer. This will only succeed if either the container is not locked or the item was first accessed as a decoration.
AuxVectorData::Cache & SG::AuxVectorData::Cache::operator= | ( | Cache && | rhs | ) |
Cache manager move assignment.
rhs | The cache from which to copy. |
Definition at line 517 of file AuxVectorData.cxx.
void SG::AuxVectorData::Cache::store | ( | SG::auxid_t | auxid, |
void * | ptr | ||
) |
Store a pointer for auxid
in the cache.
auxid | The aux data item being stored. |
ptr | Pointer to the start of the aux vector for auxid . |
Definition at line 592 of file AuxVectorData.cxx.
void SG::AuxVectorData::Cache::swap | ( | Cache & | other | ) |
Swap this cache object with another.
other | The cache object with which to swap. |
Definition at line 547 of file AuxVectorData.cxx.
std::vector<void**> SG::AuxVectorData::Cache::m_allcache |
All cache vectors that have been allocated.
Definition at line 864 of file AuxVectorData.h.
void** SG::AuxVectorData::Cache::m_cache[2] |
Pointer to the cache vector.
The two pointers here are the same; see the thread-safety discussion in the file header above.
Definition at line 855 of file AuxVectorData.h.
size_t SG::AuxVectorData::Cache::m_cache_len |
Length of the cache vector.
Definition at line 858 of file AuxVectorData.h.