Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

ListNode< T > Class Template Reference

A node occuring in an instance of LinkedList. More...

#include <LinkedList.hpp>

List of all members.

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

m_data
bool m_locked
bool m_deleted
ListNode< T > * m_next
ListNode< T > * m_dead

Friends

class Pool
class ListIterator
class LinkedList

Detailed Description

template<typename T>
class ListNode< T >

A node occuring in an instance of LinkedList.

Definition at line 22 of file LinkedList.hpp.


Constructor & Destructor Documentation

template<typename T >
ListNode< T >::ListNode (  )  [inline]

Definition at line 73 of file LinkedList.hpp.

template<typename T >
ListNode< T >::ListNode ( const T &  data  )  [inline]

Definition at line 82 of file LinkedList.hpp.


Member Function Documentation

template<typename T >
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().

template<typename T >
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().

template<typename T >
ListNode< T > * ListNode< T >::GetNext (  )  volatile [inline, private]

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().

template<typename T >
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().


Friends And Related Function Documentation

template<typename T>
friend class LinkedList [friend]

Definition at line 57 of file LinkedList.hpp.

template<typename T>
friend class ListIterator [friend]

Definition at line 55 of file LinkedList.hpp.

template<typename T>
friend class Pool [friend]

Definition at line 53 of file LinkedList.hpp.


Member Data Documentation

template<typename T>
T ListNode< T >::m_data [private]
template<typename T>
ListNode<T>* ListNode< T >::m_dead [private]

Definition at line 31 of file LinkedList.hpp.

Referenced by Pool< T >::AddToDeadList(), and Pool< T >::RaiseTheDead().

template<typename T>
bool ListNode< T >::m_deleted [private]
template<typename T>
bool ListNode< T >::m_locked [private]

Definition at line 25 of file LinkedList.hpp.

template<typename T>
ListNode<T>* ListNode< T >::m_next [private]

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


6 Jan 2011 Doxygen 1.6.3