ATLAS Offline Software
|
This class is to provide an event wide MT container for concurrent storing of basic types, like ints This is a version of the identifiable container optimized for basic types The cache is designed for event level storage and concurrent writing. More...
#include <IdentifiableValueCache.h>
Public Types | |
typedef std::true_type | thread_safe |
Public Member Functions | |
const T & | emptyValue () const |
Return the empty value that is interpreted as an empty entry. More... | |
IdentifiableValueCache (const IdentifiableValueCache &)=delete | |
IdentifiableValueCache (size_t maxSize, T emptyValuein) | |
Pass the maximum hash to size the cache and the defaultValue which will be interpreted as an empty value. More... | |
void | forceReset () |
Forceable empty the container, DO NOT USE THIS IN MT ENVIRONMENT. More... | |
size_t | maxSize () const |
Return the maxSize of the collection. More... | |
~IdentifiableValueCache ()=default | |
T | retrieve (size_t i) |
Retrieve the Value stored in that hash. More... | |
T | retrieve (size_t i) const |
As above, but no cache extension. More... | |
bool | present (size_t i) |
Returns true if the value is set to anything but the emptyValue. More... | |
bool | present (size_t i) const |
As above, but no cache extension. More... | |
bool | setOrDrop (size_t i, const T &value) |
Set the given hash to the value. More... | |
std::vector< std::pair< size_t, T > > | getAll () const |
Make a vector of hashes and values, convenient for iteration and other uses. More... | |
const std::vector< std::atomic< T > > & | rawReadAccess () const |
Private Attributes | |
std::vector< std::atomic< T > > | m_vec |
const T | m_emptyValue |
This class is to provide an event wide MT container for concurrent storing of basic types, like ints This is a version of the identifiable container optimized for basic types The cache is designed for event level storage and concurrent writing.
Definition at line 19 of file IdentifiableValueCache.h.
typedef std::true_type IdentifiableValueCache< T >::thread_safe |
Definition at line 23 of file IdentifiableValueCache.h.
|
delete |
|
inline |
Pass the maximum hash to size the cache and the defaultValue which will be interpreted as an empty value.
Definition at line 34 of file IdentifiableValueCache.h.
|
default |
|
inline |
Return the empty value that is interpreted as an empty entry.
Definition at line 26 of file IdentifiableValueCache.h.
void IdentifiableValueCache< T >::forceReset |
Forceable empty the container, DO NOT USE THIS IN MT ENVIRONMENT.
Definition at line 85 of file IdentifiableValueCache.h.
std::vector< std::pair< size_t, T > > IdentifiableValueCache< T >::getAll |
Make a vector of hashes and values, convenient for iteration and other uses.
Definition at line 75 of file IdentifiableValueCache.h.
|
inline |
|
inline |
Returns true if the value is set to anything but the emptyValue.
Definition at line 55 of file IdentifiableValueCache.h.
|
inline |
|
inline |
Definition at line 66 of file IdentifiableValueCache.h.
|
inline |
Retrieve the Value stored in that hash.
Definition at line 49 of file IdentifiableValueCache.h.
|
inline |
bool IdentifiableValueCache< T >::setOrDrop | ( | size_t | i, |
const T & | value | ||
) |
Set the given hash to the value.
Definition at line 90 of file IdentifiableValueCache.h.
|
private |
Definition at line 70 of file IdentifiableValueCache.h.
|
private |
Definition at line 69 of file IdentifiableValueCache.h.