emlabcpp
modern opinionated embedded C++ library
emlabcpp::contiguous_tree< Key, Value > Class Template Reference

#include <tree.h>

Public Types

using key_type = Key
 
using value_type = Value
 
using node_id = uint32_t
 
using child_id = uint32_t
 
using array_type = pmr::map< child_id, node_id >
 
using object_type = pmr::map< key_type, node_id >
 
using node_type = contiguous_node< Key, Value >
 
using container = pmr::map< node_id, node_type >
 
using content_type = typename node_type::content_type
 
using object_handle = typename node_type::object_handle
 
using const_object_handle = typename node_type::const_object_handle
 
using array_handle = typename node_type::array_handle
 
using const_array_handle = typename node_type::const_array_handle
 
using iterator = typename container::iterator
 
using const_iterator = typename container::const_iterator
 
template<uint16_t Count>
using pool_type = pmr::pool_resource< required_pool_size, Count >
 

Public Member Functions

 contiguous_tree (pmr::memory_resource &mem_res)
 
void clear ()
 
node_type const * get_node (node_id nid) const
 
node_typeget_node (node_id nid)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::size_t size () const
 
bool empty () const
 
std::optional< node_idmake_value_node (value_type val)
 
std::optional< std::pair< node_id, array_handle > > make_array_node ()
 
std::optional< std::pair< node_id, object_handle > > make_object_node ()
 

Static Public Attributes

static constexpr std::size_t required_pool_size = 110
 

Member Typedef Documentation

◆ array_handle

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::array_handle = typename node_type::array_handle

◆ array_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::array_type = pmr::map< child_id, node_id >

◆ child_id

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::child_id = uint32_t

◆ const_array_handle

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::const_array_handle = typename node_type::const_array_handle

◆ const_iterator

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::const_iterator = typename container::const_iterator

◆ const_object_handle

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::const_object_handle = typename node_type::const_object_handle

◆ container

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::container = pmr::map< node_id, node_type >

◆ content_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::content_type = typename node_type::content_type

◆ iterator

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::iterator = typename container::iterator

◆ key_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::key_type = Key

◆ node_id

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::node_id = uint32_t

◆ node_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::node_type = contiguous_node< Key, Value >

◆ object_handle

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::object_handle = typename node_type::object_handle

◆ object_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::object_type = pmr::map< key_type, node_id >

◆ pool_type

template<typename Key , typename Value >
template<uint16_t Count>
using emlabcpp::contiguous_tree< Key, Value >::pool_type = pmr::pool_resource< required_pool_size, Count >

◆ value_type

template<typename Key , typename Value >
using emlabcpp::contiguous_tree< Key, Value >::value_type = Value

Constructor & Destructor Documentation

◆ contiguous_tree()

template<typename Key , typename Value >
emlabcpp::contiguous_tree< Key, Value >::contiguous_tree ( pmr::memory_resource mem_res)
inlineexplicit

Member Function Documentation

◆ begin() [1/2]

template<typename Key , typename Value >
iterator emlabcpp::contiguous_tree< Key, Value >::begin ( )
inline

◆ begin() [2/2]

template<typename Key , typename Value >
const_iterator emlabcpp::contiguous_tree< Key, Value >::begin ( ) const
inline

◆ clear()

template<typename Key , typename Value >
void emlabcpp::contiguous_tree< Key, Value >::clear ( )
inline

◆ empty()

template<typename Key , typename Value >
bool emlabcpp::contiguous_tree< Key, Value >::empty ( ) const
inline

◆ end() [1/2]

template<typename Key , typename Value >
iterator emlabcpp::contiguous_tree< Key, Value >::end ( )
inline

◆ end() [2/2]

template<typename Key , typename Value >
const_iterator emlabcpp::contiguous_tree< Key, Value >::end ( ) const
inline

◆ get_node() [1/2]

template<typename Key , typename Value >
node_type* emlabcpp::contiguous_tree< Key, Value >::get_node ( node_id  nid)
inline

◆ get_node() [2/2]

template<typename Key , typename Value >
node_type const* emlabcpp::contiguous_tree< Key, Value >::get_node ( node_id  nid) const
inline

◆ make_array_node()

template<typename Key , typename Value >
std::optional< std::pair< node_id, array_handle > > emlabcpp::contiguous_tree< Key, Value >::make_array_node ( )
inline

◆ make_object_node()

template<typename Key , typename Value >
std::optional< std::pair< node_id, object_handle > > emlabcpp::contiguous_tree< Key, Value >::make_object_node ( )
inline

◆ make_value_node()

template<typename Key , typename Value >
std::optional< node_id > emlabcpp::contiguous_tree< Key, Value >::make_value_node ( value_type  val)
inline

◆ size()

template<typename Key , typename Value >
std::size_t emlabcpp::contiguous_tree< Key, Value >::size ( ) const
inline

Member Data Documentation

◆ required_pool_size

template<typename Key , typename Value >
constexpr std::size_t emlabcpp::contiguous_tree< Key, Value >::required_pool_size = 110
staticconstexpr

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