25 std::scoped_lock lock (m_waitMutex);
26 if(m_needsupdate.load(std::memory_order_acquire) ==
false)
return;
31 m_map.shrink_to_fit();
32 m_needsupdate.store(
false, std::memory_order_release);
36 if(m_needsupdate.load(std::memory_order_acquire))
wait();
37 std::vector<IdentifierHash>
ids;
38 ids.reserve(m_map.size());
39 for(
auto &
x : m_map) {
40 ids.emplace_back(
x.first);
47 if(m_needsupdate.load(std::memory_order_acquire))
wait();
52 if(m_needsupdate.load(std::memory_order_acquire))
wait();
58 if(m_needsupdate.load(std::memory_order_acquire))
wait();
59 return m_map.cbegin();
63 if(m_needsupdate.load(std::memory_order_acquire))
wait();
64 auto itr = std::lower_bound( m_map.cbegin(), m_map.cend(), hashId.value(), [](
const hashPair &lhs,
IdentifierHash::value_type rhs) ->
bool { return lhs.first < rhs; } );
65 if(itr!= m_map.cend() && itr->first==hashId)
return itr;
70 if(m_needsupdate.load(std::memory_order_acquire))
wait();
75 if(!m_needsupdate.load(std::memory_order_acquire)) {
76 for(
const auto&
x : m_map) { deleter(
x.second); m_fullMap[
x.first] =
nullptr; }
77 if(!m_map.empty()) m_needsupdate.store(
true, std::memory_order_relaxed);
80 for(
size_t i=0 ;
i < m_fullMap.size(); ++
i){
81 if(m_fullMap[
i]) { deleter(m_fullMap[
i]); m_fullMap[
i] =
nullptr; }
88 if(
m_fullMap[hashId]!=
nullptr)
return false;
90 m_needsupdate.store(
true, std::memory_order_relaxed);
95 if(hashId >= m_fullMap.size())
return nullptr;
96 return m_fullMap[hashId];
102 throw std::runtime_error(
"IDC WARNING Deletion shouldn't occur in addLock paradigm");
104 return StatusCode::SUCCESS;
110 m_needsupdate.store(
true, std::memory_order_relaxed);
115 throw std::runtime_error(
"Not implemented in offline mode");
119 throw std::runtime_error(
"Not implemented in offline mode");
123 if(!m_needsupdate.load(std::memory_order_acquire))
for(
const auto&
x : m_map) deleter(
x.second);
125 for(
size_t i=0 ;
i < m_fullMap.size(); ++
i){
126 if(m_fullMap[
i]) deleter(m_fullMap[
i]);