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

Provides a reference semantic double linked list. More...

#include <dlist.h>

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

Public Member Functions

 VDKList ()
 
 ~VDKList ()
 
void add (T *t)
 
void insertAt (T *t, int pos)
 
T * find (T *x)
 
int at (T *x)
 
T * operator[] (int n)
 
int remove (T *x)
 
int size ()
 
void flush ()
 

Detailed Description

template<class T>
class VDKList< T >

Provides a reference semantic double linked list.

VDKList has a reference semantic, all managed objects are pointers to their original values. This calls is widely used for vdk internals.

Implementation notes
I suggest to use typedef like this:
typedef VDKList<someClass> SomeClassList;
typedef VDKListIterator<someClass> SomeClassListIterator;

Constructor & Destructor Documentation

◆ VDKList()

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

Constructor, makes an empty lis

◆ ~VDKList()

template<class T>
VDKList< T >::~VDKList ( )
inline

Destructor. VDKList does not owns object pointed thus not provide to their destruction. Destruction of pointed objects must be explicit.

// delete pointed objects
SomeClassListIterator li(list);
for(li;li++)
delete li.current();

Member Function Documentation

◆ add()

template<class T>
void VDKList< T >::add ( T *  t)
inline

Appends a pointer to type T to the list. To mantain reference integrity no same pointer will be added twice.

Parameters
ttype T pointer

Prepends a pointer to type T to the list. To mantain reference integrity no same pointer will be added twice.

Parameters
ttype T pointer

◆ at()

template<class T>
int VDKList< T >::at ( T *  x)

find position of type<T> object, returns ordinal position, -1 on failure

Parameters
xaddress to be searched for

◆ find()

template<class T>
T * VDKList< T >::find ( T *  x)

Membership operator, return NULL if not found

Parameters
xaddress to be searched for

◆ flush()

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

Flushes list

◆ insertAt()

template<class T>
void VDKList< T >::insertAt ( T *  t,
int  pos 
)
inline

Insert a pointer to type T to the list. To mantain reference integrity no same pointer will be added twice.

Parameters
ttype T pointer
posordinal position

◆ operator[]()

template<class T>
T* VDKList< T >::operator[] ( int  n)
inline

Ordinal access operator

◆ remove()

template<class T>
int VDKList< T >::remove ( T *  x)

Remove a pointer from list

Parameters
xaddress to be removed

◆ size()

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

Returns list size


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