util::range< Iterator > Class Template Reference

Class representing a range of values from two iterators. More...

#include <util/range.h>

List of all members.

Public Types

typedef Iterator const_iterator
typedef std::iterator_traits
< iterator >::difference_type 
difference_type
typedef Iterator iterator

Public Member Functions

iterator begin () const
 Begin of the range.
const_iterator cbegin () const
 Begin of the range.
const_iterator cend () const
 Past-the-End of the range.
iterator end () const
 Past-the-End of the range.
template<typename It >
rangeoperator= (const range< It > &other)
 Assignment operator.
rangeoperator= (const range &other)
 Assignment operator.
template<typename It >
 range (const range< It > &copy)
 Conversion constructor.
 range (const range &copy)
 Copy constructor.
 range (const std::pair< iterator, iterator > &p)
 Range from a pair of iterators.
 range (const iterator &fst, const iterator &lst)
 Range from two iterators.
 range ()
 Create an invalid range.
void setBegin (const iterator &it)
 Set the start of the range.
void setEnd (const iterator &it)
 Set the past-the-end iterator for the range.
difference_type size () const
 Return the size of the range.

Public Attributes

iterator first
iterator last

Detailed Description

template<typename Iterator>
class util::range< Iterator >

Class representing a range of values from two iterators.

Definition at line 21 of file range.h.


Constructor & Destructor Documentation

template<typename Iterator>
util::range< Iterator >::range (  )  [inline]

Create an invalid range.

Definition at line 30 of file range.h.

00031       : first()
00032       , last()
00033     {}

template<typename Iterator>
util::range< Iterator >::range ( const iterator fst,
const iterator lst 
) [inline]

Range from two iterators.

Definition at line 38 of file range.h.

00040       : first(fst)
00041       , last(lst)
00042     {}

template<typename Iterator>
util::range< Iterator >::range ( const std::pair< iterator, iterator > &  p  )  [inline, explicit]

Range from a pair of iterators.

Definition at line 47 of file range.h.

00048       : first(p.first)
00049       , last(p.second)
00050     {}

template<typename Iterator>
util::range< Iterator >::range ( const range< Iterator > &  copy  )  [inline]

Copy constructor.

Definition at line 55 of file range.h.

00056       : first(copy.first)
00057       , last(copy.last)
00058     {}

template<typename Iterator>
template<typename It >
util::range< Iterator >::range ( const range< It > &  copy  )  [inline, explicit]

Conversion constructor.

Definition at line 64 of file range.h.

00065       : first(copy.first)
00066       , last(copy.last)
00067     { }


Member Function Documentation

template<typename Iterator>
iterator util::range< Iterator >::begin (  )  const [inline]
template<typename Iterator>
const_iterator util::range< Iterator >::cbegin (  )  const [inline]

Begin of the range.

Definition at line 100 of file range.h.

00100 { return first; }

template<typename Iterator>
const_iterator util::range< Iterator >::cend (  )  const [inline]

Past-the-End of the range.

Definition at line 104 of file range.h.

00104 { return last; }

template<typename Iterator>
iterator util::range< Iterator >::end (  )  const [inline]
template<typename Iterator>
template<typename It >
range& util::range< Iterator >::operator= ( const range< It > &  other  )  [inline]

Assignment operator.

Definition at line 138 of file range.h.

00139     {
00140       first = other.first;
00141       last = other.last;
00142       return *this;
00143     }

template<typename Iterator>
range& util::range< Iterator >::operator= ( const range< Iterator > &  other  )  [inline]

Assignment operator.

Definition at line 127 of file range.h.

00128     {
00129       first = other.first;
00130       last = other.last;
00131       return *this;
00132     }

template<typename Iterator>
void util::range< Iterator >::setBegin ( const iterator it  )  [inline]

Set the start of the range.

Definition at line 109 of file range.h.

00109 { first = it; }

template<typename Iterator>
void util::range< Iterator >::setEnd ( const iterator it  )  [inline]

Set the past-the-end iterator for the range.

Definition at line 115 of file range.h.

00115 { last = it; }

template<typename Iterator>
difference_type util::range< Iterator >::size (  )  const [inline]

Return the size of the range.

Complexity depends on the iterator.

Definition at line 122 of file range.h.

00122 { return std::distance(first, last); }


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:35 2013 for VVE by  doxygen 1.6.3