#include <row_buffer.h>
Inheritance diagram for rpa::row_buffer< Type, DerivStrmBuf, Augm >:
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 BasicOStream * | ptr_stream (void) |
virtual const BasicOStream * | ptr_stream (void) const |
Protected Attributes | |
counted_ptr< strm_strmbuf > | _ptrStrm |
Friends | |
struct | buffer_setter< row_buffer< Type, DerivStrmBuf, Augm > > |
Classes | |
struct | strm_strmbuf |
typedef Augm rpa::row_buffer< Type, DerivStrmBuf, Augm >::augm_t |
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 >.
typedef Augm::char_type rpa::row_buffer< Type, DerivStrmBuf, Augm >::char_type |
typedef Type rpa::row_buffer< Type, DerivStrmBuf, Augm >::data_type |
typedef DerivStrmBuf rpa::row_buffer< Type, DerivStrmBuf, Augm >::streambuf_type |
typedef Augm::traits_type rpa::row_buffer< Type, DerivStrmBuf, Augm >::traits_type |
virtual rpa::row_buffer< Type, DerivStrmBuf, Augm >::~row_buffer | ( | ) | [inline, virtual] |
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.
void rpa::row_buffer< Type, DerivStrmBuf, Augm >::clear | ( | void | ) | [inline] |
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.
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.
bool rpa::row_buffer< Type, DerivStrmBuf, Augm >::empty | ( | void | ) | const [inline] |
virtual const BasicOStream* rpa::row_buffer< Type, DerivStrmBuf, Augm >::ptr_stream | ( | void | ) | const [inline, protected, virtual] |
virtual BasicOStream* rpa::row_buffer< Type, DerivStrmBuf, Augm >::ptr_stream | ( | void | ) | [inline, protected, virtual] |
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<>.
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.