Logo Search packages:      
Sourcecode: djvulibre version File versions

GList< TYPE > Class Template Reference

#include <GContainer.h>

Inheritance diagram for GList< TYPE >:

GListTemplate< TYPE, TYPE >

List of all members.

Detailed Description

template<class TYPE>
class GList< TYPE >

Doubly linked lists. Template class GList<TYPE># implements a doubly linked list of elements of type TYPE#. This class only implement constructors. See class {GListTemplate} and {GPosition} for a description of all access methods.

Definition at line 938 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.

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

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
 GList ()
void insert_after (GPosition pos, const TYPE &elt)
void insert_before (GPosition pos, GListTemplate< TYPE, TYPE > &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
GListoperator= (const GList &r)
int operator== (const GListTemplate< TYPE, TYPE > &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