OpenNI 1.5.7
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XnListT< T, TAlloc > Class Template Reference

#include <XnListT.h>

Inheritance diagram for XnListT< T, TAlloc >:
Inheritance graph
[legend]

Classes

class  ConstIterator
 
class  Iterator
 

Public Types

typedef XnLinkedNodeT< T > LinkedNode
 
typedef T TValue
 
typedef TAlloc TAllocator
 

Public Member Functions

 XnListT ()
 
 XnListT (const XnListT &other)
 
XnListToperator= (const XnListT &other)
 
 ~XnListT ()
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
Iterator ReverseBegin ()
 
ConstIterator ReverseBegin () const
 
Iterator ReverseEnd ()
 
ConstIterator ReverseEnd () const
 
XnStatus AddAfter (ConstIterator where, T const &value)
 
XnStatus AddBefore (ConstIterator where, T const &value)
 
XnStatus AddFirst (T const &value)
 
XnStatus AddLast (T const &value)
 
ConstIterator Find (T const &value) const
 
Iterator Find (T const &value)
 
XnStatus Remove (ConstIterator where)
 
XnStatus Remove (T const &value)
 
XnStatus Clear ()
 
XnBool IsEmpty () const
 
XnUInt32 Size () const
 
void CopyTo (T *pArray) const
 

Protected Member Functions

XnStatus InsertAfter (LinkedNode *pAfter, T const &val)
 

Protected Attributes

LinkedNode m_anchor
 
XnUInt32 m_nSize
 

Detailed Description

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
class XnListT< T, TAlloc >

A linked list.

Template Parameters
TThe type of value in the list
TAlloc[Optional] A class for allocating and deallocating nodes in the list. The allocator must have two static methods: Allocate() and Deallocate().

Member Typedef Documentation

◆ LinkedNode

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
typedef XnLinkedNodeT<T> XnListT< T, TAlloc >::LinkedNode

◆ TAllocator

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
typedef TAlloc XnListT< T, TAlloc >::TAllocator

◆ TValue

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
typedef T XnListT< T, TAlloc >::TValue

Constructor & Destructor Documentation

◆ XnListT() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnListT< T, TAlloc >::XnListT ( )
inline

◆ XnListT() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnListT< T, TAlloc >::XnListT ( const XnListT< T, TAlloc > &  other)
inline

◆ ~XnListT()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnListT< T, TAlloc >::~XnListT ( )
inline

Member Function Documentation

◆ AddAfter()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::AddAfter ( ConstIterator  where,
T const &  value 
)
inline

Add a new value after the object pointed to by the iterator

Parameters
where[in] iterator to the position after which to add the new value
value[in] The value to add to the list
Returns
XN_STATUS_ALLOC_FAILED failed to allocate new node XN_STATUS_ILLEGAL_POSITION iterator is invalid

◆ AddBefore()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::AddBefore ( ConstIterator  where,
T const &  value 
)
inline

Add a new value before the object pointed to by the iterator

Parameters
where[in] iterator to the position before which to add the new value
value[in] The value to add to the list
Returns
XN_STATUS_ALLOC_FAILED failed to allocate new node XN_STATUS_ILLEGAL_POSITION iterator is invalid

◆ AddFirst()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::AddFirst ( T const &  value)
inline

Add a new value at the beginning of list

Parameters
value[in] The value to add to the head of the list
Returns
XN_STATUS_ALLOC_FAILED failed to allocate new node

◆ AddLast()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::AddLast ( T const &  value)
inline

Add a new value at the end of the list

Parameters
value[in] The value to add to the tail of the list
Returns
XN_STATUS_ALLOC_FAILED failed to allocate new node

◆ Begin() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
Iterator XnListT< T, TAlloc >::Begin ( )
inline

An iterator to the first entry of the list (non-const version)

◆ Begin() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
ConstIterator XnListT< T, TAlloc >::Begin ( ) const
inline

An iterator to the first entry of the list (const version)

◆ Clear()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::Clear ( )
inline

Remove all entries from the list

◆ CopyTo()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
void XnListT< T, TAlloc >::CopyTo ( T *  pArray) const
inline

Copies all values in the list to an array.

Parameters
pArrayA pre-allocated array that values should be copied to. The allocation size can be determined using Size().

◆ End() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
Iterator XnListT< T, TAlloc >::End ( )
inline

An iterator 1to the end of the list (non-const version). This position is invalid.

◆ End() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
ConstIterator XnListT< T, TAlloc >::End ( ) const
inline

An iterator to the end of the list (const version). This position is invalid.

◆ Find() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
ConstIterator XnListT< T, TAlloc >::Find ( T const &  value) const
inline

Get an iterator pointing to a value in the list.

Parameters
value[in] The searched value
Returns
End() if value doesn't exist

◆ Find() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
Iterator XnListT< T, TAlloc >::Find ( T const &  value)
inline

Get an iterator pointing to a value in the list.

Parameters
value[in] The searched value
Returns
End() if value doesn't exist

◆ InsertAfter()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::InsertAfter ( LinkedNode pAfter,
T const &  val 
)
inlineprotected

Add a new value to the list

Parameters
pAfter[in] The node after which to add the new value
val[in] The value to add to the list
Returns
XN_STATUS_ALLOC_FAILED Failed to add to the list because no nodes are available,

◆ IsEmpty()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnBool XnListT< T, TAlloc >::IsEmpty ( ) const
inline

Check if list is empty

◆ operator=()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnListT& XnListT< T, TAlloc >::operator= ( const XnListT< T, TAlloc > &  other)
inline

◆ Remove() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::Remove ( ConstIterator  where)
inline

Remove a value from the list

Parameters
where[in] Iterator pointing to an entry in the list
Returns
XN_STATUS_ILLEGAL_POSITION iterator was invalid

◆ Remove() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnStatus XnListT< T, TAlloc >::Remove ( T const &  value)
inline

Removes the first occurrence of a value from the list

Parameters
value[in] The value to be removed
Returns
XN_STATUS_NO_MATCH value wasn't found.

◆ ReverseBegin() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
Iterator XnListT< T, TAlloc >::ReverseBegin ( )
inline

An iterator to the last entry of the list (non-const version)

◆ ReverseBegin() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
ConstIterator XnListT< T, TAlloc >::ReverseBegin ( ) const
inline

An iterator to the last entry of the list (const version)

◆ ReverseEnd() [1/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
Iterator XnListT< T, TAlloc >::ReverseEnd ( )
inline

An iterator to the beginning of the list (non-const version). This position is invalid.

◆ ReverseEnd() [2/2]

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
ConstIterator XnListT< T, TAlloc >::ReverseEnd ( ) const
inline

An iterator to the beginning of the list (const version). This position is invalid.

◆ Size()

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnUInt32 XnListT< T, TAlloc >::Size ( ) const
inline

Gets the current size of the list

Member Data Documentation

◆ m_anchor

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
LinkedNode XnListT< T, TAlloc >::m_anchor
protected

◆ m_nSize

template<class T, class TAlloc = XnLinkedNodeDefaultAllocatorT<T>>
XnUInt32 XnListT< T, TAlloc >::m_nSize
protected

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