CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
bistream_iterator< T > Class Template Reference

#include <bstream_iterator.h>

Inheritance diagram for bistream_iterator< T >:

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 9 of file bstream_iterator.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file bstream_iterator.h.

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

Definition at line 16 of file bstream_iterator.h.

References bistream_iterator< T >::read().

16  : stream_(&s) {
17  read();
18  }
binary_ifstream * stream_

Member Function Documentation

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

Definition at line 36 of file bstream_iterator.h.

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

36  {
37  return !operator==(rhs);
38  }
bool operator==(const bistream_iterator &rhs)
template<typename T >
const T& bistream_iterator< T >::operator* ( void  ) const
inline

Definition at line 20 of file bstream_iterator.h.

References bistream_iterator< T >::value_.

20 {return value_;}
template<typename T >
bistream_iterator& bistream_iterator< T >::operator++ ( void  )
inline

Definition at line 24 of file bstream_iterator.h.

References bistream_iterator< T >::read().

24 {read(); return *this;}
template<typename T >
bistream_iterator& bistream_iterator< T >::operator++ ( int  )
inline

Definition at line 26 of file bstream_iterator.h.

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

26  {
28  read();
29  return tmp;
30  }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
template<typename T >
const T* bistream_iterator< T >::operator-> ( ) const
inline

Definition at line 22 of file bstream_iterator.h.

References bistream_iterator< T >::value_.

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

Definition at line 32 of file bstream_iterator.h.

References bistream_iterator< T >::stream_.

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

32  {
33  return stream_ == rhs.stream_;
34  }
binary_ifstream * stream_
template<typename T >
void bistream_iterator< T >::read ( )
inlineprivate

Definition at line 45 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++().

45  {
46  if (stream_ != 0) {
47  // if (!(*stream_ >> value_)) stream_ = 0;
48  if (!(*stream_ >> value_)) {
49  stream_ = 0;
50  // std::cout << "istream_iterator: stream turned bad, set stream_ to zero" << std::endl;
51  }
52  }
53  }
binary_ifstream * stream_

Member Data Documentation

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