PPL  1.2
Parma_Polyhedra_Library::const_iterator_to_const< Container > Class Template Reference

A const_iterator on a sequence of read-only objects. More...

#include <iterator_to_const_defs.hh>

Public Types

typedef Traits::iterator_category iterator_category
 
typedef Traits::value_type value_type
 
typedef Traits::difference_type difference_type
 
typedef Traits::pointer pointer
 
typedef Traits::reference reference
 

Public Member Functions

 const_iterator_to_const ()
 Default constructor. More...
 
 const_iterator_to_const (const const_iterator_to_const &y)
 Copy constructor. More...
 
 const_iterator_to_const (const iterator_to_const< Container > &y)
 Constructs from the corresponding non-const iterator. More...
 
reference operator* () const
 Dereference operator. More...
 
pointer operator-> () const
 Indirect member selector. More...
 
const_iterator_to_constoperator++ ()
 Prefix increment operator. More...
 
const_iterator_to_const operator++ (int)
 Postfix increment operator. More...
 
const_iterator_to_constoperator-- ()
 Prefix decrement operator. More...
 
const_iterator_to_const operator-- (int)
 Postfix decrement operator. More...
 
bool operator== (const const_iterator_to_const &y) const
 Returns true if and only if *this and y are identical. More...
 
bool operator!= (const const_iterator_to_const &y) const
 Returns true if and only if *this and y are different. More...
 

Private Types

typedef Container::const_iterator Base
 The type of the underlying const_iterator. More...
 
typedef std::iterator_traits< BaseTraits
 A shortcut for naming traits. More...
 

Private Member Functions

 const_iterator_to_const (const Base &b)
 Constructs from the lower-level const_iterator. More...
 

Private Attributes

Base base
 A const_iterator on the sequence of elements. More...
 

Friends

class iterator_to_const< Container >
 
template<typename T >
class Powerset
 

Related Functions

(Note that these are not member functions.)

