• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

GPosition Class Reference

Generic iterator class. More...

#include <GContainer.h>

Inheritance diagram for GPosition:

Inheritance graph
[legend]

List of all members.


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
GPosition & operator++ ()
GPosition & operator-- ()

Protected Member Functions

void throw_invalid (void *c) const no_return

Protected Attributes

void * cont
Node * ptr

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 691 of file GContainer.h.


Constructor & Destructor Documentation

GPosition::GPosition (  )  [inline]

Creates a null GPosition object.

Definition at line 695 of file GContainer.h.

GPosition::GPosition ( const GPosition &  ref  )  [inline]

Creates a copy of a GPosition object.

Definition at line 697 of file GContainer.h.

GPosition::GPosition ( Node *  p,
void *  c 
) [inline]

Definition at line 711 of file GContainer.h.


Member Function Documentation

const Node* GPosition::check ( void *  c  )  const [inline]

Definition at line 715 of file GContainer.h.

Node* GPosition::check ( void *  c  )  [inline]

Definition at line 713 of file GContainer.h.

GPosition::operator int ( void   )  const [inline]

Tests whether this GPosition object is non null.

Definition at line 699 of file GContainer.h.

int GPosition::operator! (  )  const [inline]

Tests whether this GPosition object is null.

Definition at line 702 of file GContainer.h.

GPosition& GPosition::operator++ (  )  [inline]

Moves this GPosition object to the next object in the container.

Definition at line 705 of file GContainer.h.

GPosition& GPosition::operator-- (  )  [inline]

Moves this GPosition object to the previous object in the container.

Definition at line 708 of file GContainer.h.

void GPosition::throw_invalid ( void *  c  )  const [protected]

Definition at line 357 of file GContainer.cpp.


Member Data Documentation

void* GPosition::cont [protected]

Definition at line 725 of file GContainer.h.

Node* GPosition::ptr [protected]

Definition at line 724 of file GContainer.h.


The documentation for this class was generated from the following files:
  • GContainer.h
  • GContainer.cpp

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal