kblib 0.2.3
General utilities library for modern C++
kblib::compact_bit_trie< Key, key_range, Value > Class Template Reference

#include <kblib/bits.h>

Classes

class  iterator_t
 
struct  key_type
 

Public Types

using value_type = Value
 
using mapped_type = Value
 
using size_type = uint_smallest_t< key_range >
 
using difference_type = int_smallest_t< key_range >
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using iterator = iterator_t< Value >
 
using const_iterator = iterator_t< const Value >
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using bitset_type = std::bitset< bits_of< Key > >
 

Public Member Functions

auto at (key_type key) const noexcept(false) -> const_reference
 
auto at (key_type key) noexcept(false) -> reference
 
auto find_deep (key_type key, size_type depth=-1) const noexcept(false) -> const_reference
 
auto find_deep (key_type key, size_type depth=-1) noexcept(false) -> reference
 
auto empty () const noexcept -> bool
 
template<typename... Ts>
auto emplace (key_type key, Ts &&... args) -> bool
 
auto insert (key_type key, const value_type &value) -> bool
 
auto insert (key_type key, value_type &&value) -> bool
 
auto insert_or_assign (key_type key, const value_type &value) -> reference
 
auto insert_or_assign (key_type key, value_type &&value) -> reference
 
bool erase (key_type key)
 
bool prune (key_type prefix)
 
auto clear () -> void
 
auto size () const noexcept -> size_type
 
auto memory_use () const noexcept -> std::size_t
 
auto shrink_to_fit () -> void
 

Detailed Description

template<typename Key, Key key_range, typename Value>
class kblib::compact_bit_trie< Key, key_range, Value >

Definition at line 115 of file bits.h.

Member Typedef Documentation

◆ bitset_type

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::bitset_type = std::bitset<bits_of<Key> >

Definition at line 139 of file bits.h.

◆ const_iterator

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::const_iterator = iterator_t<const Value>

Definition at line 135 of file bits.h.

◆ const_pointer

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::const_pointer = const value_type*

Definition at line 129 of file bits.h.

◆ const_reference

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::const_reference = const value_type&

Definition at line 127 of file bits.h.

◆ const_reverse_iterator

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 137 of file bits.h.

◆ difference_type

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::difference_type = int_smallest_t<key_range>

Definition at line 125 of file bits.h.

◆ iterator

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::iterator = iterator_t<Value>

Definition at line 134 of file bits.h.

◆ mapped_type

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::mapped_type = Value

Definition at line 123 of file bits.h.

◆ pointer

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::pointer = value_type*

Definition at line 128 of file bits.h.

◆ reference

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::reference = value_type&

Definition at line 126 of file bits.h.

◆ reverse_iterator

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 136 of file bits.h.

◆ size_type

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::size_type = uint_smallest_t<key_range>

Definition at line 124 of file bits.h.

◆ value_type

template<typename Key , Key key_range, typename Value >
using kblib::compact_bit_trie< Key, key_range, Value >::value_type = Value

Definition at line 122 of file bits.h.

Member Function Documentation

◆ at() [1/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::at ( key_type  key) const -> const_reference
inlinenoexcept

Definition at line 146 of file bits.h.

◆ at() [2/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::at ( key_type  key) -> reference
inlinenoexcept

Definition at line 167 of file bits.h.

◆ clear()

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::clear ( ) -> void
inline

Definition at line 293 of file bits.h.

◆ emplace()

template<typename Key , Key key_range, typename Value >
template<typename... Ts>
auto kblib::compact_bit_trie< Key, key_range, Value >::emplace ( key_type  key,
Ts &&...  args 
) -> bool
inline

Definition at line 249 of file bits.h.

◆ empty()

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::empty ( ) const -> bool
inlinenoexcept

Definition at line 244 of file bits.h.

◆ erase()

template<typename Key , Key key_range, typename Value >
bool kblib::compact_bit_trie< Key, key_range, Value >::erase ( key_type  key)

◆ find_deep() [1/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::find_deep ( key_type  key,
size_type  depth = -1 
) const -> const_reference
inlinenoexcept

Definition at line 187 of file bits.h.

◆ find_deep() [2/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::find_deep ( key_type  key,
size_type  depth = -1 
) -> reference
inlinenoexcept

Definition at line 215 of file bits.h.

◆ insert() [1/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::insert ( key_type  key,
const value_type value 
) -> bool
inline

Definition at line 260 of file bits.h.

◆ insert() [2/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::insert ( key_type  key,
value_type &&  value 
) -> bool
inline

Definition at line 263 of file bits.h.

◆ insert_or_assign() [1/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::insert_or_assign ( key_type  key,
const value_type value 
) -> reference
inline

Definition at line 267 of file bits.h.

◆ insert_or_assign() [2/2]

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::insert_or_assign ( key_type  key,
value_type &&  value 
) -> reference
inline

Definition at line 279 of file bits.h.

◆ memory_use()

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::memory_use ( ) const -> std::size_t
inlinenoexcept

Definition at line 302 of file bits.h.

◆ prune()

template<typename Key , Key key_range, typename Value >
bool kblib::compact_bit_trie< Key, key_range, Value >::prune ( key_type  prefix)

◆ shrink_to_fit()

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::shrink_to_fit ( ) -> void
inline

Definition at line 307 of file bits.h.

◆ size()

template<typename Key , Key key_range, typename Value >
auto kblib::compact_bit_trie< Key, key_range, Value >::size ( ) const -> size_type
inlinenoexcept

Definition at line 298 of file bits.h.


The documentation for this class was generated from the following file: