TIter
The following may be needed if not using
CINT Shortcuts
#include "TCollection.h"
Description
ROOT has a number of
classes
whose
objects
acts as
containers,
i.e. hold other objects. A fundamental requirement of such containers is the
ability to sequentially process all the objects they hold. This is performed
using "iterators", objects that have the ability to step through a container
set. TIterator is the foundation class for ROOT container iterators. It
identifies a minimum set of
messages
that all iterators must support. It is too generic to provide code for these
messages, so naked TIterator objects cannot be created, that is to say it is
an
abstract base class.
Individual containers classes create their own iterators that
inherit
from TIter. This leaves a problem writing generic code that can handle any
collection; it needs to be able to create such a generic iterator.
The TIter class solves this problem; to create
(i.e. instantiate)
an object of this class its
constructor
must be passed a container object and it asks the container to return its
iterator which the TIter object keeps. TIter provides the same functionality
as TIterator but
it does this simply by passing on any message to the iterator it owns. So
TIter is just a wrapper, providing generic iterator objects, but only when a
source of a non-abstract iterators is provided.
For more information see
ROOT Containers.
Go Back to the
The ROOT Crib Top Page
If you have any comments about this page please send them to
Nick West