45 if(
m_latest == std::numeric_limits<uint64_t>::max() )
46 throw std::overflow_error(
"Connectivity cache versions exhausted" );
59template <
typename KEY,
typename VALUE,
typename LESS = std::less<KEY>>
80 const ENTRY*
Find(
const KEY& aKey )
const {
return Find<KEY>( aKey ); }
82 template <
typename LOOKUP_KEY>
83 const ENTRY*
Find(
const LOOKUP_KEY& aKey )
const
86 return it ==
m_entries.end() ? nullptr : it->second.get();
89 const ENTRY&
Set(
const KEY& aKey,
VALUE aValue )
93 if( it !=
m_entries.end() && it->second->value == aValue )
98 auto entry = std::make_unique<const ENTRY>( ENTRY{ std::move( aValue ), version } );
99 return *
m_entries.insert_or_assign( aKey, std::move( entry ) ).first->second;
CACHE_TABLE(const CACHE_TABLE &)=delete
std::map< KEY, std::unique_ptr< const ENTRY >, LESS > m_entries
const ENTRY * Find(const LOOKUP_KEY &aKey) const
const auto & Entries() const
CACHE_VERSIONS & m_versions
CACHE_TABLE & operator=(const CACHE_TABLE &)=delete
const ENTRY & Set(const KEY &aKey, VALUE aValue)
void Erase(const KEY &aKey)
CACHE_TABLE(CACHE_VERSIONS &aVersions, LESS aLess={})
const ENTRY * Find(const KEY &aKey) const
Entry references survive unchanged writes, but not replacement or erasure of their key.
One sequence for all cache tables for the lifetime of an engine session.
CACHE_VERSIONS(const CACHE_VERSIONS &)=delete
CACHE_VERSIONS & operator=(const CACHE_VERSIONS &)=delete
Value keys and the key session of the schematic connectivity engine.
@ VALUE
Field Value of part, i.e. "3.3K".