ULIS  dev4.0.7
Utility Library for Imaging Systems
Public Types | Public Member Functions | Protected Attributes | List of all members
TForwardList< T > Class Template Reference

The TForwardList class provides a simple dynamic singly linked list class for ULIS interfaces. More...

Inheritance diagram for TForwardList< T >:

Public Types

typedef TForwardListNode< T > tNode
 

Public Member Functions

 TForwardList ()
 
 TForwardList (const TForwardList< T > &iOther)=delete
 
 TForwardList (TForwardList< T > &&iOther)
 
 ~TForwardList ()
 
T & At (uint64 iIndex)
 
const T & At (uint64 iIndex) const
 
T & Back ()
 
const T & Back () const
 
void Clear ()
 
template<class... Args>
void EmplaceBack (Args &&... args)
 
template<class... Args>
void EmplaceFront (Args &&... args)
 
bool Erase (const tNode *iNode)
 
T & Front ()
 
const T & Front () const
 
bool IsEmpty () const
 
tNodeNodeAt (uint64 iIndex)
 
const tNodeNodeAt (uint64 iIndex) const
 
tNodeNodeBack ()
 
const tNodeNodeBack () const
 
tNodeNodeFindFirst (const T &iValue)
 
const tNodeNodeFindFirst (const T &iValue) const
 
tNodeNodeFindFrom (const T &iValue, uint64 iFrom=0)
 
const tNodeNodeFindFrom (const T &iValue, uint64 iFrom=0) const
 
tNodeNodeFront ()
 
const tNodeNodeFront () const
 
TForwardList< T > & operator= (const TForwardList< T > &iOther)=delete
 
TForwardList< T > & operator= (TForwardList< T > &&iOther)=delete
 
T & operator[] (uint64 iIndex)
 
const T & operator[] (uint64 iIndex) const
 
void PopFront ()
 
void PushBack (const T &iValue)
 
void PushBack (T &&iValue)
 
void PushFront (const T &iValue)
 
void PushFront (T &&iValue)
 
uint64 Size () const
 

Protected Attributes

tNodemBack
 The back of the list. Although traversal is one way, this is here to allow easy push back on the list. More...
 
tNodemFront
 The head of the list, start iterating from there. More...
 
uint64 mSize
 The list size. More...
 

Detailed Description

template<typename T>
class TForwardList< T >

The need of a custom TForwardList class rose from the fact that std:: classes cannot be exported easily accross dll boundaries when ULIS is compiled as a shared library.

Member Typedef Documentation

◆ tNode

template<typename T >
typedef TForwardListNode< T > TForwardList< T >::tNode

Constructor & Destructor Documentation

◆ ~TForwardList()

template<typename T >
TForwardList< T >::~TForwardList ( )
inline

Destroy the list and cleanup memory.

◆ TForwardList() [1/3]

template<typename T >
TForwardList< T >::TForwardList ( )
inline

Default constructor ( empty ).

◆ TForwardList() [2/3]

template<typename T >
TForwardList< T >::TForwardList ( const TForwardList< T > &  iOther)
delete

Copy constructor, explicitly removed.

◆ TForwardList() [3/3]

template<typename T >
TForwardList< T >::TForwardList ( TForwardList< T > &&  iOther)
inline

Move constructor. The first object is left in a valid but empty state. The second object steals the state.

Member Function Documentation

◆ At() [1/2]

template<typename T >
T& TForwardList< T >::At ( uint64  iIndex)
inline

Access component at index. Alias of operator[]()

See also
operator[]()

◆ At() [2/2]

template<typename T >
const T& TForwardList< T >::At ( uint64  iIndex) const
inline

Access component at index. Alias of operator[]()

See also
operator[]() const

◆ Back() [1/2]

template<typename T >
T& TForwardList< T >::Back ( )
inline

Access component at back. The behaviour is undefined if the list is empty.

◆ Back() [2/2]

template<typename T >
const T& TForwardList< T >::Back ( ) const
inline

Access const component at back. The behaviour is undefined if the list is empty.

◆ Clear()

template<typename T >
void TForwardList< T >::Clear ( )
inline

Clear the list, deallocating everything.

◆ EmplaceBack()

template<typename T >
template<class... Args>
void TForwardList< T >::EmplaceBack ( Args &&...  args)
inline

EmplaceBack, emplace a new element at back of the list.

◆ EmplaceFront()

template<typename T >
template<class... Args>
void TForwardList< T >::EmplaceFront ( Args &&...  args)
inline

EmplaceFront, emplace a new element at front end of the list.

◆ Erase()

template<typename T >
bool TForwardList< T >::Erase ( const tNode iNode)
inline

