rpa::row_buffer< Type, DerivStrmBuf, Augm > Class Template Reference

#include <row_buffer.h>

Inheritance diagram for rpa::row_buffer< Type, DerivStrmBuf, Augm >:

rpa::row_type< Type, Augm::char_type, Augm::traits_type > rpa::row_notype< Augm::char_type, Augm::traits_type > List of all members.

Public Types

typedef Augm::char_type char_type
typedef Augm::traits_type traits_type
typedef Type data_type
typedef DerivStrmBuf streambuf_type
typedef Augm augm_t

Public Member Functions

void allocate (void)
 This ensure that the internal streambuf is allocated or available.
bool empty (void) const
void clear (void)
template<class StrmBuf>
void dump_and_clear (StrmBuf *aStrmBuf)
void copy_delim_flags_locale (std::basic_ostream< char_type, traits_type > &aOStr, const char_type *aDelim)
virtual ~row_buffer ()

Protected Types

typedef std::basic_ostream<
char_type, traits_type
BasicOStream

Protected Member Functions

virtual BasicOStreamptr_stream (void)
virtual const BasicOStreamptr_stream (void) const

Protected Attributes

counted_ptr< strm_strmbuf_ptrStrm

Friends

struct buffer_setter< row_buffer< Type, DerivStrmBuf, Augm > >

Classes

struct  strm_strmbuf

Detailed Description

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
class rpa::row_buffer< Type, DerivStrmBuf, Augm >

This encapsulate a stream so that it has some properties of a container. If the temporary output buffer is an ostream, for example when writing into a temporary buffer : We need the maximum number of elements than can be physically stored. Unfortunately, we have no mean for the moment to have a relation with the maximum number of bytes. This generic declaration should never be used and exists for the sole purpose of having specializations per derived class of std::basic_streambuf.


Member Typedef Documentation

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef Augm rpa::row_buffer< Type, DerivStrmBuf, Augm >::augm_t

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef std::basic_ostream< char_type, traits_type > rpa::row_buffer< Type, DerivStrmBuf, Augm >::BasicOStream [protected]

Reimplemented from rpa::row_notype< Augm::char_type, Augm::traits_type >.

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef Augm::char_type rpa::row_buffer< Type, DerivStrmBuf, Augm >::char_type

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef Type rpa::row_buffer< Type, DerivStrmBuf, Augm >::data_type

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef DerivStrmBuf rpa::row_buffer< Type, DerivStrmBuf, Augm >::streambuf_type

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
typedef Augm::traits_type rpa::row_buffer< Type, DerivStrmBuf, Augm >::traits_type


Constructor & Destructor Documentation

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
virtual rpa::row_buffer< Type, DerivStrmBuf, Augm >::~row_buffer (  )  [inline, virtual]


Member Function Documentation

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
void rpa::row_buffer< Type, DerivStrmBuf, Augm >::allocate ( void   )  [inline]

This ensure that the internal streambuf is allocated or available.

All the defaut constructors and assignment operators are allright. They just need to copy the members. The smart pointer is NOT allocated, nor the stream buffer, nor the stream.

This creates a new stream which points on the given streambuffer. 'Augm' must absolutely have a default ctor.

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
void rpa::row_buffer< Type, DerivStrmBuf, Augm >::clear ( void   )  [inline]

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
void rpa::row_buffer< Type, DerivStrmBuf, Augm >::copy_delim_flags_locale ( std::basic_ostream< char_type, traits_type > &  aOStr,
const char_type aDelim 
) [inline]

Used for manipulating the stream, that is, setting the format flags and the locale, to be sure that the output result in this stream is the same as in the global output stream and therefore, that flushing the sub-threads-specific buffers at the end will yield the same result as having a single thread writing into the global stream.

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
template<class StrmBuf>
void rpa::row_buffer< Type, DerivStrmBuf, Augm >::dump_and_clear ( StrmBuf *  aStrmBuf  )  [inline]

Writes the input from its beginning to the current pointer. May choose specializations based on the output streambuf type.

It makes a 'clear' only if something was written.

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
bool rpa::row_buffer< Type, DerivStrmBuf, Augm >::empty ( void   )  const [inline]

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
virtual const BasicOStream* rpa::row_buffer< Type, DerivStrmBuf, Augm >::ptr_stream ( void   )  const [inline, protected, virtual]

Implements rpa::row_notype< Augm::char_type, Augm::traits_type >.

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
virtual BasicOStream* rpa::row_buffer< Type, DerivStrmBuf, Augm >::ptr_stream ( void   )  [inline, protected, virtual]

Implements rpa::row_notype< Augm::char_type, Augm::traits_type >.


Friends And Related Function Documentation

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
friend struct buffer_setter< row_buffer< Type, DerivStrmBuf, Augm > > [friend]

Not used in the general case. This is only when plain STL streambuffers are already existing, and it is necessary to use them as per-thread buffers, by encapsulating their address in a streambuf_proxy<>.


Member Data Documentation

template<class Type, class DerivStrmBuf, class Augm = typename augm_selector< DerivStrmBuf >::augmented_type>
counted_ptr< strm_strmbuf > rpa::row_buffer< Type, DerivStrmBuf, Augm >::_ptrStrm [protected]

The template parameter is any stream buffer : It is augmented by other methods such as 'clear', etc... so that it behaves as a buffer. A base class of this stream buffer must be given to choose the right template specializations, which is necessary for optimizations, and also to create a default constructor. A default constructor is a requirement for the derived template parameter, because one such object is allocated on-the-fly A default constructor is a requirement for the derived template parameter, because one such object is allocated on-the-fly.


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