Kernel SDK Developer's Guide > Dictionaries of Objects > Overview of Classes that Implements an Iterator
Overview of Classes that Implements an Iterator

An iterator provides a mechanism for traversing and accessing various data. To work with iterators, use the following:

  • OdRxIterator abstract class
  • OdBaseIteratorImpl template class

OdRxIterator abstract class

The OdRxIterator abstract class provides the base interface for all iterators and is used only for deriving classes. Developers cannot create an instance of this class. It declares the following specific methods:

  • next() pure virtual method — Traverses to the next item of a container.
  • done() pure virtual method — Checks whether the traversing is completed.
  • object() pure virtual method — Returns the smart pointer to the object for which the iterator refers.

These methods do not have an implementation and are the declaration of the iterating interface. Classes derived from the OdRxIterator class must redefine these methods for working with specific containers. You should implement these methods in the class that is derived from the OdRxIterator class.

OdBaseIteratorImpl template class

The OdBaseIteratorImpl template class creates the standard implementation of the iterating interface for dictionary objects.

See Also

Concept of Iterators

Iterating through Items of a Dictionary

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.