template<typename Key>
sead::TreeMapImpl class

Sorted associative container, implemented using a left-leaning red-black tree. For an explanation of the algorithm, see https://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf

Derived classes

template<typename Key, typename Node>
class IntrusiveTreeMap

Public types

using Node = TreeMapNode<Key>

Public functions

void insert(Node* node)
void erase(const Key& key)
void clear()
auto find(const Key& key) const -> Node*
template<typename Callable>
void forEach(const Callable& callable) const
auto startIterating() const -> Node*
auto nextNode(Node* node) const -> Node*

Protected static functions

static auto startIterating(Node* node) -> Node*
static auto rotateLeft(Node* node) -> Node*
static auto rotateRight(Node* node) -> Node*
static auto moveRedLeft(Node* node) -> Node*
static auto moveRedRight(Node* node) -> Node*
static auto findMin(Node* node) -> Node*
static auto eraseMin(Node* node) -> Node*
static auto fixUp(Node* node) -> Node*
static auto isRed(const Node* node) -> bool
static void flipColors(Node* node)
template<typename Callable>
static void forEach(Node* start, const Callable& callable)

Protected functions

auto insert(Node* root, Node* node) -> Node*
auto erase(Node* root, const Key& key) -> Node*
auto find(Node* root, const Key& key) const -> Node*

Protected variables

Node* mRoot

Function documentation

template<typename Key>
static Node* sead::TreeMapImpl<Key>::startIterating(Node* node) protected

Returns the left most child of a given node, marking each node with its parent along the way.