sead
Loading...
Searching...
No Matches
sead::ObjList< T > Class Template Reference

#include <seadObjList.h>

Inherits sead::ListImpl.

Inherited by sead::FixedObjList< T, N >.

Classes

class  constIterator
class  iterator
struct  Node
class  reverseConstIterator
class  reverseIterator
class  reverseRobustIterator
class  robustIterator

Public Member Functions

 ObjList ()
 ObjList (s32 limitNum, void *buf)
void allocBuffer (s32 limitNum, s32 alignment=cDefaultAlignment)
void allocBuffer (s32 limitNum, Heap *heap, s32 alignment=cDefaultAlignment)
bool tryAllocBuffer (s32 limitNum, s32 alignment=cDefaultAlignment)
bool tryAllocBuffer (s32 limitNum, Heap *heap, s32 alignment=cDefaultAlignment)
void freeBuffer ()
void setBuffer (s32 limitNum, void *buf)
bool isBufferReady () const
bool isFull () const
s32 maxSize () const
void clear ()
T * birthBack ()
T * tryBirthBack ()
T * birthFront ()
T * tryBirthFront ()
T * birthBefore (const T *basis)
T * tryBirthBefore (const T *basis)
T * birthAfter (const T *basis)
T * tryBirthAfter (const T *basis)
void erase (T *obj)
T * front () const
T * back () const
T * prev (const T *obj) const
T * next (const T *obj) const
T * nth (s32 index) const
s32 indexOf (const T *obj) const
bool isNodeLinked (const T *obj) const
void swap (T *obj1, T *obj2)
void moveAfter (T *basis, T *obj)
void moveBefore (T *basis, T *obj)
void sort ()
void sort (CompareCallback cmp)
void mergeSort ()
void mergeSort (CompareCallback cmp)
T * find (const T *obj) const
T * find (const T *obj, CompareCallback cmp) const
void uniq ()
void uniq (CompareCallback cmp)
iterator begin ()
constIterator begin () const
iterator end ()
constIterator end () const
constIterator constBegin () const
constIterator constEnd () const
robustIterator robustBegin ()
robustIterator robustEnd ()
reverseIterator reverseBegin ()
reverseConstIterator reverseBegin () const
reverseIterator reverseEnd ()
reverseConstIterator reverseEnd () const
reverseConstIterator reverseConstBegin () const
reverseConstIterator reverseConstEnd () const
reverseRobustIterator reverseRobustBegin ()
reverseRobustIterator reverseRobustEnd ()
Public Member Functions inherited from sead::ListImpl
 ListImpl ()
bool isEmpty () const
s32 size () const
void reverse ()
void shuffle ()
void shuffle (Random *random)
bool checkLinks () const

Protected Types

using CompareCallback = s32 (*)(const T* a, const T* b)
Protected Types inherited from sead::ListImpl
using CompareCallbackImpl = s32 (*)(const void* a, const void* b)

Protected Member Functions

ListNodeobjToListNode (const T *obj) const
T * listNodeToObj (const ListNode *node) const
T * listNodeToObjWithNullCheck (const ListNode *node) const
Protected Member Functions inherited from sead::ListImpl
 ListImpl (const ListImpl &)
void sort (s32 offset, CompareCallbackImpl cmp)
void mergeSort (s32 offset, CompareCallbackImpl cmp)
void pushBack (ListNode *n)
void pushFront (ListNode *n)
ListNodepopBack ()
ListNodepopFront ()
void insertBefore (ListNode *basis, ListNode *n)
void insertAfter (ListNode *basis, ListNode *n)
void erase (ListNode *n)
ListNodefront () const
ListNodeback () const
ListNodenth (s32 index) const
s32 indexOf (const ListNode *n) const
void swap (ListNode *n1, ListNode *n2)
void moveAfter (ListNode *basis, ListNode *n)
void moveBefore (ListNode *basis, ListNode *n)
ListNodefind (const void *ptr, s32 offset, CompareCallbackImpl cmp) const
void uniq (s32 offset, CompareCallbackImpl cmp)
void clear ()
void unsafeClear ()
ListImploperator= (const ListImpl &)

Static Protected Member Functions

