Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::HtdRbTreeVtl< Key, Compare > Class Template Reference

Hybrid red-black tree with virtual node destructor. More...

#include <tpl_hRbTree.H>

Inheritance diagram for Aleph::HtdRbTreeVtl< Key, Compare >:
[legend]
Collaboration diagram for Aleph::HtdRbTreeVtl< Key, Compare >:
[legend]

Public Types

using Base = HtdRbTree< Key, Compare >
 
using Node = typename Base::Node
 
- Public Types inherited from Aleph::HtdRbTree< Key, Compare >
using Color = unsigned char
 Color type for red-black nodes.
 
using Node = RbNode< Key >
 The node type used by this tree.
 
using key_type = Key
 The key type stored in nodes.
 

Additional Inherited Members

- Public Member Functions inherited from Aleph::HtdRbTree< Key, Compare >
Compare & key_comp () noexcept
 Returns a reference to the comparison functor.
 
const Compare & key_comp () const noexcept
 
Compare & get_compare () noexcept
 Alias for key_comp()
 
constexpr const Compare & get_compare () const noexcept
 
 HtdRbTree (Compare __cmp=Compare()) noexcept
 Default constructor.
 
void swap (HtdRbTree &tree) noexcept
 Swap contents with another tree.
 
 HtdRbTree (HtdRbTree &&tree) noexcept
 Move constructor.
 
HtdRbTreeoperator= (HtdRbTree &&tree) noexcept
 Move assignment.
 
 HtdRbTree (const HtdRbTree &)=delete
 Copy constructor deleted.
 
HtdRbTreeoperator= (const HtdRbTree &)=delete
 Copy assignment deleted.
 
virtual ~HtdRbTree ()=default
 Virtual destructor.
 
constexpr bool is_empty () const noexcept
 Check if tree is empty.
 
constexpr size_t size () const noexcept
 Get number of nodes in tree.
 
void reset () noexcept
 Reset tree (does not free nodes)
 
Nodeinsert (Node *p) noexcept
 Insert a node into the tree.
 
Nodesearch_or_insert (Node *p) noexcept
 Search for key or insert if not found.
 
Nodeinsert_dup (Node *p) noexcept
 Insert allowing duplicate keys.
 
Nodesearch (const Key &key) const noexcept
 Search for a key.
 
Noderemove (const Key &key) noexcept
 Remove node with given key.
 
Node *& getRoot () noexcept
 Get reference to root pointer.
 
NodegetRoot () const noexcept
 Get root pointer (const)
 
void verifyRedBlack () const
 Verify red-black tree invariants (DEBUG mode).
 
bool verify () const noexcept
 Verify tree is a valid red-black BST.
 

Detailed Description

template<class Key, class Compare = Aleph::less<Key>>
class Aleph::HtdRbTreeVtl< Key, Compare >

Hybrid red-black tree with virtual node destructor.

Same as HtdRbTree but uses RbNodeVtl which has virtual destructor.

Definition at line 1031 of file tpl_hRbTree.H.

Member Typedef Documentation

◆ Base

template<class Key , class Compare = Aleph::less<Key>>
using Aleph::HtdRbTreeVtl< Key, Compare >::Base = HtdRbTree<Key, Compare>

Definition at line 1034 of file tpl_hRbTree.H.

◆ Node

template<class Key , class Compare = Aleph::less<Key>>
using Aleph::HtdRbTreeVtl< Key, Compare >::Node = typename Base::Node

Definition at line 1035 of file tpl_hRbTree.H.


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