[#bsl-basic_syncbuf] = xref:bsl.adoc[bsl]::basic_syncbuf :relfileprefix: ../ :mrdocs: Forward declaration of `basic_syncbuf`. == Synopsis Declared in `<bslstl_syncbuf.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS = char_traits<CHAR_TYPE>, class ALLOCATOR = xref:bsl/allocator-0df.adoc[allocator<CHAR_TYPE>]> class basic_syncbuf : public std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS> , public xref:BloombergLP/bslstl/SyncBufBase.adoc[BloombergLP::bslstl::SyncBufBase] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS>` | The actual work of input and output (interface). | `xref:BloombergLP/bslstl/SyncBufBase.adoc[BloombergLP::bslstl::SyncBufBase]` | Allocator‐independent base of `basic_syncbuf`. Also this is used by the manipulators: `emit_on_flush`, `noemit_on_flush`, `flush_emit` (the `ALLOCATOR` template argument cannot be deduced from `basic_ostream<CHAR_TYPE, CHAR_TRAITS>`). |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/__streambuf_type.adoc[`__streambuf_type`] | @{ This is a non‐standard type. | xref:bsl/basic_syncbuf/allocator_type.adoc[`allocator_type`] | Allocator type used by this stream buffer. | xref:bsl/basic_syncbuf/char_type.adoc[`char_type`] | Character type manipulated by this stream buffer. | xref:bsl/basic_syncbuf/int_type.adoc[`int_type`] | Integer type returned by stream operations. | xref:bsl/basic_syncbuf/off_type.adoc[`off_type`] | Offset type used by the character traits. | xref:bsl/basic_syncbuf/pos_type.adoc[`pos_type`] | Position type used by the character traits. | xref:bsl/basic_syncbuf/streambuf_type.adoc[`streambuf_type`] | Stream buffer type wrapped by this synchronized buffer. | xref:bsl/basic_syncbuf/traits_type.adoc[`traits_type`] | Character traits type used by this stream buffer. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/2constructor-0a.adoc[`basic_syncbuf`] [.small]#[constructor]# | Constructors | xref:bsl/basic_syncbuf/2destructor.adoc[`~basic_syncbuf`] [.small]#[destructor]# [.small]#[virtual]# | Call `emit`. Any exceptions thrown by `emit` are ignored. | xref:bsl/basic_syncbuf/operator_assign-0e.adoc[`operator=`] | Call `emit()` then assign to this object the value of the specified `original`, and return a reference providing modifiable access to this object. The contents of `original` are move‐assigned to this object. `original.get_wrapped() == nullptr` after the call. | xref:bsl/basic_syncbuf/emit.adoc[`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. The wrapped stream buffer is flushed if and only if a call was made to `sync` since the most recent call to `emit` or construction. Return `true` if `get_wrapped() != nullptr`, and all of the characters in the associated output were successfully transferred, and the flush (if any) succeeded; return `false` otherwise. | xref:bsl/basic_syncbuf/get_allocator.adoc[`get_allocator`] | Return the allocator used to supply memory. | xref:bsl/basic_syncbuf/get_wrapped.adoc[`get_wrapped`] | Return the wrapped buffer supplied at construction. | xref:bsl/basic_syncbuf/getloc.adoc[`getloc`] | Locale access. | xref:bsl/basic_syncbuf/in_avail.adoc[`in_avail`] | Looking ahead into the stream. | xref:bsl/basic_syncbuf/pubimbue.adoc[`pubimbue`] | Entry point for imbue(). | xref:bsl/basic_syncbuf/pubseekoff.adoc[`pubseekoff`] | Alters the stream position. | xref:bsl/basic_syncbuf/pubseekpos.adoc[`pubseekpos`] | Alters the stream position. | xref:bsl/basic_syncbuf/pubsetbuf.adoc[`pubsetbuf`] | Entry points for derived buffer functions. | xref:bsl/basic_syncbuf/pubsync.adoc[`pubsync`] | Calls virtual sync function. | xref:bsl/basic_syncbuf/sbumpc.adoc[`sbumpc`] | Getting the next character. | xref:bsl/basic_syncbuf/set_emit_on_sync.adoc[`set_emit_on_sync`] | Call the `emit` function by each `sync` call if the specified `value` is `true`. | xref:bsl/basic_syncbuf/sgetc.adoc[`sgetc`] | Getting the next character. | xref:bsl/basic_syncbuf/sgetn.adoc[`sgetn`] | Entry point for xsgetn. | xref:bsl/basic_syncbuf/snextc.adoc[`snextc`] | Getting the next character. | xref:bsl/basic_syncbuf/sputbackc.adoc[`sputbackc`] | Pushing characters back into the input stream. | xref:bsl/basic_syncbuf/sputc.adoc[`sputc`] | Entry point for all single‐character output functions. | xref:bsl/basic_syncbuf/sputn.adoc[`sputn`] | Entry point for all single‐character output functions. | xref:bsl/basic_syncbuf/sungetc.adoc[`sungetc`] | Moving backwards in the input stream. | xref:bsl/basic_syncbuf/swap-05.adoc[`swap`] | Efficiently exchange the value of this object with the value of the specified `other` object. The behavior is undefined unless either `*this` and `other` allocators compare equal or `propagate_on_container_swap` is `true`. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/operator_assign-09.adoc[`operator=`] | | xref:bsl/basic_syncbuf/__safe_gbump.adoc[`__safe_gbump`] | | xref:bsl/basic_syncbuf/__safe_pbump.adoc[`__safe_pbump`] | | xref:bsl/basic_syncbuf/eback.adoc[`eback`] | Access to the get area. | xref:bsl/basic_syncbuf/egptr.adoc[`egptr`] | | xref:bsl/basic_syncbuf/epptr.adoc[`epptr`] | | xref:bsl/basic_syncbuf/gbump.adoc[`gbump`] | Moving the read position. | xref:bsl/basic_syncbuf/gptr.adoc[`gptr`] | | xref:bsl/basic_syncbuf/imbue.adoc[`imbue`] [.small]#[virtual]# | Changes translations. | xref:bsl/basic_syncbuf/overflow-05.adoc[`overflow`] | `overflow` overloads | xref:bsl/basic_syncbuf/pbackfail.adoc[`pbackfail`] [.small]#[virtual]# | Tries to back up the input sequence. | xref:bsl/basic_syncbuf/pbase.adoc[`pbase`] | Access to the put area. | xref:bsl/basic_syncbuf/pbump.adoc[`pbump`] | Moving the write position. | xref:bsl/basic_syncbuf/pptr.adoc[`pptr`] | | xref:bsl/basic_syncbuf/seekoff.adoc[`seekoff`] [.small]#[virtual]# | Alters the stream positions. | xref:bsl/basic_syncbuf/seekpos.adoc[`seekpos`] [.small]#[virtual]# | Alters the stream positions. | xref:bsl/basic_syncbuf/setbuf.adoc[`setbuf`] [.small]#[virtual]# | Manipulates the buffer. | xref:bsl/basic_syncbuf/setg.adoc[`setg`] | Setting the three read area pointers. | xref:bsl/basic_syncbuf/setp.adoc[`setp`] | Setting the three write area pointers. | xref:bsl/basic_syncbuf/showmanyc.adoc[`showmanyc`] [.small]#[virtual]# | Investigating the data available. | xref:bsl/basic_syncbuf/swap-07.adoc[`swap`] | | xref:bsl/basic_syncbuf/sync.adoc[`sync`] | Request the wrapped streambuf flush on the next `emit` call, then call `emit` if the "emit‐on‐sync" flag is `true`. Return 0 on success and ‐1 if the `emit` call has failed. | xref:bsl/basic_syncbuf/uflow.adoc[`uflow`] [.small]#[virtual]# | Fetches more data from the controlled sequence. | xref:bsl/basic_syncbuf/underflow.adoc[`underflow`] [.small]#[virtual]# | Fetches more data from the controlled sequence. | xref:bsl/basic_syncbuf/xsgetn.adoc[`xsgetn`] [.small]#[virtual]# | Multiple character extraction. | xref:bsl/basic_syncbuf/xsputn-00.adoc[`xsputn`] | `xsputn` overloads |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/_M_buf_locale.adoc[`_M_buf_locale`] | Current locale setting. | xref:bsl/basic_syncbuf/_M_in_beg.adoc[`_M_in_beg`] | Start of get area. | xref:bsl/basic_syncbuf/_M_in_cur.adoc[`_M_in_cur`] | Current read area. | xref:bsl/basic_syncbuf/_M_in_end.adoc[`_M_in_end`] | End of get area. | xref:bsl/basic_syncbuf/_M_out_beg.adoc[`_M_out_beg`] | Start of put area. | xref:bsl/basic_syncbuf/_M_out_cur.adoc[`_M_out_cur`] | Current put area. | xref:bsl/basic_syncbuf/_M_out_end.adoc[`_M_out_end`] | End of put area. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/swap-0a4.adoc[`swap`] | Swap the specified `a` with the specified `b` using `a.swap(b)` expression. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#