GCGlib  0.04.228
GCG Graphics Engine
gcgITERATOR Class Referenceabstract

Generic abstract class to allow iterations over the several GCGlib data structures. The gcgITERATOR::next() returns the next object until it is NULL. The returned object type depends on the data structure and commonly is a specialization of gcgORDEREDNODE, gcgDOUBLELINK or gcgLINK classes. While iteration is being done, the original data structure must not be changed by insertions, removals or moves. Iterators copies all needed information to iterate over the nodes and are not allowed to change its associated data structure. A data structure can have several gcgITERATOR instances working at a time. The gcgITERATOR object must be deleted after use. More...

#include <gcg.h>

Inheritance diagram for gcgITERATOR:
gcgCLASS

Public Member Functions

virtual ~gcgITERATOR ()
 Destroys the iterator object and releases all of its resources. The iterated data structure does not change. Destruction is dependent on the underlying data structure. More...
 
virtual gcgDATAnext ()=0
 Gets the next object from the data structure. While iterating, the underlying data structure must not be changed by insertions, removals or moves. The returned pointer is guaranteed to not being accessed again by the iterator. More...
 
- Public Member Functions inherited from gcgCLASS
void * operator new (size_t size)
 Defines a new operator to be used by instatiations of GCGlib classes instead the global one. More...
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 Defines a new operator to be used by instantiations of GCGlib classes instead the global one. Returns a NULL pointer instead of throwing an exception if an error occurs. More...
 
void * operator new[] (size_t size)
 Defines a new operator to be used by GCGlib array allocations instead the global one. More...
 
void * operator new[] (size_t size, const std::nothrow_t &) throw ()
 Defines a new operator to be used by vector allocations instead the global one. More...
 
void operator delete (void *p)
 Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
 
void operator delete (void *p, const std::nothrow_t &) throw ()
 Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
 
void operator delete[] (void *p)
 Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
 
void operator delete[] (void *p, const std::nothrow_t &) throw ()
 Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
 

Detailed Description

Generic abstract class to allow iterations over the several GCGlib data structures. The gcgITERATOR::next() returns the next object until it is NULL. The returned object type depends on the data structure and commonly is a specialization of gcgORDEREDNODE, gcgDOUBLELINK or gcgLINK classes. While iteration is being done, the original data structure must not be changed by insertions, removals or moves. Iterators copies all needed information to iterate over the nodes and are not allowed to change its associated data structure. A data structure can have several gcgITERATOR instances working at a time. The gcgITERATOR object must be deleted after use.

Since
0.02.113

Constructor & Destructor Documentation

◆ ~gcgITERATOR()

virtual gcgITERATOR::~gcgITERATOR ( )
virtual

Destroys the iterator object and releases all of its resources. The iterated data structure does not change. Destruction is dependent on the underlying data structure.

See also
next()

Member Function Documentation

◆ next()

virtual gcgDATA* gcgITERATOR::next ( )
pure virtual

Gets the next object from the data structure. While iterating, the underlying data structure must not be changed by insertions, removals or moves. The returned pointer is guaranteed to not being accessed again by the iterator.

Returns
The pointer of the next object or NULL, if the iteration is finished. The precise object type depends on the data structure and commonly is a specialization of gcgLINK, gcgDOUBLELINK or gcgORDEREDNODE classes.
See also
~gcgITERATOR()

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