vdk 2.4.0
Public Member Functions | Friends | List of all members
VDKValueList< T > Class Template Reference

provides a templatized double-linked list More...

#include <value_sem_list.h>

Inheritance diagram for VDKValueList< T >:
Inheritance graph
[legend]

Public Member Functions

 VDKValueList ()
 
 VDKValueList (const VDKValueList< T > &l)
 
VDKValueList< T > & operator= (const VDKValueList< T > &l)
 
virtual ~VDKValueList ()
 
void add (const T &t)
 
void push (const T &t)
 
int insert (const T &t, bool unique=false)
 
void flush ()
 
T & operator[] (int n)
 
T * find (T &t)
 
int size ()
 
bool unlink (int ndx)
 
int at (T &t)
 

Friends

class VDKValueListIterator< T >
 

Detailed Description

template<class T>
class VDKValueList< T >

provides a templatized double-linked list

Overview
VDKValueList has a value semantic, so all managed object are copied from original ones values. VDKValueList can manage all T type object provided that:
  • T t has a default constructor: T::T()
  • T t has a copy initializer: T::T(T& t)
  • T t has an assignement operator: T& T::operator=(T& t)
  • T t has an equality operator: int T::operator==(T& t)
  • T t has a less-than operator: int T::operator<(T& t)
Implementation notes
I suggest to use typedef's like:
typedef VDKValueList<someClass> SomeClassVDKValueListList;
typedef VDKValueListIterator<SomeClass> SomeClassVDKValueListIterator;

Constructor & Destructor Documentation

◆ VDKValueList() [1/2]

template<class T>
VDKValueList< T >::VDKValueList ( )
inline

Constructor makes an empty list

◆ VDKValueList() [2/2]

template<class T>
VDKValueList< T >::VDKValueList ( const VDKValueList< T > &  l)

Copy-initializer

◆ ~VDKValueList()

template<class T >
VDKValueList< T >::~VDKValueList ( )
virtual

Destructor

Member Function Documentation

◆ add()

template<class T>
void VDKValueList< T >::add ( const T &  t)

Append a type T to list

◆ at()

template<class T>
int VDKValueList< T >::at ( T &  t)

Returns ordinal position of an element

◆ find()

template<class T>
T * VDKValueList< T >::find ( T &  t)

membership operator Returns T* NULL if not found

◆ flush()

template<class T >
void VDKValueList< T >::flush ( )

Flushes list

◆ insert()

template<class T>
int VDKValueList< T >::insert ( const T &  t,
bool  unique = false 
)

Insert in order

Parameters
uniqueif true denies duplicate key

◆ operator=()

template<class T>
VDKValueList< T > & VDKValueList< T >::operator= ( const VDKValueList< T > &  l)

Assignement operator

◆ operator[]()

template<class T >
T & VDKValueList< T >::operator[] ( int  n)

Ordinal access

◆ push()

template<class T>
void VDKValueList< T >::push ( const T &  t)

Prepend a type T to list

◆ size()

template<class T>
int VDKValueList< T >::size ( )
inline

Returns list size

◆ unlink()

template<class T >
bool VDKValueList< T >::unlink ( int  ndx)

Unlink an element form list

Parameters
ndxordinal position of the element to be removed

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