rpa::augm_basic_streambuf< DerivStrmBuf > Struct Template Reference

#include <row_buffer.h>

Inheritance diagram for rpa::augm_basic_streambuf< DerivStrmBuf >:

rpa::augm_basic_filebuf< DerivStrmBuf > List of all members.

Public Types

typedef DerivStrmBuf::char_type char_type
typedef DerivStrmBuf::traits_type traits_type
typedef DerivStrmBuf::pos_type pos_type
typedef DerivStrmBuf::int_type int_type

Public Member Functions

bool a_empty (void) const
void a_clear (void)
bool a_flush (std::basic_streambuf< char_type, traits_type > *aStrmBuf)
 Dumps the content to a std::ostream. Can be specialized.

Protected Member Functions

std::streamsize flush_to_streambuf (std::basic_streambuf< char_type, traits_type > *__sbout)

Detailed Description

template<class DerivStrmBuf>
struct rpa::augm_basic_streambuf< DerivStrmBuf >

This class derives from a template class parameter, which must too derive from a std::basic_streambuf. Its role is to add a couple of methods, necessary to transform the std::basic_streambuf into a row_buffer which is a pseudo-container, used as thread-specific temporary output buffers.


Member Typedef Documentation

template<class DerivStrmBuf>
typedef DerivStrmBuf::char_type rpa::augm_basic_streambuf< DerivStrmBuf >::char_type

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.

template<class DerivStrmBuf>
typedef DerivStrmBuf::int_type rpa::augm_basic_streambuf< DerivStrmBuf >::int_type

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.

template<class DerivStrmBuf>
typedef DerivStrmBuf::pos_type rpa::augm_basic_streambuf< DerivStrmBuf >::pos_type

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.

template<class DerivStrmBuf>
typedef DerivStrmBuf::traits_type rpa::augm_basic_streambuf< DerivStrmBuf >::traits_type

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.


Member Function Documentation

template<class DerivStrmBuf>
void rpa::augm_basic_streambuf< DerivStrmBuf >::a_clear ( void   )  [inline]

Note that 'clear' is called before 'begout', at first use. Called prior to using it as an output buffer without size limit. Beware that it is not called for limited-size buffer. Therefore, it is not only here that we should empty the buffer.

At opening, the file position is at the beginning, so it is unnecessary to clean it before its first use with 'begout'. We could maybe avoid one call.

This is maybe a pure IO problem. We should display errno too.

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.

template<class DerivStrmBuf>
bool rpa::augm_basic_streambuf< DerivStrmBuf >::a_empty ( void   )  const [inline]

Reimplemented in rpa::augm_basic_filebuf< DerivStrmBuf >.

template<class DerivStrmBuf>
bool rpa::augm_basic_streambuf< DerivStrmBuf >::a_flush ( std::basic_streambuf< char_type, traits_type > *  aStrmBuf  )  [inline]

Dumps the content to a std::ostream. Can be specialized.

Now we can call a function which knows nothing about the class DerivStrmBuf, because all it uses are virtuals.

template<class DerivStrmBuf>
std::streamsize rpa::augm_basic_streambuf< DerivStrmBuf >::flush_to_streambuf ( std::basic_streambuf< char_type, traits_type > *  __sbout  )  [inline, protected]

Adapted from __copy_streambufs bits/streambuf.tcc in g++. "As this member seems to use only standard members, it should be possible to reimplement it with any STL implementation. Conceivably, this could be used to implement buffer-to-buffer copies, if this was ever desired in an un-ambiguous way by the standard. If so, then checks for __ios being zero would be necessary."

Position of last write : Where we are now. This is also the number of chars we must write to the output.

Back to the beginning

Maybe we reached the end.

xsputn is slightly faster than sputn, but is protected.


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