CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

bistream_iterator< T > Class Template Reference

#include <bstream_iterator.h>

List of all members.

Public Member Functions

 bistream_iterator ()
 bistream_iterator (binary_ifstream &s)
bool operator!= (const bistream_iterator &rhs)
const Toperator* () const
bistream_iteratoroperator++ ()
bistream_iteratoroperator++ (int)
const Toperator-> () const
bool operator== (const bistream_iterator &rhs)

Private Member Functions

void read ()

Private Attributes

binary_ifstreamstream_
T value_

Detailed Description

template<typename T>
class bistream_iterator< T >

Definition at line 10 of file bstream_iterator.h.


Constructor & Destructor Documentation

template<typename T >
bistream_iterator< T >::bistream_iterator ( ) [inline]

Definition at line 15 of file bstream_iterator.h.

: stream_(0) {}
template<typename T >
bistream_iterator< T >::bistream_iterator ( binary_ifstream s) [inline]

Definition at line 17 of file bstream_iterator.h.

References bistream_iterator< T >::read().

                                           : stream_(&s) {
        read();
    }

Member Function Documentation

template<typename T >
bool bistream_iterator< T >::operator!= ( const bistream_iterator< T > &  rhs) [inline]

Definition at line 37 of file bstream_iterator.h.

References bistream_iterator< T >::operator==().

                                                  {
        return !operator==(rhs);
    }
template<typename T >
const T& bistream_iterator< T >::operator* ( void  ) const [inline]

Definition at line 21 of file bstream_iterator.h.

References bistream_iterator< T >::value_.

{return value_;}
template<typename T >
bistream_iterator& bistream_iterator< T >::operator++ ( int  ) [inline]

Definition at line 27 of file bstream_iterator.h.

References bistream_iterator< T >::read(), and tmp.

                                       {
        bistream_iterator tmp;
        read();
        return tmp;
    }
template<typename T >
bistream_iterator& bistream_iterator< T >::operator++ ( void  ) [inline]

Definition at line 25 of file bstream_iterator.h.

References bistream_iterator< T >::read().

{read(); return *this;}
template<typename T >
const T* bistream_iterator< T >::operator-> ( ) const [inline]

Definition at line 23 of file bstream_iterator.h.

References bistream_iterator< T >::value_.

{return &value_;}
template<typename T >
bool bistream_iterator< T >::operator== ( const bistream_iterator< T > &  rhs) [inline]

Definition at line 33 of file bstream_iterator.h.

References bistream_iterator< T >::stream_.

Referenced by bistream_iterator< T >::operator!=().

                                                  {
        return stream_ == rhs.stream_;
    }
template<typename T >
void bistream_iterator< T >::read ( ) [inline, private]

Definition at line 46 of file bstream_iterator.h.

References bistream_iterator< T >::stream_, and bistream_iterator< T >::value_.

Referenced by bistream_iterator< T >::bistream_iterator(), and bistream_iterator< T >::operator++().

                {
        if (stream_ != 0) {
            // if (!(*stream_ >> value_)) stream_ = 0;
            if (!(*stream_ >> value_)) {
                stream_ = 0;
                // std::cout << "istream_iterator: stream turned bad, set stream_ to zero" << std::endl;
            }
        }
    }

Member Data Documentation

template<typename T >
binary_ifstream* bistream_iterator< T >::stream_ [private]
template<typename T >
T bistream_iterator< T >::value_ [private]