OpenMesh.Tools.Utils.ListT

A Linked List data structure.

A doubly linked list data structure based originally on the one in ArcLib. The interface has been modified to mimic the STL std.list type more closely, and a few new members have been added.

Author:
William V. Baxter III

Date:
04 Sep 2007

struct ListIter (T,bool is_reverse = false);
Iterator type for ListT

T val ();
Return the value referred to by the iterator

T* ptr ();
Return a pointer to the value referred to by the iterator

void opPostInc ();
iter++

void opAddAssign (int i);
++iter

void opPostDec ();
iter--

void opSubAssign (int i);
--iter

struct ListT (T);
Linked-list data structure

Uses a doubly-linked list structure internally.

iterator append (T newData);
append an item to the list

void opCatAssign (T newData);
Also append an item to the list using L ~= item syntax.

iterator prepend (T newData);
prepend an item onto the head of list

iterator insert (iterator iter, T newData);
Insert an element before iter

iterator erase (iterator iter);
remove node pointed to by iter from the list

returns the iterator to the node following the removed node.

int length ();
Returns the length of the list

int size ();
Returns the size of the list, same as length()

bool empty ();
Simple function to tell if list is empty or not

void clear ();
Clear all data from the list

bool opIn_r (T data);
'item in list' implementation. O(N) performance.

iterator find (T data);
Find item list, return an iterator. O(N) performance.

If not found returns this.end()

iterator begin ();
Returns the current data from the list

T front ();
return the first element in the list

T back ();
return the last element in the list

struct Node ;
The internal node structure with prev/next pointers and the user data payload

Page was generated with CanDyDOC on Fri Oct 12 16:12:20 2007