tetengo 1.8.1
A multipurpose library set
|
An implementation of trie. More...
#include <trie.hpp>
Classes | |
struct | building_observer_set_type |
The building observer set type. More... | |
Public Member Functions | |
trie_impl () | |
Creates an implementation of trie. | |
trie_impl (std::vector< std::pair< std::string_view, std::any > > elements, const building_observer_set_type &building_observer_set, std::size_t double_array_density_factor) | |
Creates a trie. | |
trie_impl (std::vector< std::pair< std::string, std::any > > elements, const building_observer_set_type &building_observer_set, std::size_t double_array_density_factor) | |
Creates a trie. | |
trie_impl (std::unique_ptr< storage > &&p_storage) | |
Creates a trie. | |
trie_impl (std::unique_ptr< double_array > &&p_double_array) | |
Creates a trie. | |
trie_impl (trie_impl &&another) noexcept | |
Moves a trie. | |
~trie_impl () | |
Destroys an implementation of trie. | |
bool | empty () const |
Returns true when the trie is empty. | |
std::size_t | size () const |
Returns the size of the trie. | |
bool | contains (const std::string_view &key) const |
Returns true when the trie contains the given key. | |
const std::any * | find (const std::string_view &key) const |
Finds the value object correspoinding the given key. | |
trie_iterator_impl | begin () const |
Returns the first iterator. | |
trie_iterator_impl | end () const |
Returns the last iterator. | |
std::unique_ptr< trie_impl > | subtrie (const std::string_view &key_prefix) const |
Returns a subtrie. | |
const storage & | get_storage () const |
Returns the storage. | |
Static Public Member Functions | |
static const building_observer_set_type & | null_building_observer_set () |
Returns the null building observer set. | |
static std::size_t | default_double_array_density_factor () |
Returns the default double array density factor. | |
An implementation of trie.
tetengo::trie::trie_impl::trie_impl | ( | std::vector< std::pair< std::string_view, std::any > > | elements, |
const building_observer_set_type & | building_observer_set, | ||
std::size_t | double_array_density_factor | ||
) |
Creates a trie.
elements | Initial elements. |
building_observer_set | A building observer set. |
double_array_density_factor | A double array density factor. |
tetengo::trie::trie_impl::trie_impl | ( | std::vector< std::pair< std::string, std::any > > | elements, |
const building_observer_set_type & | building_observer_set, | ||
std::size_t | double_array_density_factor | ||
) |
Creates a trie.
elements | Initial elements. |
building_observer_set | A building observer set. |
double_array_density_factor | A double array density factor. |
|
explicit |
Creates a trie.
p_storage | A unique pointer to a storage. |
|
explicit |
Creates a trie.
p_double_array | A unique pointer to a double array. |
|
noexcept |
Moves a trie.
another | Another trie. |
trie_iterator_impl tetengo::trie::trie_impl::begin | ( | ) | const |
Returns the first iterator.
bool tetengo::trie::trie_impl::contains | ( | const std::string_view & | key | ) | const |
Returns true when the trie contains the given key.
key | A key. |
true | When the trie contains the given key. |
false | Otherwise. |
|
static |
Returns the default double array density factor.
bool tetengo::trie::trie_impl::empty | ( | ) | const |
Returns true when the trie is empty.
true | When the trie is empty. |
false | Otherwise. |
trie_iterator_impl tetengo::trie::trie_impl::end | ( | ) | const |
Returns the last iterator.
const std::any * tetengo::trie::trie_impl::find | ( | const std::string_view & | key | ) | const |
Finds the value object correspoinding the given key.
key | A key. |
const storage & tetengo::trie::trie_impl::get_storage | ( | ) | const |
Returns the storage.
|
static |
Returns the null building observer set.
std::size_t tetengo::trie::trie_impl::size | ( | ) | const |
Returns the size of the trie.
std::unique_ptr< trie_impl > tetengo::trie::trie_impl::subtrie | ( | const std::string_view & | key_prefix | ) | const |
Returns a subtrie.
key_prefix | A key prefix. |