Pigweed
 
Loading...
Searching...
No Matches
pw::containers::internal::GenericAATree Class Reference

#include <aa_tree.h>

Inheritance diagram for pw::containers::internal::GenericAATree:
pw::containers::internal::AATree< Key, T > pw::containers::internal::AATree< const T &, T > pw::containers::internal::AATree< size_t, pw::allocator::FastSortedItem< BestFitBlock< uintptr_t > > > pw::containers::internal::AATree< size_t, pw::allocator::FastSortedItem< BlockType > > pw::containers::internal::AATree< size_t, pw::allocator::FastSortedItem< WorstFitBlock< uintptr_t > > > pw::containers::internal::AATree< K, V >

Public Types

using iterator = AATreeIterator<>
 

Public Member Functions

constexpr GenericAATree (bool unique_keys)
 
 ~GenericAATree ()
 Destructor.
 
 GenericAATree (const GenericAATree &)=delete
 
GenericAATreeoperator= (const GenericAATree &)=delete
 
constexpr bool unique_keys () const
 
void SetRoot (AATreeItem *item)
 Sets the tree's root item.
 
constexpr iterator begin () noexcept
 Returns a pointer to the first item, if any.
 
constexpr iterator end () noexcept
 Returns a pointer to the last item, if any.
 
constexpr bool empty () const
 Returns whether the tree has zero items or not.
 
size_t size () const
 Returns the number of items in the tree.
 
constexpr size_t max_size () const noexcept
 
void clear ()
 
iterator erase_one (AATreeItem &item)
 
iterator erase_range (AATreeItem &first, AATreeItem &last)
 
void swap (GenericAATree &other)
 Exchanges this tree's items with the other tree's items.
 

Friends

template<typename , typename >
class AATree
 

Detailed Description

Base type for an AA tree that is devoid of template parameters.

This generic class does not implement any functionality that requires comparing keys, and should not be used directly. Instead, see the AATree class that is templated on methods to get and compare keys.

Constructor & Destructor Documentation

◆ GenericAATree()

constexpr pw::containers::internal::GenericAATree::GenericAATree ( bool  unique_keys)
inlineexplicitconstexpr

Constructs an empty AA tree.

Parameters
unique_keysIndicates if this tree requires unique keys or allows duplicate keys.

Member Function Documentation

◆ clear()

void pw::containers::internal::GenericAATree::clear ( )

Removes all items from the tree and leaves it empty.

The items themselves are not destructed.

◆ erase_one()

iterator pw::containers::internal::GenericAATree::erase_one ( AATreeItem &  item)

Removes an item from the tree and returns an iterator to the item after the removed item.

The items themselves are not destructed.

◆ erase_range()

iterator pw::containers::internal::GenericAATree::erase_range ( AATreeItem &  first,
AATreeItem &  last 
)

Removes the items from first, inclusive, to last, exclusive from the tree and returns an iterator to the item after the last removed item.

The items themselves are not destructed.

◆ max_size()

constexpr size_t pw::containers::internal::GenericAATree::max_size ( ) const
inlineconstexprnoexcept

Returns how many items can be added.

As an intrusive container, this is effectively unbounded.


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