CxxUtils::ArrayIteratorChooser< N > Class Template Reference

Helper for defining iterators over Array's. More...

#include <Array.h>

List of all members.

Public Types

typedef ArrayIterator< N > const_iterator
 Iterator type for an Array<N>.

Static Public Member Functions

static const_iterator make_iterator (const Arrayrep *rep, unsigned int offs)
 Construct an Array<N>::const_iterator.

Detailed Description

template<unsigned int N>
class CxxUtils::ArrayIteratorChooser< N >

Helper for defining iterators over Array's.

Helper for defining iterators over Array's, specialized for N == 1.

For Array<N> with N >= 2, we want to use ArrayIterator<N> as the iterator class. However, for Array<1>, we want to use just an Arrayelt*. I'm too lazy to either specialize ArrayIterator<1> or to add a new Array<1> specialization. So this is an easier way of achieving the same effect. Array<N> uses as its iterator type ArrayIteratorChooser<N>::const_iterator; this small class then gets specialized for == 1. We also need to provide a way to create the iterators (since it will be done differently in the two cases). This is supplied by the make_iterator method.

For N == 1, we specialize so that Array<N> uses Arrayelt* as its iterator type.


Member Function Documentation

template<unsigned int N>
ArrayIteratorChooser< N >::const_iterator CxxUtils::ArrayIteratorChooser< N >::make_iterator ( const Arrayrep rep,
unsigned int  offs 
) [inline, static]

Construct an Array<N>::const_iterator.

Parameters:
rep Arrayrep from which to initialize the iterator.
offs Offset of the first element referenced by the iterator within rep.
Returns:
The new iterator.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1