ATLAS Offline Software
Public Types | Static Public Member Functions | List of all members
CxxUtils::ArrayIteratorChooser< N > Class Template Reference

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

#include <Array.h>

Collaboration diagram for CxxUtils::ArrayIteratorChooser< N >:

Public Types

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

Static Public Member Functions

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

Detailed Description

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

Helper for defining iterators over Array's.

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 N == 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.

Definition at line 74 of file Control/CxxUtils/CxxUtils/Array.h.

Member Typedef Documentation

◆ const_iterator

template<unsigned int N>
typedef ArrayIterator<N> CxxUtils::ArrayIteratorChooser< N >::const_iterator

Iterator type for an Array<N>.

Definition at line 78 of file Control/CxxUtils/CxxUtils/Array.h.

Member Function Documentation

◆ make_iterator()

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

Construct an Array<N>::const_iterator.

Parameters
repArrayrep from which to initialize the iterator.
offsOffset of the first element referenced by the iterator within rep.
Returns
The new iterator.

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