OpenBarnyard
 
Loading...
Searching...
No Matches
TGenericPriList::TNode Class Reference

#include <TDList.h>

Public Types

enum  TUninitialised { Unitiailised }
 

Public Member Functions

template<typename T>
T * As ()
 
void Remove ()
 
void InsertAfter (TNode *a_pNode)
 
void InsertBefore (TNode *a_pNode)
 
TBOOL IsLinked () const
 
void SetPriority (TINT priority)
 
TINT GetPriority () const
 
TNodeoperator= (const TNode &a_pNode)
 

Public Attributes

friend TGenericPriList
 
TNodem_pNext
 
TNodem_pPrev
 
TINT m_iPriority
 

Protected Member Functions

 TNode ()
 
 TNode (TUninitialised)
 
 ~TNode ()
 
TNodeNext () const
 
TNodePrev () const
 

Friends

template<class T>
class TPriList
 
template<class T, class Node>
class Toshi::T2Iterator
 

Detailed Description

Definition at line 85 of file TDList.h.

Member Enumeration Documentation

◆ TUninitialised

Enumerator
Unitiailised 

Definition at line 92 of file TDList.h.

93 {
95 };

Constructor & Destructor Documentation

◆ TNode() [1/2]

TGenericPriList::TNode::TNode ( )
protected

Definition at line 88 of file TPriList.cpp.

89{
90 Reset();
91}

◆ TNode() [2/2]

TGenericPriList::TNode::TNode ( TUninitialised )
protected

Definition at line 83 of file TPriList.cpp.

84{
85}

◆ ~TNode()

TGenericPriList::TNode::~TNode ( )
protected

Definition at line 93 of file TPriList.cpp.

94{
95 Remove();
96}

Member Function Documentation

◆ As()

template<typename T>
T * TGenericPriList::TNode::As ( )
inline

Definition at line 99 of file TDList.h.

99{ return TSTATICCAST( T, this ); }
#define TSTATICCAST(POINTERTYPE, VALUE)
Definition Defines.h:69

◆ GetPriority()

TINT TGenericPriList::TNode::GetPriority ( ) const
inline

Definition at line 117 of file TDList.h.

117{ return m_iPriority; }

◆ InsertAfter()

void TGenericPriList::TNode::InsertAfter ( TNode * a_pNode)

Definition at line 12 of file TPriList.cpp.

13{
14 TASSERT( !IsLinked(), "TNode::InsertAfter - TNode shouldn't be linked" );
15
16 m_iPriority = -0x8000;
17 m_pPrev = a_pNode;
18 m_pNext = a_pNode->m_pNext;
19 a_pNode->m_pNext = this;
20 m_pNext->m_pPrev = this;
21}
#define TASSERT(X,...)
Definition Defines.h:138
TBOOL IsLinked() const
Definition TDList.h:114

◆ InsertBefore()

void TGenericPriList::TNode::InsertBefore ( TNode * a_pNode)

Definition at line 23 of file TPriList.cpp.

24{
25 TASSERT( !IsLinked(), "TNode::InsertBefore - TNode shouldn't be linked" );
26
27 m_iPriority = 0x7FFF;
28 m_pNext = a_pNode;
29 m_pPrev = a_pNode->m_pPrev;
30 a_pNode->m_pPrev = this;
31 m_pPrev->m_pNext = this;
32}

◆ IsLinked()

TBOOL TGenericPriList::TNode::IsLinked ( ) const
inline

Definition at line 114 of file TDList.h.

114{ return this != m_pNext; }

◆ Next()

TNode * TGenericPriList::TNode::Next ( ) const
inlineprotected

Definition at line 106 of file TDList.h.

106{ return m_pNext; }

◆ operator=()

TGenericPriList::TNode & TGenericPriList::TNode::operator= ( const TNode & a_pNode)

Definition at line 98 of file TPriList.cpp.

99{
100 m_pNext = a_pNode.m_pNext;
101 m_pPrev = a_pNode.m_pPrev;
102 SetPriority( a_pNode.GetPriority() );
103 return *this;
104}
void SetPriority(TINT priority)
Definition TDList.h:116

◆ Prev()

TNode * TGenericPriList::TNode::Prev ( ) const
inlineprotected

Definition at line 107 of file TDList.h.

107{ return m_pPrev; }

◆ Remove()

void TGenericPriList::TNode::Remove ( )

Definition at line 113 of file TPriList.cpp.

114{
115 m_pPrev->m_pNext = m_pNext;
116 m_pNext->m_pPrev = m_pPrev;
117 m_pNext = this;
118 m_pPrev = this;
119}

◆ SetPriority()

void TGenericPriList::TNode::SetPriority ( TINT priority)
inline

Definition at line 116 of file TDList.h.

116{ m_iPriority = priority; }

Friends And Related Symbol Documentation

◆ Toshi::T2Iterator

template<class T, class Node>
friend class Toshi::T2Iterator
friend

Definition at line 90 of file TDList.h.

◆ TPriList

template<class T>
friend class TPriList
friend

Definition at line 89 of file TDList.h.

Member Data Documentation

◆ m_iPriority

TINT TGenericPriList::TNode::m_iPriority

Definition at line 127 of file TDList.h.

◆ m_pNext

TNode* TGenericPriList::TNode::m_pNext

Definition at line 125 of file TDList.h.

◆ m_pPrev

TNode* TGenericPriList::TNode::m_pPrev

Definition at line 126 of file TDList.h.

◆ TGenericPriList

friend TGenericPriList::TNode::TGenericPriList

Definition at line 88 of file TDList.h.


The documentation for this class was generated from the following files: