datastructures 0.1.0
Loading...
Searching...
No Matches
datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion > Struct Template Reference

Persistent AVL Tree Node. More...

#include <_persistent_avl.hpp>

Public Attributes

TItem item
 The key / key, value pair.
 
avl_sign_type sign = 0
 Determines whether the node is leaning to one side or balanced.
 
avl_node_ptr< persistent_avl_node, TAlloc > left = nullptr
 The left sub-tree.
 
avl_node_ptr< persistent_avl_node, TAlloc > right = nullptr
 The right sub-tree.
 
TVersion version
 The version which the node was created in.
 

Detailed Description

template<class TItem, class TAlloc, class TVersion>
struct datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >

Persistent AVL Tree Node.

A tree node that stores an item of a given type, its children and the sign.

Does not store the parent, because otherwise I would need to keep track of the parent version and multiple parents.

Template Parameters
TItemThe item type, usually the const key_type or std::pair<const key_type, value_type>.
TAllocAllocator type to rebind the node allocator from, should be the item allocator.

Member Data Documentation

◆ item

template<class TItem , class TAlloc , class TVersion >
TItem datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >::item

The key / key, value pair.

◆ left

template<class TItem , class TAlloc , class TVersion >
avl_node_ptr<persistent_avl_node, TAlloc> datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >::left = nullptr

The left sub-tree.

◆ right

template<class TItem , class TAlloc , class TVersion >
avl_node_ptr<persistent_avl_node, TAlloc> datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >::right = nullptr

The right sub-tree.

◆ sign

template<class TItem , class TAlloc , class TVersion >
avl_sign_type datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >::sign = 0

Determines whether the node is leaning to one side or balanced.

It is defined the following way: sign := height(right) - height(left).

◆ version

template<class TItem , class TAlloc , class TVersion >
TVersion datastructures::detail::persistent_avl_node< TItem, TAlloc, TVersion >::version

The version which the node was created in.


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