Loading...
Searching...
No Matches
mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type Class Reference

`#include <trie_map.hpp>`

## Public Member Functions

| const_node_type (const const_node_type &other)=default
const_node_type & | operator= (const const_node_type &other)
bool | valid () const
bool | has_child () const
bool | has_value () const
const value_type & | value () const
const_node_type | child (key_unit_type c) const

## Friends

class | packed_trie_map

## Detailed Description

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>
class mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type

Represents an individual node of a trie.

## Member Function Documentation

## child()

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>

const_node_type mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type::child | ( | key_unit_type | c | ) | const

Move to a child node by a unit key.

Parameters

  c | A unit key associated with a child node relative to the current node.

Returns
  A valid node if a child node exists for the unit key passed to this method, otherwise an invalid node is returned.

## has_child()

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>

bool mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type::has_child | ( |  | ) | const

Query whether or not the node has at least one child node.

Returns
  True if the node has at least one child node, or false if the node has no child nodes at all.

## has_value()

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>

bool mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type::has_value | ( |  | ) | const

Query whether or not the node has a value associated with it.

Returns
  True if the node has a value, otherwise false.

## valid()

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>

bool mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type::valid | ( |  | ) | const

Query whether or not the node references an existing node in a tree.

Returns
  True if the node references an existing node in a tree, or false if the node does not reference any node in any tree.

## value()

template<typename KeyT, typename ValueT, typename TraitsT = trie::default_traits>

const value_type & mdds::packed_trie_map< KeyT, ValueT, TraitsT >::const_node_type::value | ( |  | ) | const

Access the value associated with the node.

Returns
  Reference to the value associated with the node.

Warning
  The caller must ensure that the node has a value via has_value() before calling this method to access it. Calling this method on a node without a value is undefined.