|
BDE 4.39.x Production Release
|
#include <bslstl_osyncstream.h>
This class implements a standard output stream providing an internal buffer to accumulate the written data in order to atomically transmit its entire contents to the wrapped buffer on destruction (or emit call).
Public Types | |
| typedef CHAR_TYPE | char_type |
| typedef CHAR_TRAITS::int_type | int_type |
| typedef CHAR_TRAITS::pos_type | pos_type |
| typedef CHAR_TRAITS::off_type | off_type |
| typedef CHAR_TRAITS | traits_type |
| typedef ALLOCATOR | allocator_type |
| typedef std::basic_streambuf< CHAR_TYPE, CHAR_TRAITS > | streambuf_type |
| typedef basic_syncbuf< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > | syncbuf_type |
Public Member Functions | |
| basic_osyncstream (streambuf_type *wrapped, const ALLOCATOR &allocator=ALLOCATOR()) | |
| basic_osyncstream (std::basic_ostream< CHAR_TYPE, CHAR_TRAITS > &stream, const ALLOCATOR &allocator=ALLOCATOR()) | |
| ~basic_osyncstream ()=default | |
| void | emit () |
| allocator_type | get_allocator () const BSLS_KEYWORD_NOEXCEPT |
| streambuf_type * | get_wrapped () const BSLS_KEYWORD_NOEXCEPT |
| syncbuf_type * | rdbuf () const BSLS_KEYWORD_NOEXCEPT |
| typedef ALLOCATOR bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::allocator_type |
| typedef CHAR_TYPE bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::char_type |
| typedef CHAR_TRAITS::int_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::int_type |
| typedef CHAR_TRAITS::off_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::off_type |
| typedef CHAR_TRAITS::pos_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::pos_type |
| typedef std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS> bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::streambuf_type |
| typedef basic_syncbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::syncbuf_type |
| typedef CHAR_TRAITS bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::traits_type |
|
explicit |
Create a basic_osycnstream object that will forward stream output to the specified wrapped buffer. Optionally specify an allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.
|
explicit |
Create a basic_osycnstream object that will forward stream output to rdbuf of the specified stream. Optionally specify an allocator used to supply memory. If allocator is not supplied, a default-constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.
|
default |
| void bsl::basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::emit | ( | ) |
Atomically transfer any characters buffered by this object to the wrapped stream buffer, so that it appears in the output stream as a contiguous sequence of characters. If an error occurs, set the badbit of the rdstate to true.
|
inline |
Return the allocator used to supply memory.
|
inline |
Return the wrapped buffer.
|
inline |
Return an address providing modifiable access to the basic_syncbuf object that is internally used by this stream object to buffer unformatted characters.