template<typename Value>
sead::OrderedSet class

This is essentially std::set<Value>. Values are stored in a red-black tree in an order determined by the partial order defined for Value (via operator<).

Base classes

template<typename Key>
class TreeMapImpl<OrderedSetItemImpl<Value>>

Public types

class Node
using MapImpl = TreeMapImpl<OrderedSetItemImpl<Value>>
using Node = TreeMapNode<OrderedSetItemImpl<Value>>

Public functions

void finalize()
auto allocBuffer(s32 node_max, Heap* heap, s32 alignment = sizeof(void*)) -> bool
void setBuffer(s32 node_max, void* buffer)
void freeBuffer()
Should only be used if the buffer was allocated using allocBuffer.
auto insert(const Value& value) -> const Value*
void clear()
auto find(const Value& value) const -> Node*
template<typename Callable>
void forEach(const Callable& delegate) const
auto startIterating() const -> Node*
auto nextNode(Node* node) const -> Node*
void insert(Node* node)
void erase(const OrderedSetItemImpl<Value>& key)
auto find(const OrderedSetItemImpl<Value>& key) const -> Node*
auto startIterating() const -> Node*
auto nextNode(Node* node) const -> Node*

Protected static functions

static void forEach(Node* start, const Callable& callable)
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)

Protected functions

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

Protected variables

Node* mRoot

Typedef documentation

template<typename Value>
using sead::OrderedSet<Value>::Node = TreeMapNode<OrderedSetItemImpl<Value>>

Function documentation

template<typename Value>
void sead::OrderedSet<Value>::finalize()

Clears the set and frees the allocated buffer (if needed). Should only be used if the buffer was allocated using allocBuffer.

template<typename Value>
void sead::OrderedSet<Value>::insert(Node* node)

template<typename Value>
void sead::OrderedSet<Value>::erase(const OrderedSetItemImpl<Value>& key)

template<typename Value>
Node* sead::OrderedSet<Value>::find(const OrderedSetItemImpl<Value>& key) const

template<typename Value>
Node* sead::OrderedSet<Value>::startIterating() const

template<typename Value>
Node* sead::OrderedSet<Value>::nextNode(Node* node) const

template<typename Value>
static void sead::OrderedSet<Value>::forEach(Node* start, const Callable& callable) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::startIterating(Node* node) protected

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

template<typename Value>
static Node* sead::OrderedSet<Value>::rotateLeft(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::rotateRight(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::moveRedLeft(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::moveRedRight(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::findMin(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::eraseMin(Node* node) protected

template<typename Value>
static Node* sead::OrderedSet<Value>::fixUp(Node* node) protected

template<typename Value>
static bool sead::OrderedSet<Value>::isRed(const Node* node) protected

template<typename Value>
static void sead::OrderedSet<Value>::flipColors(Node* node) protected

template<typename Value>
Node* sead::OrderedSet<Value>::insert(Node* root, Node* node) protected

template<typename Value>
Node* sead::OrderedSet<Value>::erase(Node* root, const OrderedSetItemImpl<Value>& key) protected

template<typename Value>
Node* sead::OrderedSet<Value>::find(Node* root, const OrderedSetItemImpl<Value>& key) const protected

Variable documentation

template<typename Value>
Node* sead::OrderedSet<Value>::mRoot protected