qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Optimized unordered map implementations. More...

#include <string>
#include <map>
#include <ska_hash/unordered_map.hpp>
#include <unordered_map>
Include dependency graph for unordered_map.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  qb::string_to_lower
 Utility class for case-insensitive string operations. More...
class  qb::icase_basic_map< _Map, _Trait >
 A case-insensitive map implementation. More...

Typedefs

template<typename K, typename V, typename H = std::hash<K>, typename E = std::equal_to<K>, typename A = std::allocator<std::pair<const K, V>>>
using qb::unordered_flat_map = ska::flat_hash_map<K, V, H, E, A>
 A high-performance flat hash map implementation.
template<typename K, typename V, typename H = std::hash<K>, typename E = std::equal_to<K>, typename A = std::allocator<std::pair<const K, V>>>
using qb::unordered_map = std::unordered_map<K, V, H, E, A>
 The primary unordered map implementation.
template<typename Value, typename _Trait = string_to_lower>
using qb::icase_map = icase_basic_map<std::map<std::string, Value>, _Trait>
 Case-insensitive ordered map using std::map.
template<typename Value, typename _Trait = string_to_lower>
using qb::icase_unordered_map
 Case-insensitive unordered map using qb::unordered_map.

Detailed Description

Optimized unordered map implementations.

This file provides optimized and specialized unordered map implementations for the QB framework. It includes high-performance alternatives to the standard unordered_map using flat hash maps from the ska_hash library, and case-insensitive string map implementations.

Author
qb - C++ Actor Framework

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ unordered_flat_map

template<typename K, typename V, typename H = std::hash<K>, typename E = std::equal_to<K>, typename A = std::allocator<std::pair<const K, V>>>
using qb::unordered_flat_map = ska::flat_hash_map<K, V, H, E, A>

A high-performance flat hash map implementation.

This is a type alias for ska::flat_hash_map which provides better performance characteristics than std::unordered_map for many use cases. It uses open addressing with robin hood hashing for better cache locality and performance.

Template Parameters
KThe key type
VThe value type
HThe hash function type (defaults to std::hash<K>)
EThe equality function type (defaults to std::equal_to<K>)
AThe allocator type

◆ icase_map

template<typename Value, typename _Trait = string_to_lower>
using qb::icase_map = icase_basic_map<std::map<std::string, Value>, _Trait>

Case-insensitive ordered map using std::map.

Template Parameters
ValueThe value type
_TraitThe trait class for string conversion (defaults to string_to_lower)

◆ icase_unordered_map

template<typename Value, typename _Trait = string_to_lower>
using qb::icase_unordered_map
Initial value:
A case-insensitive map implementation.
Definition unordered_map.h:223

Case-insensitive unordered map using qb::unordered_map.

Template Parameters
ValueThe value type
_TraitThe trait class for string conversion (defaults to string_to_lower)