Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

GPosition Class Reference

#include <GContainer.h>

Inheritance diagram for GPosition:

List of all members.


Detailed Description

Generic iterator class. This class represents a position in a list (see {GList}) or a map (see {GMap}). As demonstrated by the following examples, this class should be used to iterate over the objects contained in a list or a map: {verbatim} void print_list(GList<GString> a) { for (GPosition i = a ; i; ++i) DjVuPrintMessage("%s\n", (const char*) a[i] ); }

void print_list_backwards(GList<GString> a) { for (GPosition i = a.lastpos() ; i; --i) DjVuPrintMessage("%s\n", (const char*) a[i] ); } {verbatim} GPosition objects should only be used with the list or map for which they have been created (using the member functions firstpos# or lastpos# of the container). Furthermore, you should never use a GPosition object which designates a list element which has been removed from the list (using member function del# or by other means.)

Definition at line 766 of file GContainer.h.


Public Member Functions

const Node * check (void *c) const
Node * check (void *c)
 GPosition (Node *p, void *c)
 GPosition (const GPosition &ref)
 GPosition ()
 operator int () const
int operator! () const
GPositionoperator++ ()
GPositionoperator-- ()

Protected Member Functions

void throw_invalid (void *c) const no_return

Protected Attributes

void * cont
Node * ptr

Friends

class GListBase
class GSetBase

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

Generated by  Doxygen 1.6.0   Back to index