Yggdrasill  0.2
Public Member Functions | Protected Attributes | Friends | List of all members
ygg::RBTreeNodeBase< Node, Options, Tag > Class Template Reference

Base class (template) to supply your node class with metainformation. More...

#include <rbtree.hpp>

Inheritance diagram for ygg::RBTreeNodeBase< Node, Options, Tag >:
ygg::bst::BSTNodeBase< Node, Tag, rbtree_internal::ColorParentStorage< Node, Options::compress_color > > ygg::ITreeNodeBase< Node, NodeTraits, Options, Tag >

Public Member Functions

void set_color (rbtree_internal::Color new_color) noexcept
 
void make_black () noexcept
 
void make_red () noexcept
 
rbtree_internal::Color get_color () const noexcept
 
void swap_parent_with (Node *other) noexcept
 
void swap_color_with (Node *other) noexcept
 
void set_parent (Node *new_parent) noexcept
 
Node * get_parent () const noexcept
 
std::enable_if_t< InnerPC::parent_reference, Node *&> get_parent () const noexcept
 
void set_left (Node *new_left) noexcept
 
void set_right (Node *new_right) noexcept
 
Node *& get_left () noexcept
 
Node *const & get_left () const noexcept
 
Node *& get_right () noexcept
 
Node *const & get_right () const noexcept
 
size_t get_depth () const noexcept
 

Protected Attributes

Node * _bst_children [2]
 
rbtree_internal::ColorParentStorage< Node, Options::compress_color > _bst_parent
 

Friends

class rbtree_internal::ColorParentStorage< Node, Options::compress_color >
 

Detailed Description

template<class Node, class Options = DefaultOptions, class Tag = int>
class ygg::RBTreeNodeBase< Node, Options, Tag >

Base class (template) to supply your node class with metainformation.

The class you use as nodes for the Red-Black Tree must derive from this class (template). It supplies your class with the necessary members to contain the linking between the tree nodes.

Template Parameters
NodeThe node class itself. Yes, that's the class derived from this template. This sounds weird, but is correct. See the examples if you're confused.
optionsThe options class (a version of TreeOptions) that you parameterize the tree with. (See the options parameter of RBTree.)
TagThe tag used to identify the tree that this node should be inserted into. See RBTree for details.

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