sead
Loading...
Searching...
No Matches
sead::TreeMap< Key, Value > Class Template Reference

#include <seadTreeMap.h>

Inherits sead::TreeMapImpl< TreeMapKeyImpl< Key > >.

Inherited by sead::FixedTreeMap< Key, Value, N >.

Classes

struct  ForEachConstContext
class  Node

Public Member Functions

 TreeMap ()
void allocBuffer (s32 node_max, s32 alignment=cDefaultAlignment)
void allocBuffer (s32 node_max, Heap *heap, s32 alignment=cDefaultAlignment)
bool tryAllocBuffer (s32 node_max, s32 alignment=cDefaultAlignment)
bool tryAllocBuffer (s32 node_max, Heap *heap, s32 alignment=cDefaultAlignment)
void freeBuffer ()
void setBuffer (s32 node_max, void *buf)
bool isBufferReady () const
bool isEmpty () const
bool isFull () const
s32 size () const
s32 getSize () const
s32 maxSize () const
Value * find (const Key &key) const
bool contains (const Key &key) const
Value * insert (const Key &key)
Value * insert (const Key &key, const Value &value)
void clear ()
template<typename T>
void forEach (const T &fun) const
Public Member Functions inherited from sead::TreeMapImpl< TreeMapKeyImpl< Key > >
 TreeMapImpl ()
void insert (Node *node)
void erase (const Key &key)
Nodefind (const Key &key) const
bool contains (const Key &key) const
void forEach (const T &fun) const

Protected Member Functions

void eraseNode_ (Node *node)
void eraseNodeForClear_ (TreeMapNode< TreeMapKeyImpl< Key > > *n)

Protected Attributes

FreeList mFreeList
s32 mSize
s32 mNodeMax
Protected Attributes inherited from sead::TreeMapImpl< TreeMapKeyImpl< Key > >
NodemRoot

Additional Inherited Members

Public Types inherited from sead::TreeMapImpl< TreeMapKeyImpl< Key > >
typedef TreeMapNode< Key > Node
Static Public Member Functions inherited from sead::TreeMapImpl< TreeMapKeyImpl< Key > >
static Nodemin (Node *h)
static NodeeraseMin (Node *h)
static NodemoveRedLeft (Node *h)
static NodemoveRedRight (Node *h)
static NodefixUp (Node *h)
static NoderotateLeft (Node *h)
static NoderotateRight (Node *h)
static void flipColors (Node *h)
static bool isRed (Node *h)

Constructor & Destructor Documentation

◆ TreeMap()

template<typename Key, typename Value>
sead::TreeMap< Key, Value >::TreeMap ( )
inline

Member Function Documentation

◆ allocBuffer() [1/2]

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::allocBuffer ( s32 node_max,
s32 alignment = cDefaultAlignment )
inline

◆ allocBuffer() [2/2]

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::allocBuffer ( s32 node_max,
Heap * heap,
s32 alignment = cDefaultAlignment )
inline

◆ tryAllocBuffer() [1/2]

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::tryAllocBuffer ( s32 node_max,
s32 alignment = cDefaultAlignment )
inline

◆ tryAllocBuffer() [2/2]

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::tryAllocBuffer ( s32 node_max,
Heap * heap,
s32 alignment = cDefaultAlignment )
inline

◆ freeBuffer()

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::freeBuffer ( )
inline

◆ setBuffer()

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::setBuffer ( s32 node_max,
void * buf )
inline

◆ isBufferReady()

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::isBufferReady ( ) const
inline

◆ isEmpty()

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::isEmpty ( ) const
inline

◆ isFull()

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::isFull ( ) const
inline

◆ size()

template<typename Key, typename Value>
s32 sead::TreeMap< Key, Value >::size ( ) const
inline

◆ getSize()

template<typename Key, typename Value>
s32 sead::TreeMap< Key, Value >::getSize ( ) const
inline

◆ maxSize()

template<typename Key, typename Value>
s32 sead::TreeMap< Key, Value >::maxSize ( ) const
inline

◆ find()

template<typename Key, typename Value>
Value * sead::TreeMap< Key, Value >::find ( const Key & key) const
inline

◆ contains()

template<typename Key, typename Value>
bool sead::TreeMap< Key, Value >::contains ( const Key & key) const
inline

◆ insert() [1/2]

template<typename Key, typename Value>
Value * sead::TreeMap< Key, Value >::insert ( const Key & key)
inline

◆ insert() [2/2]

template<typename Key, typename Value>
Value * sead::TreeMap< Key, Value >::insert ( const Key & key,
const Value & value )
inline

◆ clear()

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::clear ( )
inline

◆ forEach()

template<typename Key, typename Value>
template<typename T>
void sead::TreeMap< Key, Value >::forEach ( const T & fun) const
inline

◆ eraseNode_()

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::eraseNode_ ( Node * node)
inlineprotected

◆ eraseNodeForClear_()

template<typename Key, typename Value>
void sead::TreeMap< Key, Value >::eraseNodeForClear_ ( TreeMapNode< TreeMapKeyImpl< Key > > * n)
inlineprotected

Member Data Documentation

◆ mFreeList

template<typename Key, typename Value>
FreeList sead::TreeMap< Key, Value >::mFreeList
protected

◆ mSize

template<typename Key, typename Value>
s32 sead::TreeMap< Key, Value >::mSize
protected

◆ mNodeMax

template<typename Key, typename Value>
s32 sead::TreeMap< Key, Value >::mNodeMax
protected