ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::permutation::iterator_base< container, content, reverse > Class Template Reference

The container must have iterator types. More...

Inheritance diagram for gsl::permutation::iterator_base< container, content, reverse >:
Inheritance graph
Collaboration diagram for gsl::permutation::iterator_base< container, content, reverse >:
Collaboration graph

Public Types

typedef std::random_access_iterator_tag iterator_category
 An iterator must have an iterator category. More...
 
typedef size_t value_type
 An iterator must have a value type. More...
 
typedef value_typepointer
 An iterator must have a pointer typea. More...
 
typedef value_typereference
 An iterator must have a reference type. More...
 
typedef ptrdiff_t difference_type
 An iterator must have a difference_type. More...
 

Public Member Functions

reference operator* () const
 Dereference the pointer. More...
 
pointer operator-> () const
 Dereference the pointer. More...
 
reference operator[] (difference_type const n) const
 Get element at i + n by reference ([] operator). More...
 
difference_type operator- (iterator_base< container, content, reverse > const &i) const
 The - operator: find distance between two iterators. More...
 
bool operator== (iterator_base< container, content, reverse > const &i) const
 The == operator. More...
 
bool operator!= (iterator_base< container, content, reverse > const &i) const
 The != operator. More...
 
bool operator< (iterator_base< container, content, reverse > const &i) const
 The < operator is used to compare iterators. More...
 

Protected Member Functions

void increment ()
 Increment the iterator. More...
 
void decrement ()
 Decrement the iterator. More...
 
void shift (difference_type const n)
 Shift iterator n places. More...
 
 iterator_base ()
 The iterator is default constructible. More...
 
 iterator_base (container *v, difference_type position)
 This constructor allows permutation to create non-default iterators. More...
 

Protected Attributes

container * v
 Store a pointer to a permutation we can iterate over: 0 if no permutation. More...
 
difference_type position
 Mark position of iterator within permutation. More...
 

Friends

class permutation
 

Detailed Description

template<typename container, typename content, bool reverse>
class gsl::permutation::iterator_base< container, content, reverse >

The container must have iterator types.

We create a suitable class here.

Definition at line 320 of file permutation.hpp.

Member Typedef Documentation

◆ difference_type

template<typename container , typename content , bool reverse>
typedef ptrdiff_t gsl::permutation::iterator_base< container, content, reverse >::difference_type

An iterator must have a difference_type.

Definition at line 343 of file permutation.hpp.

◆ iterator_category

template<typename container , typename content , bool reverse>
typedef std::random_access_iterator_tag gsl::permutation::iterator_base< container, content, reverse >::iterator_category

An iterator must have an iterator category.

Definition at line 326 of file permutation.hpp.

◆ pointer

template<typename container , typename content , bool reverse>
typedef value_type* gsl::permutation::iterator_base< container, content, reverse >::pointer

An iterator must have a pointer typea.

Definition at line 334 of file permutation.hpp.

◆ reference

template<typename container , typename content , bool reverse>
typedef value_type& gsl::permutation::iterator_base< container, content, reverse >::reference

An iterator must have a reference type.

Definition at line 338 of file permutation.hpp.

◆ value_type

template<typename container , typename content , bool reverse>
typedef size_t gsl::permutation::iterator_base< container, content, reverse >::value_type

An iterator must have a value type.

Definition at line 330 of file permutation.hpp.

Constructor & Destructor Documentation

◆ iterator_base() [1/2]

template<typename container , typename content , bool reverse>
gsl::permutation::iterator_base< container, content, reverse >::iterator_base ( )
inlineprotected

The iterator is default constructible.

Definition at line 544 of file permutation.hpp.

References gsl::permutation::iterator_base< container, content, reverse >::v.

◆ iterator_base() [2/2]

template<typename container , typename content , bool reverse>
gsl::permutation::iterator_base< container, content, reverse >::iterator_base ( container *  v,
difference_type  position 
)
inlineprotected

This constructor allows permutation to create non-default iterators.

Parameters
vThe permutation that creates this
positionThe initial postion of the iterator

Definition at line 550 of file permutation.hpp.

Member Function Documentation

◆ decrement()