template<typename Container >
bool operator== (const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
 Mixed comparison operator: returns true if and only if (the const version of) x is identical to y. More...
 
template<typename Container >
bool operator!= (const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
 Mixed comparison operator: returns true if and only if (the const version of) x is different from y. More...
 
template<typename Container >
bool operator== (const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
 
template<typename Container >
bool operator!= (const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
 

Detailed Description

template<typename Container>
class Parma_Polyhedra_Library::const_iterator_to_const< Container >

A const_iterator on a sequence of read-only objects.

This class, besides implementing a read-only bidirectional iterator on a read-only sequence of objects, ensures interoperability with template class iterator_to_const.

Definition at line 123 of file iterator_to_const_defs.hh.

Member Typedef Documentation

template<typename Container>
typedef Container::const_iterator Parma_Polyhedra_Library::const_iterator_to_const< Container >::Base
private

The type of the underlying const_iterator.

Definition at line 126 of file iterator_to_const_defs.hh.

template<typename Container>
typedef Traits::difference_type Parma_Polyhedra_Library::const_iterator_to_const< Container >::difference_type

Definition at line 144 of file iterator_to_const_defs.hh.

template<typename Container>
typedef Traits::iterator_category Parma_Polyhedra_Library::const_iterator_to_const< Container >::iterator_category

Definition at line 142 of file iterator_to_const_defs.hh.

template<typename Container>
typedef Traits::pointer Parma_Polyhedra_Library::const_iterator_to_const< Container >::pointer

Definition at line 145 of file iterator_to_const_defs.hh.

template<typename Container>
typedef Traits::reference Parma_Polyhedra_Library::const_iterator_to_const< Container >::reference

Definition at line 146 of file iterator_to_const_defs.hh.

template<typename Container>
typedef std::iterator_traits<Base> Parma_Polyhedra_Library::const_iterator_to_const< Container >::Traits
private

A shortcut for naming traits.

Definition at line 129 of file iterator_to_const_defs.hh.

template<typename Container>
typedef Traits::value_type Parma_Polyhedra_Library::const_iterator_to_const< Container >::value_type

Definition at line 143 of file iterator_to_const_defs.hh.

Constructor & Destructor Documentation

template<typename Container >
Parma_Polyhedra_Library::const_iterator_to_const< Container >::const_iterator_to_const ( const Base b)
inlineprivate

Constructs from the lower-level const_iterator.

Definition at line 117 of file iterator_to_const_inlines.hh.

118  : base(b) {
119 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
Parma_Polyhedra_Library::const_iterator_to_const< Container >::const_iterator_to_const ( )
inline

Default constructor.

Definition at line 104 of file iterator_to_const_inlines.hh.

105  : base() {
106 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
Parma_Polyhedra_Library::const_iterator_to_const< Container >::const_iterator_to_const ( const const_iterator_to_const< Container > &  y)
inline

Copy constructor.

Definition at line 111 of file iterator_to_const_inlines.hh.

112  : base(y.base) {
113 }
Base base
A const_iterator on the sequence of elements.
template<typename Container>
Parma_Polyhedra_Library::const_iterator_to_const< Container >::const_iterator_to_const ( const iterator_to_const< Container > &  y)
inline

Constructs from the corresponding non-const iterator.

Definition at line 180 of file iterator_to_const_inlines.hh.

181  : base(y.base) {
182 }
Base base
A const_iterator on the sequence of elements.

Member Function Documentation

template<typename Container >
bool Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator!= ( const const_iterator_to_const< Container > &  y) const
inline

Returns true if and only if *this and y are different.

Definition at line 173 of file iterator_to_const_inlines.hh.

References Parma_Polyhedra_Library::operator==().

173  {
174  return !operator==(y);
175 }
bool operator==(const const_iterator_to_const &y) const
Returns true if and only if *this and y are identical.
template<typename Container >
const_iterator_to_const< Container >::reference Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator* ( ) const
inline

Dereference operator.

Definition at line 123 of file iterator_to_const_inlines.hh.

123  {
124  return *base;
125 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
const_iterator_to_const< Container > & Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator++ ( )
inline

Prefix increment operator.

Definition at line 135 of file iterator_to_const_inlines.hh.

135  {
136  ++base;
137  return *this;
138 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
const_iterator_to_const< Container > Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator++ ( int  )
inline

Postfix increment operator.

Definition at line 142 of file iterator_to_const_inlines.hh.

142  {
143  const_iterator_to_const tmp = *this;
144  operator++();
145  return tmp;
146 }
const_iterator_to_const & operator++()
Prefix increment operator.
template<typename Container >
const_iterator_to_const< Container > & Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator-- ( )
inline

Prefix decrement operator.

Definition at line 150 of file iterator_to_const_inlines.hh.

150  {
151  --base;
152  return *this;
153 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
const_iterator_to_const< Container > Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator-- ( int  )
inline

Postfix decrement operator.

Definition at line 157 of file iterator_to_const_inlines.hh.

157  {
158  const_iterator_to_const tmp = *this;
159  operator--();
160  return tmp;
161 }
const_iterator_to_const & operator--()
Prefix decrement operator.
template<typename Container >
const_iterator_to_const< Container >::pointer Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator-> ( ) const
inline

Indirect member selector.

Definition at line 129 of file iterator_to_const_inlines.hh.

129  {
130  return &*base;
131 }
Base base
A const_iterator on the sequence of elements.
template<typename Container >
bool Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator== ( const const_iterator_to_const< Container > &  y) const
inline

Returns true if and only if *this and y are identical.

Definition at line 166 of file iterator_to_const_inlines.hh.

References Parma_Polyhedra_Library::const_iterator_to_const< Container >::base.

166  {
167  return base == y.base;
168 }
Base base
A const_iterator on the sequence of elements.

Friends And Related Function Documentation

template<typename Container>
friend class iterator_to_const< Container >
friend

Definition at line 137 of file iterator_to_const_defs.hh.

template<typename Container >
bool operator!= ( const iterator_to_const< Container > &  x,
const const_iterator_to_const< Container > &  y 
)
related

Definition at line 195 of file iterator_to_const_inlines.hh.

196  {
197  return !(x == y);
198 }
template<typename Container >
bool operator!= ( const iterator_to_const< Container > &  x,
const const_iterator_to_const< Container > &  y 
)
related

Mixed comparison operator: returns true if and only if (the const version of) x is different from y.

template<typename Container >
bool operator== ( const iterator_to_const< Container > &  x,
const const_iterator_to_const< Container > &  y 
)
related

Definition at line 187 of file iterator_to_const_inlines.hh.

188  {
189  return const_iterator_to_const<Container>(x).operator==(y);
190 }
template<typename Container >
bool operator== ( const iterator_to_const< Container > &  x,
const const_iterator_to_const< Container > &  y 
)
related

Mixed comparison operator: returns true if and only if (the const version of) x is identical to y.

template<typename Container>
template<typename T >
friend class Powerset
friend

Definition at line 138 of file iterator_to_const_defs.hh.

Member Data Documentation

template<typename Container>
Base Parma_Polyhedra_Library::const_iterator_to_const< Container >::base
private

A const_iterator on the sequence of elements.

Definition at line 132 of file iterator_to_const_defs.hh.

Referenced by Parma_Polyhedra_Library::const_iterator_to_const< Container >::operator==().


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