A node occuring in an instance of LinkedList. More...
#include <LinkedList.hpp>
Classes | |
struct | ScopedLock |
Public Member Functions | |
ListNode () | |
ListNode (const T &data) | |
bool | AddChild (ListNode< T > *child, ListNode< T > *successor) volatile |
Locks the node and adds the given child. | |
void | Delete () volatile |
Logically deletes this node. | |
Private Member Functions | |
ListNode< T > * | GetNext () volatile |
Returns the next node in the list. | |
void | TryFixLink (ListNode< T > *node) volatile |
Attempts to physically delete a logically deleted node. | |
Private Attributes | |
T | m_data |
bool | m_locked |
bool | m_deleted |
ListNode< T > * | m_next |
ListNode< T > * | m_dead |
Friends | |
class | Pool |
class | ListIterator |
class | LinkedList |
A node occuring in an instance of LinkedList.
Definition at line 22 of file LinkedList.hpp.
Definition at line 73 of file LinkedList.hpp.
Definition at line 82 of file LinkedList.hpp.
bool ListNode< T >::AddChild | ( | ListNode< T > * | child, | |
ListNode< T > * | successor | |||
) | volatile [inline] |
Locks the node and adds the given child.
Definition at line 93 of file LinkedList.hpp.
References ListNode< T >::m_deleted, and ListNode< T >::m_next.
Referenced by LinkedList< T >::Add(), and LinkedList< T >::CopyList().
void ListNode< T >::Delete | ( | ) | volatile [inline] |
Logically deletes this node.
Node must be locked while doing so to prevent the node from being deleted inside another thread's AddChild() call.
Definition at line 109 of file LinkedList.hpp.
References ListNode< T >::m_deleted.
Referenced by LinkedList< T >::Remove().
Returns the next node in the list.
Tries to physically delete any logically deleted nodes it encounters along the way.
Definition at line 128 of file LinkedList.hpp.
References ListNode< T >::m_deleted, ListNode< T >::m_next, and ListNode< T >::TryFixLink().
Referenced by LinkedList< T >::Add(), LinkedList< T >::Clear(), LinkedList< T >::CopyList(), LinkedList< T >::operator==(), and LinkedList< T >::Remove().
void ListNode< T >::TryFixLink | ( | ListNode< T > * | node | ) | volatile [inline, private] |
Attempts to physically delete a logically deleted node.
Definition at line 117 of file LinkedList.hpp.
References ListNode< T >::m_next.
Referenced by ListNode< T >::GetNext(), and LinkedList< T >::Remove().
friend class LinkedList [friend] |
Definition at line 57 of file LinkedList.hpp.
friend class ListIterator [friend] |
Definition at line 55 of file LinkedList.hpp.
friend class Pool [friend] |
Definition at line 53 of file LinkedList.hpp.
Definition at line 23 of file LinkedList.hpp.
Referenced by LinkedList< T >::Add(), LinkedList< T >::CopyList(), LinkedList< T >::operator==(), and LinkedList< T >::Remove().
Definition at line 31 of file LinkedList.hpp.
Referenced by Pool< T >::AddToDeadList(), and Pool< T >::RaiseTheDead().
Definition at line 27 of file LinkedList.hpp.
Referenced by ListNode< T >::AddChild(), ListNode< T >::Delete(), and ListNode< T >::GetNext().
Definition at line 25 of file LinkedList.hpp.
Definition at line 29 of file LinkedList.hpp.
Referenced by ListNode< T >::AddChild(), Pool< T >::Allocate(), ListNode< T >::GetNext(), Pool< T >::Put(), and ListNode< T >::TryFixLink().