template<typename container , typename content , bool reverse>
void gsl::permutation::iterator_base< container, content, reverse >::decrement ( )
inlineprotected

◆ increment()

template<typename container , typename content , bool reverse>
void gsl::permutation::iterator_base< container, content, reverse >::increment ( )
inlineprotected

◆ operator!=()

template<typename container , typename content , bool reverse>
bool gsl::permutation::iterator_base< container, content, reverse >::operator!= ( iterator_base< container, content, reverse > const &  i) const
inline

The != operator.

Parameters
iThe iterator being compared
Returns
true or false according as i != *this

Definition at line 467 of file permutation.hpp.

References gsl::permutation::iterator_base< container, content, reverse >::operator==().

◆ operator*()

template<typename container , typename content , bool reverse>
reference gsl::permutation::iterator_base< container, content, reverse >::operator* ( ) const
inline

◆ operator-()

template<typename container , typename content , bool reverse>
difference_type gsl::permutation::iterator_base< container, content, reverse >::operator- ( iterator_base< container, content, reverse > const &  i) const
inline

The - operator: find distance between two iterators.

Parameters
iA second iterator
Returns
(signed) distance between this and i

Definition at line 435 of file permutation.hpp.

References gsl::exception::GSL_EFAILED, gsl::permutation::iterator_base< container, content, reverse >::position, gsl::permutation::reverse(), and gsl::permutation::iterator_base< container, content, reverse >::v.

Referenced by gsl::permutation::const_iterator_t< reverse >::operator-().

◆ operator->()

template<typename container , typename content , bool reverse>
pointer gsl::permutation::iterator_base< container, content, reverse >::operator-> ( ) const
inline

◆ operator<()

template<typename container , typename content , bool reverse>
bool gsl::permutation::iterator_base< container, content, reverse >::operator< ( iterator_base< container, content, reverse > const &  i) const
inline

The < operator is used to compare iterators.

This only makes sense if the iterators iterate over the same permutation and the function calls a GSL error handler and returns false if they do not.

Parameters
iThe iterator being compared
Returns
true or false according as i < j

Definition at line 477 of file permutation.hpp.

References gsl::exception::GSL_EFAILED, gsl::permutation::iterator_base< container, content, reverse >::position, gsl::permutation::reverse(), and gsl::permutation::iterator_base< container, content, reverse >::v.

◆ operator==()

template<typename container , typename content , bool reverse>
bool gsl::permutation::iterator_base< container, content, reverse >::operator== ( iterator_base< container, content, reverse > const &  i) const
inline

The == operator.

Parameters
iThe iterator being compared
Returns
true or false according as i != *this

Definition at line 459 of file permutation.hpp.

References gsl::permutation::iterator_base< container, content, reverse >::position, and gsl::permutation::iterator_base< container, content, reverse >::v.

Referenced by gsl::permutation::iterator_base< container, content, reverse >::operator!=().

◆ operator[]()

template<typename container , typename content , bool reverse>
reference gsl::permutation::iterator_base< container, content, reverse >::operator[] ( difference_type const  n) const
inline

Get element at i + n by reference ([] operator).

Parameters
nThe offset from i
Returns
a reference to content

Definition at line 405 of file permutation.hpp.

References gsl::exception::GSL_EFAILED, gsl::rstat::n(), gsl::permutation::iterator_base< container, content, reverse >::position, gsl::permutation::reverse(), and gsl::permutation::iterator_base< container, content, reverse >::v.

◆ shift()

template<typename container , typename content , bool reverse>
void gsl::permutation::iterator_base< container, content, reverse >::shift ( difference_type const  n)
inlineprotected

Shift iterator n places.

Parameters
nA difference_type value to be added to position of iterator

Definition at line 530 of file permutation.hpp.

References gsl::exception::GSL_EFAILED, gsl::rstat::n(), gsl::permutation::iterator_base< container, content, reverse >::position, gsl::permutation::reverse(), and gsl::permutation::iterator_base< container, content, reverse >::v.

Friends And Related Function Documentation

◆ permutation

template<typename container , typename content , bool reverse>
friend class permutation
friend

Definition at line 321 of file permutation.hpp.

Member Data Documentation

◆ position

◆ v


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