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

Top-down red-black tree with virtual destructor. More...

#include <tpl_tdRbTree.H>

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

Private Types

using Base = GenTdRbTree< RbNodeVtl, Key, Compare >
 

Additional Inherited Members

- Public Types inherited from Aleph::GenTdRbTree< NodeType, Key, Compare >
using Node = NodeType< Key >
 
using key_type = Key
 
using compare_type = Compare
 
- Public Member Functions inherited from Aleph::GenTdRbTree< NodeType, Key, Compare >
 GenTdRbTree () noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_default_constructible_v< Compare >)
 Builds an empty tree with a comparison criteria built by default.
 
 GenTdRbTree (const Compare &__cmp) noexcept(std::is_nothrow_default_constructible_v< Node > and std::is_nothrow_copy_constructible_v< Compare >)
 Builds an empty tree with the comparison criteria __cmp.
 
 GenTdRbTree (GenTdRbTree &&other) noexcept(bin_node_detail::nothrow_header_from_v< Node > and bin_node_detail::nothrow_compare_taken_v< Compare >)
 Takes the nodes and the comparison criteria of other, which is left empty and can take nodes again.
 
GenTdRbTree & operator= (GenTdRbTree &&other) noexcept(std::is_nothrow_move_assignable_v< Compare >)
 Takes the nodes and the comparison criteria of other, which is left empty.
 
 GenTdRbTree (const GenTdRbTree &)=delete
 Deleted copy constructor (use explicit copy if needed)
 
GenTdRbTree & operator= (const GenTdRbTree &)=delete
 Deleted copy assignment.
 
void reset () noexcept
 Reset tree to empty state (does not free nodes)
 
void swap (GenTdRbTree &other) noexcept(std::is_nothrow_swappable_v< Compare >)
 Swaps in constant time the nodes and the comparison criteria of this and other.
 
virtual ~GenTdRbTree ()=default
 
size_t size () const noexcept
 Get number of nodes in tree (O(1))
 
bool is_empty () const noexcept
 Check if tree is empty.
 
Compare & get_compare () noexcept
 Get reference to comparator.
 
const Compare & get_compare () const noexcept
 
Node * insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >)
 Insert a node into the tree.
 
Node * insert_dup (Node *p) noexcept(nothrow_compare_v< Compare, Key >)
 Insert a node, allowing duplicates.
 
Node * search_or_insert (Node *p) noexcept(nothrow_compare_v< Compare, Key >)
 Search for key or insert if not found.
 
Node * search (const Key &key) const noexcept(nothrow_compare_v< Compare, Key >)
 Search for a key in the tree.
 
Node * remove (const Key &key) noexcept(nothrow_compare_v< Compare, Key >)
 Remove and return node with given key.
 
Node *& getRoot () noexcept
 Get reference to root pointer.
 
Node * getRoot () const noexcept
 Get const root pointer

 
bool verifyRedBlack () const noexcept
 Verify that tree satisfies all red-black properties.
 
bool verify () const
 Verify the red-black properties and the order of the keys.
 

Detailed Description

template<typename Key, class Compare = Aleph::less<Key>>
requires StrictWeakOrder<Compare, Key>
class Aleph::TdRbTreeVtl< Key, Compare >

Top-down red-black tree with virtual destructor.

Template Parameters
KeyThe type of keys stored in the tree.
CompareComparison functor (default: Aleph::less<Key>).

Definition at line 959 of file tpl_tdRbTree.H.

Member Typedef Documentation

◆ Base

template<typename Key , class Compare = Aleph::less<Key>>
using Aleph::TdRbTreeVtl< Key, Compare >::Base = GenTdRbTree<RbNodeVtl, Key, Compare>
private

Definition at line 961 of file tpl_tdRbTree.H.


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