C/C++ API Reference
Loading...
Searching...
No Matches
pw::containers::internal::KeyedAATree< K > Class Template Reference

Overview

template<typename K>
class pw::containers::internal::KeyedAATree< K >

Base type for an AA tree that templated on the key type only.

This class includes methods that compare keys, but treats all values in the map as simply AATreeItems. This results in less template expansion between maps that share key type, such as size_t. This class should not be used directly. Instead, see the AATree class that is templated on both key and value types.

Template Parameters
KKey type.
Inheritance diagram for pw::containers::internal::KeyedAATree< K >:
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 Key = K
 
using Compare = Function< bool(Key, Key)>
 
using GetKey = Function< Key(const AATreeItem &)>
 
using iterator = AATreeIterator<>
 
- Public Types inherited from pw::containers::internal::GenericAATree
using iterator = AATreeIterator<>
 

Public Member Functions

constexpr KeyedAATree (bool unique_keys, Compare &&compare, GetKey &&get_key)
 
void SetCompare (Compare &&compare)
 
void SetGetKey (GetKey &&get_key)
 
std::pair< iterator, bool > insert (AATreeItem &item)
 
template<class Iterator >
void insert (Iterator first, Iterator last)
 
size_t erase_all (Key key)
 
void merge (KeyedAATree< K > &other)
 
size_t count (Key key)
 
iterator find (Key key)
 
std::pair< iterator, iterator > equal_range (Key key)
 
iterator lower_bound (Key key)
 
iterator upper_bound (Key key)
 
iterator erase_one (AATreeItem &item)
 
iterator erase_range (AATreeItem &first, AATreeItem &last)
 
- Public Member Functions inherited from pw::containers::internal::GenericAATree
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.
 

Member Function Documentation

◆ erase_one()

template<typename K >
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()

template<typename K >
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.


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