rpa::orow_iterator< Type, OutStrmBuf > Class Template Reference

Provides output iterator semantics for streams. It is taken and adapted from the GCC library. For us, its role is to gather the ostream and the delimiter into a single object. We do not have the choice because there is no way to access to the internal components of a std::ostream_iterator. We had the same problem with obuf_iterator< std::back_inserter >. More...

#include <row_iterator.h>

List of all members.

Public Types

typedef OutStrmBuf::char_type char_type
typedef OutStrmBuf::traits_type traits_type
typedef std::basic_ostream<
char_type, traits_type
ostream_type
typedef std::ostream_iterator<
Type, char_type, traits_type
ostream_iterator_t

Public Member Functions

void check (void) const
 orow_iterator (ostream_type &__s, const char_type *__c=NULL)
 Construct from an ostream.
 orow_iterator (const orow_iterator &__obj)
 Copy constructor.
orow_iteratoroperator= (const Type &__value)
orow_iteratoroperator * ()
orow_iteratoroperator++ ()
orow_iteratoroperator++ (int)
ostream_iterator_t to_ostream_iterator (void)
ostream_typestream (void)
OutStrmBuf * strmbuf (void)
const char_typedelimiter (void)
 The delimiter may be NULL, equivalent to an empty string.

Private Attributes

ostream_type_M_stream
const char_type_M_string
OutStrmBuf * _M_strmbuf


Detailed Description

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
class rpa::orow_iterator< Type, OutStrmBuf >

Provides output iterator semantics for streams. It is taken and adapted from the GCC library. For us, its role is to gather the ostream and the delimiter into a single object. We do not have the choice because there is no way to access to the internal components of a std::ostream_iterator. We had the same problem with obuf_iterator< std::back_inserter >.

This class provides an iterator to write to an ostream. The type Tp is the only type written by this iterator and there must be an operator<<(Tp) defined.

Parameters:
Tp The type to write to the ostream.
CharT The ostream char_type.
Traits The ostream char_traits.


Member Typedef Documentation

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
typedef OutStrmBuf::char_type rpa::orow_iterator< Type, OutStrmBuf >::char_type

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
typedef std::ostream_iterator< Type, char_type , traits_type > rpa::orow_iterator< Type, OutStrmBuf >::ostream_iterator_t

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
typedef std::basic_ostream<char_type, traits_type> rpa::orow_iterator< Type, OutStrmBuf >::ostream_type

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
typedef OutStrmBuf::traits_type rpa::orow_iterator< Type, OutStrmBuf >::traits_type


Constructor & Destructor Documentation

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
rpa::orow_iterator< Type, OutStrmBuf >::orow_iterator ( ostream_type __s,
const char_type __c = NULL 
) [inline]

Construct from an ostream.

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
rpa::orow_iterator< Type, OutStrmBuf >::orow_iterator ( const orow_iterator< Type, OutStrmBuf > &  __obj  )  [inline]

Copy constructor.


Member Function Documentation

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
void rpa::orow_iterator< Type, OutStrmBuf >::check ( void   )  const [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
const char_type* rpa::orow_iterator< Type, OutStrmBuf >::delimiter ( void   )  [inline]

The delimiter may be NULL, equivalent to an empty string.

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
orow_iterator& rpa::orow_iterator< Type, OutStrmBuf >::operator * (  )  [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
orow_iterator& rpa::orow_iterator< Type, OutStrmBuf >::operator++ ( int   )  [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
orow_iterator& rpa::orow_iterator< Type, OutStrmBuf >::operator++ (  )  [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
orow_iterator& rpa::orow_iterator< Type, OutStrmBuf >::operator= ( const Type &  __value  )  [inline]

Writes value to underlying ostream using operator<<. If constructed with delimiter string, writes delimiter to ostream.

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
ostream_type& rpa::orow_iterator< Type, OutStrmBuf >::stream ( void   )  [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
OutStrmBuf* rpa::orow_iterator< Type, OutStrmBuf >::strmbuf ( void   )  [inline]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
ostream_iterator_t rpa::orow_iterator< Type, OutStrmBuf >::to_ostream_iterator ( void   )  [inline]

Converts to a plain authentic std::ostream_iterator. NOTE: We must create the class orow_iterator, only because std::ostream_iterator has no accessors.


Member Data Documentation

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
ostream_type* rpa::orow_iterator< Type, OutStrmBuf >::_M_stream [private]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
const char_type* rpa::orow_iterator< Type, OutStrmBuf >::_M_string [private]

template<class Type, class OutStrmBuf = std::basic_streambuf< char, std::char_traits<char> >>
OutStrmBuf* rpa::orow_iterator< Type, OutStrmBuf >::_M_strmbuf [private]


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:38 2007 for rpa by  doxygen 1.4.7