Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::intrusive_avl_tree_base< ID_ >::link_type Struct Reference

#include <intrusive_avl_tree.h>

Public Member Functions

 ~link_type ()

Friends

class intrusive_avl_tree_base

Detailed Description

template<size_t ID_>
struct etl::intrusive_avl_tree_base< ID_ >::link_type

Base for elements of this AVL tree. It's expected that a tree node type is inherited from this base.

Almost nothing is exposed from this type as public (or even protected) API - this is done deliberately and by design, so that:

  • impose as little "intrusive"-ness as possible when you inherit your nodes from this base.
  • don't worry about possible name conflicts
  • hide implementation details

Constructor & Destructor Documentation

◆ ~link_type()

template<size_t ID_>
etl::intrusive_avl_tree_base< ID_ >::link_type::~link_type ( )
inline

Destructor of a tree link. Complexity: O(log(N)). Might rotate the tree as necessary to keep it balanced. NB! The tree itself is not the real owner (of memory) of its nodes (and their inherited links). The real owner (aka the user) of a node could destroy it as he/she wishes, with or without prior explicit erasure from its tree. So, if the node link happens to be still linked to a tree during its destruction, then we have to unlink it - otherwise the node's parent and its former children will keep dangling pointers to the node, which will essentially break the tree consistency and lead to UB.


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