|
using | ValueType = typename Members::ValueType |
|
using | ThisType = BitfieldMap< KeyBits, Members > |
|
using | AsList = Members |
|
template<ValueType NewMapping> |
using | put = decltype(putHelper< NewMapping >()) |
| Add a new mapping. More...
|
|
template<ValueType Key, int KB = KeyBits> |
using | erase = decltype(eraseHelper< Key, KB >()) |
| Remove mappings with keys prefixed by the top KB bits of Key . If KB == KeyBits , at most one removal occurs. More...
|
|
template<typename OtherMap > |
using | copyFrom = BitfieldMap< KeyBits, decltype(BitfieldMapCopyFromHelper< KeyBits >(AsList{}, typename OtherMap::AsList{}, sp::make_int_sequence< Size+OtherMap::Size >{}))> |
| Copy mappings from OtherMap into this one, overwriting any that already exist. More...
|
|
template<typename Lambda > |
using | map = BitfieldMap< KeyBits, typename Members::template map< Lambda > > |
| Functional map, applied to the underlying list. More...
|
|
|
template<int KB = KeyBits> |
constexpr static int | lookupKey (ValueType Key) |
| Find a (unique) key in the map, or -1 if it doesn't exist. More...
|
|
template<int KB = KeyBits> |
static constexpr ValueType | keyToMapping (ValueType Key) |
|
template<int KB = KeyBits> |
static constexpr bool | containsKey (ValueType I) |
| Determine if any values with the specified key prefix are present. More...
|
|
static constexpr ValueType | get (ValueType I) |
| Get the single value mapped by the key prefix of the input. More...
|
|
template<ValueType NewMapping> |
static constexpr auto | putHelper () |
|
template<ValueType KeyValue, int KB> |
static constexpr auto | eraseHelper () |
|
template<int KeyBits, typename Members>
class sp::BitfieldMap< KeyBits, Members >
An associative container backed by a sorted list of integers.
The KeyBits
most significant bits of each element determines its key, and the remainder is the value. For read or erase operations, you may specify a smaller number of bits to use for keying, allowing you to treat this structure as a map of maps. You can extract the range of elements with keys that share a prefix.
To avoid corruption of the structure, insertions always use exactly KeyBits
-many key bits.