BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > Class Template Reference

#include <bslstl_osyncstream.h>

Inheritance diagram for bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >:

Detailed Description

template<class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
class bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >

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).

See bslstl_osyncstream

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_TRAITSstreambuf_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_typeget_wrapped () const BSLS_KEYWORD_NOEXCEPT
 
syncbuf_typerdbuf () const BSLS_KEYWORD_NOEXCEPT
 

Member Typedef Documentation

◆ allocator_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef ALLOCATOR bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::allocator_type

◆ char_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TYPE bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::char_type

◆ int_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS::int_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::int_type

◆ off_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS::off_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::off_type

◆ pos_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS::pos_type bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::pos_type

◆ streambuf_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS> bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::streambuf_type

◆ syncbuf_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef basic_syncbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::syncbuf_type

◆ traits_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::traits_type

Constructor & Destructor Documentation

◆ basic_osyncstream() [1/2]

template<class CHAR , class TRAITS , class ALLOCATOR >
bsl::basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::basic_osyncstream ( streambuf_type wrapped,
const ALLOCATOR &  allocator = ALLOCATOR() 
)
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.

◆ basic_osyncstream() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_osyncstream ( std::basic_ostream< CHAR_TYPE, CHAR_TRAITS > &  stream,
const ALLOCATOR &  allocator = ALLOCATOR() 
)
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.

◆ ~basic_osyncstream()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_osyncstream< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::~basic_osyncstream ( )
default

Member Function Documentation

◆ emit()

template<class CHAR , class TRAITS , class ALLOCATOR >
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.

◆ get_allocator()

template<class CHAR , class TRAITS , class ALLOCATOR >
ALLOCATOR bsl::basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::get_allocator ( ) const
inline

Return the allocator used to supply memory.

◆ get_wrapped()

template<class CHAR , class TRAITS , class ALLOCATOR >
basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::streambuf_type * bsl::basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::get_wrapped ( ) const
inline

Return the wrapped buffer.

◆ rdbuf()

template<class CHAR , class TRAITS , class ALLOCATOR >
basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::syncbuf_type * bsl::basic_osyncstream< CHAR, TRAITS, ALLOCATOR >::rdbuf ( ) const
inline

Return an address providing modifiable access to the basic_syncbuf object that is internally used by this stream object to buffer unformatted characters.


The documentation for this class was generated from the following files: