![]() |
ATLAS Offline Software
|
#include <IdentifiableCacheBase.h>
Classes | |
struct | IMaker |
Public Types | |
typedef std::true_type | thread_safe |
Public Member Functions | |
const void * | find (IdentifierHash hash) noexcept |
Return payload if there, null if not there. More... | |
const void * | findWait (IdentifierHash hash) |
Retrieve ptr, will wait if there is something in progress. More... | |
const void * | get (IdentifierHash hash) |
Try to make payload if not there. More... | |
std::vector< IdentifierHash > | ids () |
In a threaded situation this collection will be valid but will not container hashes later added. More... | |
std::pair< bool, const void * > | add (IdentifierHash hash, const void *p) noexcept |
std::pair< bool, const void * > | addLock (IdentifierHash hash, const void *p) noexcept |
std::pair< bool, const void * > | addLock (IdentifierHash hash, void_unique_ptr p) noexcept |
std::pair< bool, const void * > | add (IdentifierHash hash, void_unique_ptr p) noexcept |
bool | IMakerPresent () const |
int | tryLock (IdentifierHash, IDC_WriteHandleBase &, std::vector< IdentifierHash > &) |
Checks if the item is completed if it is not started it extablishes lock (returns 0), If it is started but not completed it adds to wait list (returns 1) If the item is already completed it returns 2 If the item is aborted it does nothing and returns 3. More... | |
int | itemAborted (IdentifierHash) |
Returns 1 is the item has been aborted otherwise 0. More... | |
int | itemInProgress (IdentifierHash) |
Returns 1 is the item is inprogress otherwise 0. More... | |
const void * | waitFor (IdentifierHash) |
Halts the thread until the require hash is completed or aborted. More... | |
void | createSet (const std::vector< IdentifierHash > &hashes, std::vector< bool > &mask) |
Create a set of hashes, updates an IDC mask as appropriate. More... | |
size_t | fullSize () const |
size_t | numberOfHashes () |
In a concurrent situation this number isn't necessarily perfectly synchronised with ids().size() More... | |
Static Public Attributes | |
static constexpr uintptr_t | INVALIDflag = UINTPTR_MAX |
static constexpr uintptr_t | ABORTEDflag = UINTPTR_MAX-1 |
Protected Member Functions | |
IdentifiableCacheBase (IdentifierHash maxHash, const IMaker *maker) | |
~IdentifiableCacheBase () | |
void | clear (deleter_f *deleter) |
void | cleanUp (deleter_f *deleter) |
void | notifyHash (IdentifierHash hash) |
Private Types | |
typedef std::mutex | mutex_t |
typedef std::scoped_lock< mutex_t > | lock_t |
typedef std::unique_lock< mutex_t > | uniqueLock |
Private Attributes | |
std::vector< std::atomic< const void * > > | m_vec |
const IMaker * | m_maker |
mutex_t | m_mutex |
std::atomic< size_t > | m_currentHashes |
Holds the number of valid hashes in container, in concurrent use it is not guaranteed to be up to date. More... | |
Friends | |
class | InternalOnline |
Definition at line 25 of file IdentifiableCacheBase.h.
|
private |
Definition at line 100 of file IdentifiableCacheBase.h.
|
private |
Definition at line 99 of file IdentifiableCacheBase.h.
typedef std::true_type EventContainers::IdentifiableCacheBase::thread_safe |
Definition at line 34 of file IdentifiableCacheBase.h.
|
private |
Definition at line 101 of file IdentifiableCacheBase.h.
|
protected |
Definition at line 28 of file IdentifiableCacheBase.cxx.
|
protecteddefault |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
protected |
Definition at line 78 of file IdentifiableCacheBase.cxx.
|
protected |
void EventContainers::IdentifiableCacheBase::createSet | ( | const std::vector< IdentifierHash > & | hashes, |
std::vector< bool > & | mask | ||
) |
|
noexcept |
const void * EventContainers::IdentifiableCacheBase::findWait | ( | IdentifierHash | hash | ) |
|
inline |
Definition at line 84 of file IdentifiableCacheBase.h.
const void * EventContainers::IdentifiableCacheBase::get | ( | IdentifierHash | hash | ) |
std::vector< IdentifierHash > EventContainers::IdentifiableCacheBase::ids | ( | ) |
In a threaded situation this collection will be valid but will not container hashes later added.
Definition at line 190 of file IdentifiableCacheBase.cxx.
|
inline |
Definition at line 64 of file IdentifiableCacheBase.h.
int EventContainers::IdentifiableCacheBase::itemAborted | ( | IdentifierHash | hash | ) |
int EventContainers::IdentifiableCacheBase::itemInProgress | ( | IdentifierHash | hash | ) |
|
protected |
Definition at line 131 of file IdentifiableCacheBase.cxx.
size_t EventContainers::IdentifiableCacheBase::numberOfHashes | ( | ) |
In a concurrent situation this number isn't necessarily perfectly synchronised with ids().size()
Definition at line 185 of file IdentifiableCacheBase.cxx.
int EventContainers::IdentifiableCacheBase::tryLock | ( | IdentifierHash | hash, |
IDC_WriteHandleBase & | lock, | ||
std::vector< IdentifierHash > & | wait | ||
) |
Checks if the item is completed if it is not started it extablishes lock (returns 0), If it is started but not completed it adds to wait list (returns 1) If the item is already completed it returns 2 If the item is aborted it does nothing and returns 3.
Definition at line 39 of file IdentifiableCacheBase.cxx.
const void * EventContainers::IdentifiableCacheBase::waitFor | ( | IdentifierHash | hash | ) |
Halts the thread until the require hash is completed or aborted.
Definition at line 111 of file IdentifiableCacheBase.cxx.
|
friend |
Definition at line 96 of file IdentifiableCacheBase.h.
|
staticconstexpr |
Definition at line 31 of file IdentifiableCacheBase.h.
|
staticconstexpr |
Definition at line 30 of file IdentifiableCacheBase.h.
|
private |
Holds the number of valid hashes in container, in concurrent use it is not guaranteed to be up to date.
Definition at line 104 of file IdentifiableCacheBase.h.
Definition at line 97 of file IdentifiableCacheBase.h.
|
private |
Definition at line 102 of file IdentifiableCacheBase.h.
|
private |
Definition at line 95 of file IdentifiableCacheBase.h.