STIR  6.2.0
Public Types | Public Member Functions | List of all members
stir::BeginEndFunction< TopLevelIterT, RestIterT > Class Template Reference

Helper class for NestedIterator when the 1st level iterator refers to an ordinary iterator for the 2nd level iterator. More...

#include "stir/NestedIteratorHelpers.h"

Inheritance diagram for stir::BeginEndFunction< TopLevelIterT, RestIterT >:
Inheritance graph
[legend]

Public Types

typedef RestIterT rest_iter_type
 typedef storing the type of the 2nd level iterator
 

Public Member Functions

RestIterT begin (const TopLevelIterT &iter) const
 function to get the first 2nd level iterator for a top-level iterator More...
 
RestIterT end (const TopLevelIterT &iter) const
 function to get the "end" 2nd level iterator for a top-level iterator
 

Detailed Description

template<class TopLevelIterT, class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::iterator>
class stir::BeginEndFunction< TopLevelIterT, RestIterT >

Helper class for NestedIterator when the 1st level iterator refers to an ordinary iterator for the 2nd level iterator.

Parameters
TopLevelIterTtype of the top-level iterator to be used for NestedIterator.
RestIterTtype of the 2nd level iter.

This class can be used for the case where the 2nd level iterators can be obtained by using top_level_iter.begin() etc, e.g. for std::vector<std::vector<int> >

The default for RestIterT is suitable for most cases, as it finds RestIterT from the iterator traits of TopLevelIterT.

Member Function Documentation

◆ begin()

template<class TopLevelIterT , class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::iterator>
RestIterT stir::BeginEndFunction< TopLevelIterT, RestIterT >::begin ( const TopLevelIterT &  iter) const
inline

function to get the first 2nd level iterator for a top-level iterator

returns (*iter).begin()


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