STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

sequence_range Class Template Reference
[Range Adaptors]

This class adapts an STL sequence instance into a Range. More...

#include <sequence_range.hpp>

Inheritance diagram for sequence_range:

iterable_range_tag notional_range_tag List of all members.

Notional Range methods

ss_bool_t is_open () const
 Indicates whether the range is open.

reference current ()
 Returns the current value in the range.

const_reference current () const
 Returns the current value in the range.

class_typeadvance ()
 Advances the current position in the range.

 operator boolean_type () const
 Indicates whether the range is open.

reference operator * ()
 Returns the current value in the range.

const_reference operator * () const
 Returns the current value in the range.

class_typeoperator++ ()
 Advances the current position in the range.

class_type operator++ (int)
 Advances the current position in the range, returning a copy of the range prior to its being advanced.


Public Types

typedef S sequence_type
 The sequence type.

typedef T traits_type
 The traits type.

typedef iterable_range_tag range_tag_type
 The range category tag type.

typedef sequence_range< S, T > class_type
 The current instantiation of the type.

typedef traits_type::sequence_reference_type sequence_reference_type
 The sequence reference type.

typedef traits_type::value_type value_type
 The value type.

typedef traits_type::iterator iterator
 The mutating (non-const) iterator type.

typedef traits_type::const_iterator const_iterator
 The non-mutating (const) iterator type.

typedef traits_type::reference reference
 The mutating (non-const) reference type.

typedef traits_type::const_reference const_reference
 The non-mutating (const) reference type.

typedef traits_type::difference_type difference_type
 The difference type.

typedef traits_type::size_type size_type
 The size type.


Public Methods

Iterable Range methods
iterator begin ()
 Returns an iterator to the current position of the range.

iterator end ()
 Returns an iterator to the end of the range.

const_iterator begin () const
 Returns an iterator to the current position of the range.

const_iterator end () const
 Returns an iterator to the end of the range.


Detailed Description

template<typename S, typename T = sequence_range_traits<S, is_const<S>::value>>
class stlsoft::sequence_range< S, T >

This class adapts an STL sequence instance into a Range.

Parameters:
S  The sequence class
T  The sequence range traits, used to deduce the Range's iterator, const_iterator, reference, const_reference and value_type
It is categoried as an Iterable Range

It could be used as follows

    void dump_elements(std::vector<int> const &numbers)
    {
      for(sequence_range<std::vector<int> > r(numbers.begin(), numbers.end()); r; ++r)
      {
        std::cout << &r; // Dump the current value to stdout
      }
    }
    


Member Typedef Documentation

typedef sequence_range<S, T> class_type
 

The current instantiation of the type.

typedef traits_type::const_iterator const_iterator
 

The non-mutating (const) iterator type.

typedef traits_type::const_reference const_reference
 

The non-mutating (const) reference type.

typedef traits_type::difference_type difference_type
 

The difference type.

typedef traits_type::iterator iterator
 

The mutating (non-const) iterator type.

typedef iterable_range_tag range_tag_type
 

The range category tag type.

typedef traits_type::reference reference
 

The mutating (non-const) reference type.

typedef traits_type::sequence_reference_type sequence_reference_type
 

The sequence reference type.

typedef S sequence_type
 

The sequence type.

typedef traits_type::size_type size_type
 

The size type.

typedef T traits_type
 

The traits type.

typedef traits_type::value_type value_type
 

The value type.


Member Function Documentation

class_type& advance   [inline]
 

Advances the current position in the range.

const_iterator begin   const [inline]
 

Returns an iterator to the current position of the range.

iterator begin   [inline]
 

Returns an iterator to the current position of the range.

const_reference current   const [inline]
 

Returns the current value in the range.

reference current   [inline]
 

Returns the current value in the range.

const_iterator end   const [inline]
 

Returns an iterator to the end of the range.

iterator end   [inline]
 

Returns an iterator to the end of the range.

ss_bool_t is_open   const [inline]
 

Indicates whether the range is open.

const_reference operator *   const [inline]
 

Returns the current value in the range.

reference operator *   [inline]
 

Returns the current value in the range.

operator boolean_type   const [inline]
 

Indicates whether the range is open.

class_type operator++ int    [inline]
 

Advances the current position in the range, returning a copy of the range prior to its being advanced.

class_type& operator++   [inline]
 

Advances the current position in the range.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004