class GContainerBase

Abstract base class for all containers.

Inheritance:


Public Methods

[more]virtual ~GContainerBase()
Virtual destructor.
[more]virtual int size() const
Returns the number of contained elements.
[more]virtual GPosition firstpos() const
Returns a GPosition for the first element in the container.
[more]virtual GPosition lastpos() const
Returns a GPosition for the last element in the container.
[more]virtual void nextpos(GPosition &pos) const
Moves position pos to the next element in the container.
[more]virtual void prevpos(GPosition &pos) const
Moves position pos to the previous element in the container.


Documentation

Abstract base class for all containers. This abstract class contains virtual functions for iterating over a container regardless of its nature (GArray, GList, or GMap) and of the type of its elements. In particular, functions nextpos and prevpos are called when using the pre-increment or pre-decrement operators on a GPosition object.
ovirtual ~GContainerBase()
Virtual destructor.

ovirtual int size() const
Returns the number of contained elements.

ovirtual GPosition firstpos() const
Returns a GPosition for the first element in the container. The GPosition object is marked as invalid when the container is empty.

ovirtual GPosition lastpos() const
Returns a GPosition for the last element in the container. The GPosition object is marked as invalid when the container is empty.

ovirtual void nextpos(GPosition &pos) const
Moves position pos to the next element in the container. Argument pos is set to an invalid position when (a) there is no next element in the container, or (b) the input value of pos is not a valid position for this container. This function is called by GPosition::operator++.

ovirtual void prevpos(GPosition &pos) const
Moves position pos to the previous element in the container. Argument pos is set to an invalid position when (a) there is no previous element in the container, or (b) the input value of pos is not a valid position for this container. This function is called by GPosition::operator--.


Direct child classes:
GContainer

Alphabetic index HTML hierarchy of classes or Java