76 return *(
_node->_value);
139 _node->_prev = newNode;
140 _node->_next = newNode;
145 _node->_next = newNode;
146 newNode->
_next = next;
147 next->
_prev = newNode;
162 _node->_prev = newNode;
163 _node->_next = newNode;
168 _node->_prev = newNode;
169 newNode->
_prev = prev;
170 prev->
_next = newNode;
179 T* APIENTRY
Get (SIZE_T index)
const
183 for (INT i = 0; i < index; i++)
185 if (current ==
nullptr)
189 current = current->
_next;
192 return current !=
nullptr ? current->
_value :
nullptr;
209 for (
auto& itr : base)
218 if (
_size == 0)
return;
223 _node->_next = node2;
231 if (
_size == 0)
return;
236 _node->_prev = node2;
249 for (INT i = 0; i <
_size; i++)
251 if (*(current->
_value) == item)
256 current = current->
_next;
257 if (current ==
nullptr)
261 before = current->
_prev;
262 after = current->
_next;
265 if (current !=
nullptr)
267 if (before !=
nullptr && before->
_next !=
nullptr)
268 before->
_next = after;
269 if (after !=
nullptr && after->
_prev !=
nullptr)
270 after->
_prev = before;
296 if (value !=
nullptr) item = *value;
WindowsAPIを集約したプロジェクトファイル
T *APIENTRY Get(SIZE_T index) const
指定したインデックスの値を取得
VOID APIENTRY RemoveLast()
LinkedList<T>の末尾アイテムを削除
VOID APIENTRY Remove(T &item)
LinkedList<T>から値を削除
VOID APIENTRY AddFirst(T &item)
LinkedList<T>へ値を追加
LinkedListIterator< T > APIENTRY begin() const
for(auto n : list){}を使用できるようにするインターフェース
bool APIENTRY Dequeue(T &item)
LinkedList<T>から値を取得
VOID APIENTRY operator=(const LinkedList< T > &base)
同じ型のLinkedList<T>をコピー
VOID APIENTRY RemoveFirst()
LinkedList<T>の先頭アイテムを削除
LinkedListIterator< T > APIENTRY end() const
for(auto n : list){}を使用できるようにするインターフェース
friend LinkedListIterator< T >
Iteratorからのアクセス権を解放
VOID APIENTRY Clear()
領域の開放
VOID APIENTRY AddLast(T &item)
LinkedList<T>へ値を追加
LinkedListNode< T > * _node
SIZE_T APIENTRY Size() const
サイズを取得
T *APIENTRY operator[](SIZE_T index) const
LinkedList<T>を配列操作で取得
VOID APIENTRY Enqueue(T &item)
LinkedList<T>へ値を追加
T &APIENTRY operator*()
データアクセス用オペレータ
LinkedListIterator< T > &APIENTRY operator++()
ノード移動用オペレータ
LinkedListNode< T > * _node
bool APIENTRY operator!=(const LinkedListIterator< T > &comp)
ノード末尾確認用オペレータ
LinkedListNode< T > * _prev
先頭を保持するノード
LinkedListNode< T > * _next
末尾を保持するノード