7#ifndef EVENTCONTAINERS_IDENTIFIABLECACHEBASE_H
8#define EVENTCONTAINERS_IDENTIFIABLECACHEBASE_H
51 std::vector<IdentifierHash>
ids();
79 void createSet (
const std::vector<IdentifierHash>& hashes, std::vector<bool> &mask);
92 std::vector<std::atomic<const void*> >
m_vec;
97 typedef std::scoped_lock<mutex_t>
lock_t;
std::vector< std::atomic< const void * > > m_vec
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...
const void * waitFor(IdentifierHash)
Halts the thread until the require hash is completed or aborted.
size_t numberOfHashes()
In a concurrent situation this number isn't necessarily perfectly synchronised with ids()....
std::true_type thread_safe
int itemAborted(IdentifierHash)
Returns 1 is the item has been aborted otherwise 0.
int itemInProgress(IdentifierHash)
Returns 1 is the item is inprogress otherwise 0.
void notifyHash(IdentifierHash hash)
bool IMakerPresent() const
std::vector< IdentifierHash > ids()
In a threaded situation this collection will be valid but will not container hashes later added.
const void * get(IdentifierHash hash)
Try to make payload if not there.
void deleter_f(const void *p)
void cleanUp(deleter_f *deleter)
std::pair< bool, const void * > addLock(IdentifierHash hash, const void *p) noexcept
int tryLock(IdentifierHash, IDC_WriteHandleBase &, std::vector< IdentifierHash > &)
Checks if the item is completed if it is not started it extablishes lock (returns 0),...
static constexpr uintptr_t ABORTEDflag
void clear(deleter_f *deleter)
friend class InternalOnline
void createSet(const std::vector< IdentifierHash > &hashes, std::vector< bool > &mask)
Create a set of hashes, updates an IDC mask as appropriate.
IdentifiableCacheBase(IdentifierHash maxHash, const IMaker *maker)
std::pair< bool, const void * > add(IdentifierHash hash, const void *p) noexcept
std::unique_lock< mutex_t > uniqueLock
const void * findWait(IdentifierHash hash)
Retrieve ptr, will wait if there is something in progress.
std::scoped_lock< mutex_t > lock_t
const void * find(IdentifierHash hash) noexcept
Return payload if there, null if not there.
static constexpr uintptr_t INVALIDflag
This is a "hash" representation of an Identifier.
virtual void_unique_ptr typelessMake(IdentifierHash hash) const =0