template<typename Value>
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
Protected variables
Typedef documentation
#include <container/seadTreeMap.h>
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.
#include <container/seadTreeMap.h>
template<typename Value>
void sead:: OrderedSet<Value>:: insert(Node* node)
#include <container/seadTreeMap.h>
template<typename Value>
void sead:: OrderedSet<Value>:: erase(const OrderedSetItemImpl<Value>& key)
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: find(const OrderedSetItemImpl<Value>& key) const
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: startIterating() const
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: nextNode(Node* node) const
#include <container/seadTreeMap.h>
template<typename Value>
static void sead:: OrderedSet<Value>:: forEach(Node* start,
const Callable& callable) protected
#include <container/seadTreeMap.h>
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.
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: rotateLeft(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: rotateRight(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: moveRedLeft(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: moveRedRight(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: findMin(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: eraseMin(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static Node* sead:: OrderedSet<Value>:: fixUp(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static bool sead:: OrderedSet<Value>:: isRed(const Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
static void sead:: OrderedSet<Value>:: flipColors(Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: insert(Node* root,
Node* node) protected
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: erase(Node* root,
const OrderedSetItemImpl<Value>& key) protected
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: find(Node* root,
const OrderedSetItemImpl<Value>& key) const protected
Variable documentation
#include <container/seadTreeMap.h>
template<typename Value>
Node* sead:: OrderedSet<Value>:: mRoot protected