|
roo_collections
API Documentation for roo_collections
|
Data Structures | |
| struct | DefaultHashFn |
| struct | DefaultHashFn< const char * > |
| struct | DefaultHashFn< SmallString< N > > |
| struct | DefaultHashFn< std::string > |
| struct | DefaultHashFn<::roo::string_view > |
| struct | DefaultKeyFn |
| class | FlatSmallHashMap |
| Flat, memory-conscious hash map optimized for small collections. More... | |
| class | FlatSmallHashtable |
| Flat, memory-conscious hash table optimized for small collections. More... | |
| struct | has_is_transparent |
| struct | has_is_transparent< _Func, _SfinaeType, std::void_t< typename _Func::is_transparent > > |
| struct | KeyCovert |
| struct | KeyCovert< std::string, ::roo::string_view > |
| struct | MapKeyFn |
| class | SmallString |
| Fixed-capacity string stored inline (no heap allocation). More... | |
| struct | TransparentEq |
| struct | TransparentStringHashFn |
Typedefs | |
| template<typename Value > | |
| using | FlatSmallStringHashMap = FlatSmallHashMap< std::string, Value, TransparentStringHashFn, TransparentEq > |
| String-specialized flat hash map with heterogeneous lookup support. | |
| template<typename Key , typename HashFn = DefaultHashFn<Key>, typename KeyCmpFn = std::equal_to<Key>> | |
| using | FlatSmallHashSet = FlatSmallHashtable< Key, Key, HashFn, DefaultKeyFn< Key >, KeyCmpFn > |
| Flat, memory-conscious hash set optimized for small collections. | |
| using | FlatSmallStringHashSet = FlatSmallHashtable< std::string, std::string, TransparentStringHashFn, TransparentEq, DefaultKeyFn< std::string > > |
| String-specialized flat hash set with heterogeneous lookup support. | |
| template<typename _Func , typename _SfinaeType > | |
| using | has_is_transparent_t = typename has_is_transparent< _Func, _SfinaeType >::type |
Functions | |
| uint16_t | fastmod (uint32_t n, int idx) |
| int | initialCapacityIdx (uint16_t size_hint) |
| static uint32_t | murmur_32_scramble (uint32_t k) |
| uint32_t | murmur3_32 (const void *key, size_t len, uint32_t seed) |
| Computes 32-bit MurmurHash3 of a binary buffer. | |
Variables | |
| static constexpr float | kMaxFillRatio = 0.73 |
| static constexpr uint16_t | kRadkePrimes [] |
| static constexpr uint64_t | kRadkePrimeInverts [] |
| using roo_collections::FlatSmallHashSet = typedef FlatSmallHashtable<Key, Key, HashFn, DefaultKeyFn<Key>, KeyCmpFn> |
Flat, memory-conscious hash set optimized for small collections.
Stores keys in a single backing array and provides average constant-time lookup/insert/erase.
| Key | Stored key type. |
| HashFn | Hash function type. |
| KeyCmpFn | Equality predicate type. |
Definition at line 23 of file flat_small_hash_set.h.
| using roo_collections::FlatSmallStringHashMap = typedef FlatSmallHashMap<std::string, Value, TransparentStringHashFn, TransparentEq> |
String-specialized flat hash map with heterogeneous lookup support.
Accepts std::string, const char*, roo::string_view, and Arduino String (when available) for lookup operations.
Definition at line 191 of file flat_small_hash_map.h.
| using roo_collections::FlatSmallStringHashSet = typedef FlatSmallHashtable<std::string, std::string, TransparentStringHashFn, TransparentEq, DefaultKeyFn<std::string> > |
String-specialized flat hash set with heterogeneous lookup support.
Accepts std::string, const char*, roo::string_view, and Arduino String (when available) for lookup operations.
Definition at line 30 of file flat_small_hash_set.h.
| using roo_collections::has_is_transparent_t = typedef typename has_is_transparent<_Func, _SfinaeType>::type |
Definition at line 159 of file flat_small_hashtable.h.
Definition at line 57 of file flat_small_hashtable.h.
References kRadkePrimeInverts, and kRadkePrimes.
Referenced by roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::erase(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::erase(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::find(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::find(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::insert(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::lookup(), and roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::lookup().
Definition at line 62 of file flat_small_hashtable.h.
References kMaxFillRatio, and kRadkePrimes.
Referenced by roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::compact().
Computes 32-bit MurmurHash3 of a binary buffer.
| key | Pointer to the first byte of the buffer. |
| len | Number of bytes to hash. |
| seed | Hash seed. |
Definition at line 12 of file hash.cpp.
References murmur_32_scramble().
Referenced by roo_collections::DefaultHashFn<::roo::string_view >::operator()().
Definition at line 5 of file hash.cpp.
Referenced by murmur3_32().
Definition at line 36 of file flat_small_hashtable.h.
Referenced by initialCapacityIdx().
Definition at line 50 of file flat_small_hashtable.h.
Referenced by fastmod().
Definition at line 43 of file flat_small_hashtable.h.
Referenced by roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::clear(), fastmod(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::FlatSmallHashtable(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::FlatSmallHashtable(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::ht_len(), initialCapacityIdx(), roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::insert(), and roo_collections::FlatSmallHashtable< Entry, Key, HashFn, KeyFn, KeyCmpFn >::operator=().