static s32 compareT (const T *a, const T *b)
Static Protected Member Functions inherited from sead::ListImpl
static void mergeSortImpl (ListNode *front, ListNode *back, s32 num, s32 offset, CompareCallbackImpl cmp)

Protected Attributes

FreeList mFreeList
s32 mLimitNum
Protected Attributes inherited from sead::ListImpl
ListNode mStartEnd
s32 mCount

Member Typedef Documentation

◆ CompareCallback

template<typename T>
using sead::ObjList< T >::CompareCallback = s32 (*)(const T* a, const T* b)
protected

Constructor & Destructor Documentation

◆ ObjList() [1/2]

template<typename T>
sead::ObjList< T >::ObjList ( )
inline

◆ ObjList() [2/2]

template<typename T>
sead::ObjList< T >::ObjList ( s32 limitNum,
void * buf )
inline

Member Function Documentation

◆ allocBuffer() [1/2]

template<typename T>
void sead::ObjList< T >::allocBuffer ( s32 limitNum,
s32 alignment = cDefaultAlignment )
inline

◆ allocBuffer() [2/2]

template<typename T>
void sead::ObjList< T >::allocBuffer ( s32 limitNum,
Heap * heap,
s32 alignment = cDefaultAlignment )
inline

◆ tryAllocBuffer() [1/2]

template<typename T>
bool sead::ObjList< T >::tryAllocBuffer ( s32 limitNum,
s32 alignment = cDefaultAlignment )
inline

◆ tryAllocBuffer() [2/2]

template<typename T>
bool sead::ObjList< T >::tryAllocBuffer ( s32 limitNum,
Heap * heap,
s32 alignment = cDefaultAlignment )
inline

◆ freeBuffer()

template<typename T>
void sead::ObjList< T >::freeBuffer ( )
inline

◆ setBuffer()

template<typename T>
void sead::ObjList< T >::setBuffer ( s32 limitNum,
void * buf )
inline

◆ isBufferReady()

template<typename T>
bool sead::ObjList< T >::isBufferReady ( ) const
inline

◆ isFull()

template<typename T>
bool sead::ObjList< T >::isFull ( ) const
inline

◆ maxSize()

template<typename T>
s32 sead::ObjList< T >::maxSize ( ) const
inline

◆ clear()

template<typename T>
void sead::ObjList< T >::clear ( )
inline

◆ birthBack()

template<typename T>
T * sead::ObjList< T >::birthBack ( )
inline

◆ tryBirthBack()

template<typename T>
T * sead::ObjList< T >::tryBirthBack ( )
inline

◆ birthFront()

template<typename T>
T * sead::ObjList< T >::birthFront ( )
inline

◆ tryBirthFront()

template<typename T>
T * sead::ObjList< T >::tryBirthFront ( )
inline

◆ birthBefore()

template<typename T>
T * sead::ObjList< T >::birthBefore ( const T * basis)
inline

◆ tryBirthBefore()

template<typename T>
T * sead::ObjList< T >::tryBirthBefore ( const T * basis)
inline

◆ birthAfter()

template<typename T>
T * sead::ObjList< T >::birthAfter ( const T * basis)
inline

◆ tryBirthAfter()

template<typename T>
T * sead::ObjList< T >::tryBirthAfter ( const T * basis)
inline

◆ erase()

template<typename T>
void sead::ObjList< T >::erase ( T * obj)
inline

◆ front()

template<typename T>
T * sead::ObjList< T >::front ( ) const
inline

◆ back()

template<typename T>
T * sead::ObjList< T >::back ( ) const
inline

◆ prev()

template<typename T>
T * sead::ObjList< T >::prev ( const T * obj) const
inline

◆ next()

template<typename T>
T * sead::ObjList< T >::next ( const T * obj) const
inline

◆ nth()

template<typename T>
T * sead::ObjList< T >::nth ( s32 index) const
inline

◆ indexOf()

template<typename T>
s32 sead::ObjList< T >::indexOf ( const T * obj) const
inline

◆ isNodeLinked()

template<typename T>
bool sead::ObjList< T >::isNodeLinked ( const T * obj) const
inline

◆ swap()

