1#ifndef NW_UT_LINKLIST_H_
2#define NW_UT_LINKLIST_H_
5#include <nw/ut/ut_Inlines.h>
6#include <nw/ut/ut_Iterator.h>
8namespace nw {
namespace ut {
111template <
typename T,
PtrDiff TNOffset>
121 using Base::size_type;
122 using Base::difference_type;
140 Node* baseNode = GetBaseNode();
141 Node* node = p == NULL ? baseNode : GetNodeFromPointer(p);
143 return node == baseNode ? NULL : GetPointerFromNode(node);
148 const Node* baseNode = GetBaseNode();
149 const Node* node = p == NULL ? baseNode : GetNodeFromPointer(p);
151 return node == baseNode ? NULL : GetPointerFromNode(node);
156 Node* baseNode = GetBaseNode();
157 Node* node = p == NULL ? baseNode : GetNodeFromPointer(p);
159 return node == baseNode ? NULL : GetPointerFromNode(node);
164 const Node* baseNode = GetBaseNode();
165 const Node* node = p == NULL ? baseNode : GetNodeFromPointer(p);
167 return node == baseNode ? NULL : GetPointerFromNode(node);
173 return reinterpret_cast<
Node*>(
reinterpret_cast<
IntPtr>(p) + TNOffset);
178 return reinterpret_cast<
const Node*>(
reinterpret_cast<
IntPtr>(p) + TNOffset);
184 return reinterpret_cast<
pointer>(
reinterpret_cast<
IntPtr>(p) - TNOffset);
Definition ut_LinkList.h:19
Self * GetPrev() const
Definition ut_LinkList.h:37
friend bool operator==(const Self &r1, const Self &r2)
Definition ut_LinkList.h:42
LinkListNode Self
Definition ut_LinkList.h:24
Self * GetNext() const
Definition ut_LinkList.h:32
friend bool operator!=(const Self &r1, const Self &r2)
Definition ut_LinkList.h:47
LinkListNode()
Definition ut_LinkList.h:26
Self * m_pPrev
Definition ut_LinkList.h:54
Self * m_pNext
Definition ut_LinkList.h:53
Definition ut_LinkList.h:113
const value_type & const_reference
Definition ut_LinkList.h:128
LinkList Self
Definition ut_LinkList.h:118
const_pointer GetNext(const_pointer p) const
Definition ut_LinkList.h:162
value_type * pointer
Definition ut_LinkList.h:125
static const_pointer GetPointerFromNode(const Node *p)
Definition ut_LinkList.h:186
static const Node * GetNodeFromPointer(const_pointer p)
Definition ut_LinkList.h:175
bool IsEmpty() const
Definition ut_LinkList.h:193
const_pointer GetPrev(const_pointer p) const
Definition ut_LinkList.h:146
pointer GetNext(pointer p)
Definition ut_LinkList.h:154
const value_type * const_pointer
Definition ut_LinkList.h:126
LinkList()
Definition ut_LinkList.h:131
size_type GetSize() const
Definition ut_LinkList.h:192
static Node * GetNodeFromPointer(pointer p)
Definition ut_LinkList.h:170
pointer GetPrev(pointer p)
Definition ut_LinkList.h:138
internal::LinkListImpl Base
Definition ut_LinkList.h:115
static pointer GetPointerFromNode(Node *p)
Definition ut_LinkList.h:181
T value_type
Definition ut_LinkList.h:124
value_type & reference
Definition ut_LinkList.h:127
std::bidirectional_iterator_tag iterator_category
Definition ut_LinkList.h:129
Definition ut_LinkList.h:63
bool empty() const
Definition ut_LinkList.h:90
LinkListImpl()
Definition ut_LinkList.h:80
Node m_BaseNode
Definition ut_LinkList.h:105
const Node * GetBaseNode() const
Definition ut_LinkList.h:94
const value_type * const_pointer
Definition ut_LinkList.h:75
Node * GetBaseNode()
Definition ut_LinkList.h:93
std::bidirectional_iterator_tag iterator_category
Definition ut_LinkList.h:78
value_type & reference
Definition ut_LinkList.h:76
value_type * pointer
Definition ut_LinkList.h:74
~LinkListImpl()
Definition ut_LinkList.h:85
size_type m_Size
Definition ut_LinkList.h:104
LinkListImpl Self
Definition ut_LinkList.h:68
u32 size_type
Definition ut_LinkList.h:69
Node value_type
Definition ut_LinkList.h:73
PtrDiff difference_type
Definition ut_LinkList.h:70
LinkListNode Node
Definition ut_LinkList.h:72
const value_type & const_reference
Definition ut_LinkList.h:77
void Initialize_()
Definition ut_LinkList.h:97
size_type size() const
Definition ut_LinkList.h:89
Definition ut_LinkList.h:12
Definition ut_CriticalSection.h:6
Definition math_Constant.cpp:5
signed long PtrDiff
Definition types.h:24
unsigned long IntPtr
Definition types.h:23
#define NW_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition types.h:31