Logo Search packages:      
Sourcecode: djvulibre version File versions

GPList< TYPE > Class Template Reference

#include <GContainer.h>

Inheritance diagram for GPList< TYPE >:

GListTemplate< GP< TYPE >, GPBase >

List of all members.


Detailed Description

template<class TYPE>
class GPList< TYPE >

Doubly linked lists for smart pointers. Template class GList<TYPE># implements a doubly linked list of elements of type GP<TYPE># (see {GSmartPointer.h}). Significantly smaller code sizes can be achieved by using this class instead of the more general GArray<GP<TYPE>>#. This class only implement constructors. See class {GListTemplate} and {GPosition} for a description of all access methods.

Definition at line 1032 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 GP< TYPE > &elt)
GPosition contains (const GP< TYPE > &elt) const
void del (GPosition &pos)
void empty ()
void first (GPosition &pos) const
GPosition firstpos () const
 GPList ()
void insert_after (GPosition pos, const GP< TYPE > &elt)
void insert_before (GPosition pos, GListTemplate< GP< TYPE >, GPBase > &fromlist, GPosition &frompos)
void insert_before (GPosition pos, const GP< TYPE > &elt)
bool isempty () const
void last (GPosition &pos) const
GPosition lastpos () const
GP< TYPE > * next (GPosition &pos)
const GP< TYPE > * next (GPosition &pos) const
int nth (unsigned int n, GPosition &pos) const
GPosition nth (unsigned int n) const
 operator GPosition () const
GPListoperator= (const GPList &r)
int operator== (const GListTemplate< GP< TYPE >, GPBase > &l2) const
const GP< TYPE > & operator[] (GPosition pos) const
GP< TYPE > & operator[] (GPosition pos)
void prepend (const GP< TYPE > &elt)
GP< TYPE > * prev (GPosition &pos)
const GP< TYPE > * prev (GPosition &pos) const
int search (const GP< 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