Logo Search packages:      
Sourcecode: djvulibre version File versions

GListTemplate< TYPE, TI > Class Template Reference

#include <GContainer.h>

Inheritance diagram for GListTemplate< TYPE, TI >:

List of all members.

Detailed Description

template<class TYPE, class TI>
class GListTemplate< TYPE, TI >

Common base class for all doubly linked lists. Class {GListTemplate} implements all methods for manipulating lists of of objects of type TYPE#. You should not however create instances of this class. You should instead use class {GList} or {GPList}.

Definition at line 814 of file GContainer.h.

Doubly Linked Lists

The template classes {GList} and {GPList} implement a doubly linked list of objects of arbitrary types. Member functions are provided to search the list for an element, to insert or delete elements at specified positions. Theses template class must be able to access {itemize} a default constructor TYPE::TYPE()#, a copy constructor TYPE::TYPE(const TYPE &)#, optionally a destructor TYPE::~TYPE()#, and optionally a comparison operator TYPE::operator==(const TYPE &)#. {itemize} Doubly linked lists.

static Node * newnode (const TI &elt)
int operator== (const GListImpl< TI > &l2) const
int search (const TI &elt, GPosition &pos) const

Public Member Functions

void append (const TYPE &elt)
GPosition contains (const TYPE &elt) const
void del (GPosition &pos)
void empty ()
void first (GPosition &pos) const
GPosition firstpos () const
void insert_after (GPosition pos, const TYPE &elt)
void insert_before (GPosition pos, GListTemplate< TYPE, TI > &fromlist, GPosition &frompos)
void insert_before (GPosition pos, const TYPE &elt)
int isempty () const
void last (GPosition &pos) const
GPosition lastpos () const
TYPE * next (GPosition &pos)
const TYPE * next (GPosition &pos) const
int nth (unsigned int n, GPosition &pos) const
GPosition nth (unsigned int n) const
 operator GPosition () const
int operator== (const GListTemplate< TYPE, TI > &l2) const
const TYPE & operator[] (GPosition pos) const
TYPE & operator[] (GPosition pos)
void prepend (const TYPE &elt)
TYPE * prev (GPosition &pos)
const TYPE * prev (GPosition &pos) const
int search (const TYPE &elt, GPosition &pos) const
int size () const

Protected Types

typedef GCONT ListNode< TI > LNode

Protected Member Functions

void append (Node *n)
void insert_after (GPosition pos, Node *n)
void insert_before (GPosition pos, GListBase &fromlist, GPosition &frompos)
void insert_before (GPosition pos, Node *n)
void prepend (Node *n)

Protected Attributes

Node head
int nelem
const Traits & traits

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

Generated by  Doxygen 1.6.0   Back to index