OROCHI
 
Loading...
Searching...
No Matches
GxList.inl
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10
11//---------------------------------------------------------------------------
14//---------------------------------------------------------------------------
16{
17 return GxList::GxIterator<void*>(this);
18}
19
20//---------------------------------------------------------------------------
23//---------------------------------------------------------------------------
25{
26 GxList::GxIterator<void*> iterator(this);
27 iterator.getBottom();
28 iterator.getNext();
29 return iterator;
30}
31
32//---------------------------------------------------------------------------
33// const配列
36//---------------------------------------------------------------------------
37template <class T>
38GX_FORCE_INLINE const T GxList::GxIterator<T>::operator[](u32 i) const
39{
40 auto* pNode = _pList->getNode(i);
41 if(pNode)
42 {
43 return static_cast<T>(pNode->getObject());
44 }
45 return nullptr;
46}
47
48//---------------------------------------------------------------------------
49// 配列
52//---------------------------------------------------------------------------
53template <class T>
54GX_FORCE_INLINE T GxList::GxIterator<T>::operator[](u32 i)
55{
56 auto* pNode = _pList->getNode(i);
57 if(pNode)
58 {
59 return static_cast<T>(pNode->getObject());
60 }
61 return nullptr;
62}
63
64//---------------------------------------------------------------------------
65// 先頭を取得
67//---------------------------------------------------------------------------
68template <class T>
69GX_FORCE_INLINE T GxList::GxIterator<T>::getTop(void)
70{
71 _pCurrent = _pList->getTop();
72 if(_pCurrent)
73 {
74 return static_cast<T>(_pCurrent->getObject());
75 }
76 return nullptr;
77}
78
79//---------------------------------------------------------------------------
80// 終端を取得
82//---------------------------------------------------------------------------
83template <class T>
84GX_FORCE_INLINE T GxList::GxIterator<T>::getBottom(void)
85{
86 _pCurrent = _pList->getBottom();
87 if(_pCurrent)
88 {
89 return static_cast<T>(_pCurrent->getObject());
90 }
91 return nullptr;
92}
93
94//---------------------------------------------------------------------------
95// 前を取得
97//---------------------------------------------------------------------------
98template <class T>
100{
101 if(_pCurrent)
102 {
103 _pCurrent = _pCurrent->getPrevious();
104 if(_pCurrent)
105 {
106 return static_cast<T>(_pCurrent->getObject());
107 }
108 }
109 return nullptr;
110}
111
112//---------------------------------------------------------------------------
113// 現在のオブジェクトを取得
115//---------------------------------------------------------------------------
116template <class T>
117GX_FORCE_INLINE T GxList::GxIterator<T>::getCurrent(void) const
118{
119 if(_pCurrent)
120 {
121 return static_cast<T>(_pCurrent->getObject());
122 }
123 return nullptr;
124}
125
126//---------------------------------------------------------------------------
127// 次を取得
129//---------------------------------------------------------------------------
130template <class T>
131GX_FORCE_INLINE T GxList::GxIterator<T>::getNext(void)
132{
133 if(_pCurrent)
134 {
135 _pCurrent = _pCurrent->getNext();
136 if(_pCurrent)
137 {
138 return static_cast<T>(_pCurrent->getObject());
139 }
140 }
141 return nullptr;
142}
イテレータ
Definition GxList.h:168
GX_FORCE_INLINE T getNext(void)
次を取得
Definition GxList.inl:131
GX_FORCE_INLINE const T operator[](u32 i) const
const配列
Definition GxList.inl:38
GX_FORCE_INLINE T getPrevious(void)
前を取得
Definition GxList.inl:99
GX_FORCE_INLINE T getBottom(void)
終端を取得
Definition GxList.inl:84
GX_FORCE_INLINE T getTop(void)
先頭を取得
Definition GxList.inl:69
GX_FORCE_INLINE T getCurrent(void) const
現在のオブジェクトを取得
Definition GxList.inl:117
GX_FORCE_INLINE GxIterator< void * > begin(void)
先頭を取得
Definition GxList.inl:15
GX_FORCE_INLINE GxIterator< void * > end(void)
終端を取得
Definition GxList.inl:24