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

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

#include "stir/NestedIteratorHelpers.h"

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

Public Types

typedef RestIterT rest_iter_type
 

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::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::iterator>
class stir::PtrBeginEndFunction< TopLevelIterT, RestIterT >

Helper class for NestedIterator when the 1st level iterator refers to pointers 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> *> or std::vector<shared_ptr<std::vector<int> > >.

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

See also
BeginEndFunction

Member Function Documentation

◆ begin()

template<class TopLevelIterT, class RestIterT = typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::iterator>
RestIterT stir::PtrBeginEndFunction< 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: