member_selector_iterator Class Template Reference
[Iterators Library]

#include <stlsoft/iterators/member_selector_iterator.hpp>

List of all members.


Detailed Description

template<typename I, typename C, typename M>
class stlsoft::member_selector_iterator< I, C, M >

An iterator adaptor class template that presents a member of the underlying iterator's value type as the apparent value type.

Parameters:
I The type of the base iterator, whose value type should be C, or convertible to C
C The class of the member pointer
M The type of the member pointer

Member Types

typedef
parent_class_type::base_iterator_type 
base_iterator_type
typedef
parent_class_type::selected_class_type 
selected_class_type
typedef
parent_class_type::value_type 
value_type
typedef parent_class_type::pointer pointer
typedef
parent_class_type::const_pointer 
const_pointer
typedef
parent_class_type::reference 
reference
typedef
parent_class_type::const_reference 
const_reference
typedef
parent_class_type::size_type 
size_type
typedef
parent_class_type::difference_type 
difference_type
typedef
member_selector_iterator< I, C,
M > 
class_type

Construction

 member_selector_iterator (base_iterator_type it, M C::*member)
 Constructs an instance from an iterator and a member pointer.
 member_selector_iterator (class_type const &rhs)
 Copy constructor.
 ~member_selector_iterator () throw ()
 Destructor.
base_iterator_type base () const
 A copy of the base iterator.
base_iterator_type current () const
 A copy of the base iterator.

Public Member Functions

Accessors
value_type C::* member () const
 Constructs an instance from an iterator and a member pointer.
Input Iterator methods
class_typeoperator++ ()
 Pre-increment iterator.
class_type operator++ (int)
 Post-increment iterator.
reference operator* ()
 Returns a mutating (non-const) reference to the selected member of the base iterators current value.
const_reference operator* () const
 Returns a non-mutating (const) reference to the selected member of the base iterators current value.
bool equal (class_type const &rhs) const
 Evaluates two instances for equality.
Bidirectional Iterator methods
class_typeoperator-- ()
 Pre-decrement iterator.
class_type operator-- (int)
 Post-decrement iterator.
Random-Access Iterator methods
class_typeoperator+= (difference_type n)
 Moves the iterator forward.
class_typeoperator-= (difference_type n)
 Moves the iterator backward.
value_type & operator[] (difference_type index)
 Access the element at the given index.
value_type const & operator[] (difference_type index) const
 Access the element at the given index.
difference_type distance (class_type const &rhs) const
 Calculate the distance between this and rhs.

Constructor & Destructor Documentation

member_selector_iterator ( base_iterator_type  it,
M C::*  member 
) [inline]

Constructs an instance from an iterator and a member pointer.

member_selector_iterator ( class_type const &  rhs  )  [inline]

Copy constructor.

~member_selector_iterator (  )  throw () [inline]

Destructor.

References STLSOFT_SUPPRESS_UNUSED.


Member Function Documentation

base_iterator_type base (  )  const [inline]

A copy of the base iterator.

base_iterator_type current (  )  const [inline]

A copy of the base iterator.

Deprecated:
This is replaced by base()

value_type C::* member (  )  const [inline]

Constructs an instance from an iterator and a member pointer.

class_type& operator++ (  )  [inline]

Pre-increment iterator.

Note:
Increments the base iterator

Referenced by member_selector_iterator::operator++().

class_type operator++ ( int   )  [inline]

Post-increment iterator.

Note:
Increments the base iterator

References member_selector_iterator::operator++().

reference operator* (  )  [inline]

Returns a mutating (non-const) reference to the selected member of the base iterators current value.

const_reference operator* (  )  const [inline]

Returns a non-mutating (const) reference to the selected member of the base iterators current value.

bool equal ( class_type const &  rhs  )  const [inline]

Evaluates two instances for equality.

References member_selector_iterator::m_it, member_selector_iterator::m_member, and STLSOFT_ASSERT.

class_type& operator-- (  )  [inline]

Pre-decrement iterator.

Note:
Decrements the base iterator

Referenced by member_selector_iterator::operator--().

class_type operator-- ( int   )  [inline]

Post-decrement iterator.

Note:
Decrements the base iterator

References member_selector_iterator::operator--().

class_type& operator+= ( difference_type  n  )  [inline]

Moves the iterator forward.

Parameters:
n The amount by which to increment the iterator's current position

class_type& operator-= ( difference_type  n  )  [inline]

Moves the iterator backward.

Parameters:
n The amount by which to decrement the iterator's current position

value_type& operator[] ( difference_type  index  )  [inline]

Access the element at the given index.

Parameters:
index The required offset from the iterator's position

value_type const& operator[] ( difference_type  index  )  const [inline]

Access the element at the given index.

Parameters:
index The required offset from the iterator's position

difference_type distance ( class_type const &  rhs  )  const [inline]

Calculate the distance between this and rhs.

References member_selector_iterator::m_it.


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

Generated on Thu Jun 10 08:58:48 2010 for STLSoft by  doxygen 1.5.6