|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #ifndef EVENTCONTAINERS_IDENTIFIABLECACHEBASE_H
12 #define EVENTCONTAINERS_IDENTIFIABLECACHEBASE_H
33 #ifndef __cpp_lib_atomic_wait
59 std::vector<IdentifierHash>
ids();
94 #ifndef __cpp_lib_atomic_wait
103 std::vector<std::atomic<const void*> >
m_vec;
108 typedef std::scoped_lock<mutex_t>
lock_t;
111 #ifndef __cpp_lib_atomic_wait
124 #endif // not EVENTCONTAINERS_IDENTIFIABLECACHEBASE_H
std::unique_ptr< mutexPair[]> m_HoldingMutexes
Pool of mutexes used for waiting on completion if in a concurrent environment.
const void * findWait(IdentifierHash hash)
Retrieve ptr, will wait if there is something in progress.
const void * get(IdentifierHash hash)
Try to make payload if not there.
static constexpr uintptr_t ABORTEDflag
size_t numberOfHashes()
In a concurrent situation this number isn't necessarily perfectly synchronised with ids()....
static constexpr size_t s_defaultBucketSize
std::scoped_lock< mutex_t > lock_t
std::true_type thread_safe
void deleter_f(const void *p)
IdentifiableCacheBase(IdentifierHash maxHash, const IMaker *maker, size_t lockBucketSize)
int tryLock(IdentifierHash, IDC_WriteHandleBase &, std::vector< IdentifierHash > &)
Checks if the item is completed if it is not started it extablishes lock (returns 0),...
std::unique_lock< mutex_t > uniqueLock
bool IMakerPresent() const
void clear(deleter_f *deleter)
int itemAborted(IdentifierHash)
Returns 1 is the item has been aborted otherwise 0.
void notifyHash(IdentifierHash hash)
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 dat...
std::vector< std::atomic< const void * > > m_vec
void createSet(const std::vector< IdentifierHash > &hashes, std::vector< bool > &mask)
Create a set of hashes, updates an IDC mask as appropriate.
virtual void_unique_ptr typelessMake(IdentifierHash hash) const =0
int itemInProgress(IdentifierHash)
Returns 1 is the item is inprogress otherwise 0.
const void * find(IdentifierHash hash) noexcept
Return payload if there, null if not there.
const void * waitFor(IdentifierHash)
Halts the thread until the require hash is completed or aborted.
std::pair< bool, const void * > add(IdentifierHash hash, const void *p) noexcept
std::vector< IdentifierHash > ids()
In a threaded situation this collection will be valid but will not container hashes later added.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
static constexpr uintptr_t INVALIDflag
std::pair< bool, const void * > addLock(IdentifierHash hash, const void *p) noexcept
void cleanUp(deleter_f *deleter)