Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

istream_iterator Class Template Reference

#include <stl_iterator.h>

Collaboration diagram for istream_iterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef input_iterator_tag iterator_category
typedef T value_type
typedef Distance difference_type
typedef const T * pointer
typedef const T & reference

Public Methods

 istream_iterator ()
 istream_iterator (istream &s)
reference operator * () const
pointer operator-> () const
istream_iterator< T, Distance > & operator++ ()
istream_iterator< T, Distance > operator++ (int)

Protected Methods

void read ()

Protected Attributes

istream * stream
value
bool end_marker

Friends

bool operator==__STL_NULL_TMPL_ARGS (const istream_iterator< T, Distance > &x, const istream_iterator< T, Distance > &y)

template<class T, class Distance = ptrdiff_t>
class istream_iterator< T, Distance >


Member Typedef Documentation

template<class T, class Distance = ptrdiff_t>
typedef Distance istream_iterator::difference_type
 

Definition at line 757 of file stl_iterator.h.

template<class T, class Distance = ptrdiff_t>
typedef input_iterator_tag istream_iterator::iterator_category
 

Definition at line 755 of file stl_iterator.h.

template<class T, class Distance = ptrdiff_t>
typedef const T* istream_iterator::pointer
 

Definition at line 758 of file stl_iterator.h.

Referenced by operator->.

template<class T, class Distance = ptrdiff_t>
typedef const T& istream_iterator::reference
 

Definition at line 759 of file stl_iterator.h.

Referenced by operator *.

template<class T, class Distance = ptrdiff_t>
typedef T istream_iterator::value_type
 

Definition at line 756 of file stl_iterator.h.


Constructor & Destructor Documentation

template<class T, class Distance = ptrdiff_t>
istream_iterator< T, Distance >::istream_iterator   [inline]
 

Definition at line 761 of file stl_iterator.h.

References end_marker, and stream.

00761 : stream(&cin), end_marker(false) {}

template<class T, class Distance = ptrdiff_t>
istream_iterator< T, Distance >::istream_iterator istream &    s [inline]
 

Definition at line 762 of file stl_iterator.h.

References read, and stream.

00762 : stream(&s) { read(); }


Member Function Documentation

template<class T, class Distance = ptrdiff_t>
reference istream_iterator< T, Distance >::operator *   const [inline]
 

Definition at line 763 of file stl_iterator.h.

References reference, and value.

Referenced by operator->.

00763 { return value; }

template<class T, class Distance = ptrdiff_t>
istream_iterator<T, Distance> istream_iterator< T, Distance >::operator++ int    [inline]
 

Definition at line 771 of file stl_iterator.h.

References read.

00771                                                  {
00772     istream_iterator<T, Distance> tmp = *this;
00773     read();
00774     return tmp;
00775   }

template<class T, class Distance = ptrdiff_t>
istream_iterator<T, Distance>& istream_iterator< T, Distance >::operator++   [inline]
 

Definition at line 767 of file stl_iterator.h.

References read.

00767                                               { 
00768     read(); 
00769     return *this;
00770   }

template<class T, class Distance = ptrdiff_t>
pointer istream_iterator< T, Distance >::operator->   const [inline]
 

Definition at line 765 of file stl_iterator.h.

References operator *, and pointer.

00765 { return &(operator*()); }

template<class T, class Distance = ptrdiff_t>
void istream_iterator< T, Distance >::read   [inline, protected]
 

Definition at line 749 of file stl_iterator.h.

References end_marker, stream, and value.

Referenced by istream_iterator, and operator++.

00749               {
00750     end_marker = (*stream) ? true : false;
00751     if (end_marker) *stream >> value;
00752     end_marker = (*stream) ? true : false;
00753   }


Friends And Related Function Documentation

template<class T, class Distance = ptrdiff_t>
bool operator==__STL_NULL_TMPL_ARGS const istream_iterator< T, Distance > &    x,
const istream_iterator< T, Distance > &    y
[friend]
 


Member Data Documentation

template<class T, class Distance = ptrdiff_t>
bool istream_iterator::end_marker [protected]
 

Definition at line 748 of file stl_iterator.h.

Referenced by istream_iterator, operator==, and read.

template<class T, class Distance = ptrdiff_t>
istream* istream_iterator::stream [protected]
 

Definition at line 746 of file stl_iterator.h.

Referenced by istream_iterator, operator==, and read.

template<class T, class Distance = ptrdiff_t>
T istream_iterator::value [protected]
 

Definition at line 747 of file stl_iterator.h.

Referenced by operator *, and read.


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

Documentation generated on Thu May 2 15:03:32 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001