14 static_assert(std::is_trivially_copyable<hashPair>::value);
15 static_assert(std::is_trivially_destructible<hashPair>::value);
16 static_assert(std::is_trivially_copyable<IdentifierHash>::value);
17 static_assert(std::is_trivially_destructible<IdentifierHash>::value);
35 std::vector<IdentifierHash> ids;
36 ids.reserve(
m_map.size());
38 ids.emplace_back(
x.first);
52 return m_map.cbegin();
57 if(itr!=
m_map.cend() && itr->first==hashId)
return itr;
67 for(
const auto&
x :
m_map) deleter(
x.second);
72 if(
m_map.empty() ||
m_map.back().first < hashId){
73 m_map.emplace_back(hashId, ptr);
77 if(itr == std::end(
m_map) || itr->first != hashId)
79 m_map.emplace(itr, hashId, ptr);
87 if(itr !=
m_map.end())
return itr->second;
92 bool added =
insert(hashId, ptr);
94 throw std::runtime_error(
"IDC WARNING Deletion shouldn't occur in addLock paradigm");
96 return StatusCode::SUCCESS;
101 if(itr==
m_map.end() || itr->first!=hashId)
return nullptr;
102 void* ptr =
const_cast< void*
> (itr->second);
108 throw std::runtime_error(
"Not implemented in offline mode");
112 throw std::runtime_error(
"Not implemented in offline mode");
116 for(
const auto&
x :
m_map) deleter(
x.second);
I_InternalIDC::InternalConstItr InternalConstItr
std::vector< hashPair >::const_iterator InternalConstItr
EventContainers::hashPair< void > hashPair
void deleter_f(const void *p)
virtual void destructor(deleter_f *) noexcept override
virtual bool insert(IdentifierHash hashId, const void *ptr) override
virtual InternalConstItr indexFind(IdentifierHash hashId) const override
virtual const void * findIndexPtr(IdentifierHash hashId) const noexcept override
virtual size_t numberOfCollections() const override
virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock) override
virtual StatusCode fetchOrCreate(IdentifierHash hashId) override
virtual InternalConstItr cbegin() const override
virtual void wait() const override
virtual std::vector< IdentifierHash > getAllCurrentHashes() const override
virtual void * removeCollection(IdentifierHash hashId) override
virtual StatusCode addLock(IdentifierHash hashId, const void *ptr) override
InternalOffline(size_t max)
virtual void cleanUp(deleter_f *deleter) noexcept override
std::vector< I_InternalIDC::hashPair > m_map
virtual const std::vector< hashPair > & getAllHashPtrPair() const override
virtual InternalConstItr cend() const override
This is a "hash" representation of an Identifier.