template<typename T>
void sead::ObjList< T >::swap ( T * obj1,
T * obj2 )
inline

◆ moveAfter()

template<typename T>
void sead::ObjList< T >::moveAfter ( T * basis,
T * obj )
inline

◆ moveBefore()

template<typename T>
void sead::ObjList< T >::moveBefore ( T * basis,
T * obj )
inline

◆ sort() [1/2]

template<typename T>
void sead::ObjList< T >::sort ( )
inline

◆ sort() [2/2]

template<typename T>
void sead::ObjList< T >::sort ( CompareCallback cmp)
inline

◆ mergeSort() [1/2]

template<typename T>
void sead::ObjList< T >::mergeSort ( )
inline

◆ mergeSort() [2/2]

template<typename T>
void sead::ObjList< T >::mergeSort ( CompareCallback cmp)
inline

◆ find() [1/2]

template<typename T>
T * sead::ObjList< T >::find ( const T * obj) const
inline

◆ find() [2/2]

template<typename T>
T * sead::ObjList< T >::find ( const T * obj,
CompareCallback cmp ) const
inline

◆ uniq() [1/2]

template<typename T>
void sead::ObjList< T >::uniq ( )
inline

◆ uniq() [2/2]

template<typename T>
void sead::ObjList< T >::uniq ( CompareCallback cmp)
inline

◆ begin() [1/2]

template<typename T>
iterator sead::ObjList< T >::begin ( )
inline

◆ begin() [2/2]

template<typename T>
constIterator sead::ObjList< T >::begin ( ) const
inline

◆ end() [1/2]

template<typename T>
iterator sead::ObjList< T >::end ( )
inline

◆ end() [2/2]

template<typename T>
constIterator sead::ObjList< T >::end ( ) const
inline

◆ constBegin()

template<typename T>
constIterator sead::ObjList< T >::constBegin ( ) const
inline

◆ constEnd()

template<typename T>
constIterator sead::ObjList< T >::constEnd ( ) const
inline

◆ robustBegin()

template<typename T>
robustIterator sead::ObjList< T >::robustBegin ( )
inline

◆ robustEnd()

template<typename T>
robustIterator sead::ObjList< T >::robustEnd ( )
inline

◆ reverseBegin() [1/2]

template<typename T>
reverseIterator sead::ObjList< T >::reverseBegin ( )
inline

◆ reverseBegin() [2/2]

template<typename T>
reverseConstIterator sead::ObjList< T >::reverseBegin ( ) const
inline

◆ reverseEnd() [1/2]

template<typename T>
reverseIterator sead::ObjList< T >::reverseEnd ( )
inline

◆ reverseEnd() [2/2]

template<typename T>
reverseConstIterator sead::ObjList< T >::reverseEnd ( ) const
inline

◆ reverseConstBegin()

template<typename T>
reverseConstIterator sead::ObjList< T >::reverseConstBegin ( ) const
inline

◆ reverseConstEnd()

template<typename T>
reverseConstIterator sead::ObjList< T >::reverseConstEnd ( ) const
inline

◆ reverseRobustBegin()

template<typename T>
reverseRobustIterator sead::ObjList< T >::reverseRobustBegin ( )
inline

◆ reverseRobustEnd()

template<typename T>
reverseRobustIterator sead::ObjList< T >::reverseRobustEnd ( )
inline

◆ compareT()

template<typename T>
s32 sead::ObjList< T >::compareT ( const T * a,
const T * b )
inlinestaticprotected

◆ objToListNode()

template<typename T>
ListNode * sead::ObjList< T >::objToListNode ( const T * obj) const
inlineprotected

◆ listNodeToObj()

template<typename T>
T * sead::ObjList< T >::listNodeToObj ( const ListNode * node) const
inlineprotected

◆ listNodeToObjWithNullCheck()

template<typename T>
T * sead::ObjList< T >::listNodeToObjWithNullCheck ( const ListNode * node) const
inlineprotected

Member Data Documentation

◆ mFreeList

template<typename T>
FreeList sead::ObjList< T >::mFreeList
protected

◆ mLimitNum

template<typename T>
s32 sead::ObjList< T >::mLimitNum
protected