Erase element.

◆ Front() [1/2]

template<typename T >
T& TForwardList< T >::Front ( )
inline

Access component at front. The behaviour is undefined if the list is empty.

◆ Front() [2/2]

template<typename T >
const T& TForwardList< T >::Front ( ) const
inline

Access const component at front. The behaviour is undefined if the list is empty.

◆ IsEmpty()

template<typename T >
bool TForwardList< T >::IsEmpty ( ) const
inline

Returns wether the list is empty or not.

◆ NodeAt() [1/2]

template<typename T >
tNode* TForwardList< T >::NodeAt ( uint64  iIndex)
inline

Access node at index.

◆ NodeAt() [2/2]

template<typename T >
const tNode* TForwardList< T >::NodeAt ( uint64  iIndex) const
inline

Access node at index.

◆ NodeBack() [1/2]

template<typename T >
tNode* TForwardList< T >::NodeBack ( )
inline

Access node at back. The behaviour is undefined if the list is empty.

◆ NodeBack() [2/2]

template<typename T >
const tNode* TForwardList< T >::NodeBack ( ) const
inline

Access const node at back. The behaviour is undefined if the list is empty.

◆ NodeFindFirst() [1/2]

template<typename T >
tNode* TForwardList< T >::NodeFindFirst ( const T &  iValue)
inline

Find node with associated value starting from index.

◆ NodeFindFirst() [2/2]

template<typename T >
const tNode* TForwardList< T >::NodeFindFirst ( const T &  iValue) const
inline

Find const node with associated value starting from index.

◆ NodeFindFrom() [1/2]

template<typename T >
tNode* TForwardList< T >::NodeFindFrom ( const T &  iValue,
uint64  iFrom = 0 
)
inline

Find node with associated value starting from index.

◆ NodeFindFrom() [2/2]

template<typename T >
const tNode* TForwardList< T >::NodeFindFrom ( const T &  iValue,
uint64  iFrom = 0 
) const
inline

Find const node with associated value starting from index.

◆ NodeFront() [1/2]

template<typename T >
tNode* TForwardList< T >::NodeFront ( )
inline

Access node at front. The behaviour is undefined if the list is empty.

◆ NodeFront() [2/2]

template<typename T >
const tNode* TForwardList< T >::NodeFront ( ) const
inline

Access const node at front. The behaviour is undefined if the list is empty.

◆ operator=() [1/2]

template<typename T >
TForwardList< T >& TForwardList< T >::operator= ( const TForwardList< T > &  iOther)
delete

Copy Assignment Operator, explicitly removed.

◆ operator=() [2/2]

template<typename T >
TForwardList< T >& TForwardList< T >::operator= ( TForwardList< T > &&  iOther)
delete

Move Assignment Operator, explicitly removed.

◆ operator[]() [1/2]

template<typename T >
T& TForwardList< T >::operator[] ( uint64  iIndex)
inline

Access component at index. The behaviour is undefined if the list has no size. The behaviour is undefined if the index is greater than the size. The behaviour is undefined if the underlying buffer is nullptr, which indicates a corrupted states anyway.

◆ operator[]() [2/2]

template<typename T >
const T& TForwardList< T >::operator[] ( uint64  iIndex) const
inline

Access const component at index. The behaviour is undefined if the list has no size. The behaviour is undefined if the index is greater than the size. The behaviour is undefined if the underlying buffer is nullptr, which indicates a corrupted states anyway.

◆ PopFront()

template<typename T >
void TForwardList< T >::PopFront ( )
inline

PopFront, pop the front element. The behaviour is undefined is the list is empty.

◆ PushBack() [1/2]

template<typename T >
void TForwardList< T >::PushBack ( const T &  iValue)
inline

PushBack, insert a new element at the back of the list.

◆ PushBack() [2/2]

template<typename T >
void TForwardList< T >::PushBack ( T &&  iValue)
inline

PushBack, insert a new element at the back of the list.

◆ PushFront() [1/2]

template<typename T >
void TForwardList< T >::PushFront ( const T &  iValue)
inline

PushFront, insert a new element at the front of the list.

◆ PushFront() [2/2]

template<typename T >
void TForwardList< T >::PushFront ( T &&  iValue)
inline

PushFront, insert a new element at the front of the list.

◆ Size()

template<typename T >
uint64 TForwardList< T >::Size ( ) const
inline

Returns the list size.

Member Data Documentation

◆ mBack

template<typename T >
tNode* TForwardList< T >::mBack
protected

◆ mFront

template<typename T >
tNode* TForwardList< T >::mFront
protected

◆ mSize

template<typename T >
uint64 TForwardList< T >::mSize
protected