An implementation of trie.
More...
#include <trie.hpp>
|
| 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.
|
|
An implementation of trie.
◆ trie_impl() [1/5]
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.
- Parameters
-
elements | Initial elements. |
building_observer_set | A building observer set. |
double_array_density_factor | A double array density factor. |
◆ trie_impl() [2/5]
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.
- Parameters
-
elements | Initial elements. |
building_observer_set | A building observer set. |
double_array_density_factor | A double array density factor. |
◆ trie_impl() [3/5]
tetengo::trie::trie_impl::trie_impl |
( |
std::unique_ptr< storage > && | p_storage | ) |
|
|
explicit |
Creates a trie.
- Parameters
-
p_storage | A unique pointer to a storage. |
◆ trie_impl() [4/5]
tetengo::trie::trie_impl::trie_impl |
( |
std::unique_ptr< double_array > && | p_double_array | ) |
|
|
explicit |
Creates a trie.
- Parameters
-
p_double_array | A unique pointer to a double array. |
◆ trie_impl() [5/5]
tetengo::trie::trie_impl::trie_impl |
( |
trie_impl && | another | ) |
|
|
noexcept |
◆ begin()
Returns the first iterator.
- Returns
- The first iterator.
◆ contains()
bool tetengo::trie::trie_impl::contains |
( |
const std::string_view & | key | ) |
const |
|
nodiscard |
Returns true when the trie contains the given key.
- Parameters
-
- Return values
-
true | When the trie contains the given key. |
false | Otherwise. |
◆ default_double_array_density_factor()
static std::size_t tetengo::trie::trie_impl::default_double_array_density_factor |
( |
| ) |
|
|
staticnodiscard |
Returns the default double array density factor.
- Returns
- The default double array density factor.
◆ empty()
bool tetengo::trie::trie_impl::empty |
( |
| ) |
const |
|
nodiscard |
Returns true when the trie is empty.
- Return values
-
true | When the trie is empty. |
false | Otherwise. |
◆ end()
Returns the last iterator.
- Returns
- The last iterator.
◆ find()
const std::any * tetengo::trie::trie_impl::find |
( |
const std::string_view & | key | ) |
const |
|
nodiscard |
Finds the value object correspoinding the given key.
- Parameters
-
- Returns
- A pointer to the value object. Or nullptr when the trie does not have the given key.
◆ get_storage()
const storage & tetengo::trie::trie_impl::get_storage |
( |
| ) |
const |
|
nodiscard |
Returns the storage.
- Returns
- The storage.
◆ null_building_observer_set()
Returns the null building observer set.
- Returns
- The null bulding observer set.
◆ size()
std::size_t tetengo::trie::trie_impl::size |
( |
| ) |
const |
|
nodiscard |
Returns the size of the trie.
- Returns
- The size.
◆ subtrie()
std::unique_ptr< trie_impl > tetengo::trie::trie_impl::subtrie |
( |
const std::string_view & | key_prefix | ) |
const |
|
nodiscard |
Returns a subtrie.
- Parameters
-
- Returns
- A unique pointer to a subtrie. Or nullptr when the trie does not have the given key prefix.
The documentation for this class was generated from the following file:
- library/trie/cpp/include/tetengo/trie/trie.hpp