ITraversableT Class

class ITraversableT

The ITraversableT templated interface is an abstract interface that enables polymorphic iteration. A polymorphic iterator is one which performs traversal without explicit knowledge of collection type. Instead, it uses the ITraversableT interface, which permits access to elements without exposing collection type. The ITraversableT interface can be mixed into any aggregate, thereby enabling polymorphic iteration for that aggregate. Therefore, this interface serves as a useful abstraction for an aggregate, because it can be returned, passed between functions, and used by polymorphic iterators without subjecting client code to unnecessary implementation-oriented dependencies.

The ITraversableT interface permits read/write access to the aggregate. Pass this interface to functions that must modify the contents of the underlying aggregate. If you want to restrict such functions from modifying, passing the IConstTraversableT interface instead.

Note: The ITraversableT interface has many member functions but only one is documented. The remaining members are meant to be used by the polymorphic iterators only.

Defined in: Traversable.h

Class Template Arguments

_Ty

The type of element contained in the aggregate that implements this interface.

Member functions include: clear

Class Members

virtual void clear()

Clears the contents of the underlying aggregate.