[#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`. |=== == 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=`] | Move‐assign from the specified `original`. | xref:bsl/basic_syncbuf/emit.adoc[`emit`] | Atomically emit buffered characters to the wrapped stream buffer. | 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-09.adoc[`getloc`] | Locale access. | xref:bsl/basic_syncbuf/in_avail-0b.adoc[`in_avail`] | Looking ahead into the stream. | xref:bsl/basic_syncbuf/pubimbue-0d.adoc[`pubimbue`] | Entry point for imbue(). | xref:bsl/basic_syncbuf/pubseekoff-00b.adoc[`pubseekoff`] | Alters the stream position. | xref:bsl/basic_syncbuf/pubseekpos-0e.adoc[`pubseekpos`] | Alters the stream position. | xref:bsl/basic_syncbuf/pubsetbuf-0d.adoc[`pubsetbuf`] | Entry points for derived buffer functions. | xref:bsl/basic_syncbuf/pubsync-01.adoc[`pubsync`] | Calls virtual sync function. | xref:bsl/basic_syncbuf/sbumpc-0a3.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-09.adoc[`sgetc`] | Getting the next character. | xref:bsl/basic_syncbuf/sgetn-0c.adoc[`sgetn`] | Entry point for xsgetn. | xref:bsl/basic_syncbuf/snextc-0a.adoc[`snextc`] | Getting the next character. | xref:bsl/basic_syncbuf/sputbackc-0d.adoc[`sputbackc`] | Pushing characters back into the input stream. | xref:bsl/basic_syncbuf/sputc-06.adoc[`sputc`] | Entry point for all single‐character output functions. | xref:bsl/basic_syncbuf/sputn-08.adoc[`sputn`] | Entry point for all single‐character output functions. | xref:bsl/basic_syncbuf/sungetc-0b.adoc[`sungetc`] | Moving backwards in the input stream. | xref:bsl/basic_syncbuf/swap-05.adoc[`swap`] | Exchange the value of this object with `other`. |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/getloc-06.adoc[`getloc`] | Return the currently imbued locale (inherited). | xref:bsl/basic_syncbuf/in_avail-0e.adoc[`in_avail`] | Return how many characters are available in the get area (inherited). | xref:bsl/basic_syncbuf/pubimbue-03.adoc[`pubimbue`] | Imbue the stream buffer with a locale (inherited). | xref:bsl/basic_syncbuf/pubseekoff-008.adoc[`pubseekoff`] | Seek relative to a position in the sequence (inherited). | xref:bsl/basic_syncbuf/pubseekpos-0d.adoc[`pubseekpos`] | Seek to an absolute position in the sequence (inherited). | xref:bsl/basic_syncbuf/pubsetbuf-04.adoc[`pubsetbuf`] | Associate a character buffer with this stream buffer (inherited). | xref:bsl/basic_syncbuf/pubsync-09.adoc[`pubsync`] | Synchronize the put and/or get area with the underlying sequence (inherited). | xref:bsl/basic_syncbuf/sbumpc-0ab.adoc[`sbumpc`] | Return the current get character and advance the get pointer (inherited). | xref:bsl/basic_syncbuf/sgetc-0f.adoc[`sgetc`] | Return the current get character without advancing (inherited). | xref:bsl/basic_syncbuf/sgetn-04.adoc[`sgetn`] | Read a sequence of characters from the get area (inherited). | xref:bsl/basic_syncbuf/snextc-0d.adoc[`snextc`] | Advance the get pointer and return the next character (inherited). | xref:bsl/basic_syncbuf/sputbackc-0e.adoc[`sputbackc`] | Put a character back into the get area (inherited). | xref:bsl/basic_syncbuf/sputc-0e.adoc[`sputc`] | Write a character to the put area (inherited). | xref:bsl/basic_syncbuf/sputn-0b.adoc[`sputn`] | Write a sequence of characters to the put area (inherited). | xref:bsl/basic_syncbuf/sungetc-0d.adoc[`sungetc`] | Move the get pointer back by one character (inherited). |=== == 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-0c.adoc[`eback`] | Access to the get area. | xref:bsl/basic_syncbuf/egptr-01.adoc[`egptr`] | | xref:bsl/basic_syncbuf/epptr-03.adoc[`epptr`] | | xref:bsl/basic_syncbuf/gbump-02.adoc[`gbump`] | Moving the read position. | xref:bsl/basic_syncbuf/gptr-04.adoc[`gptr`] | | xref:bsl/basic_syncbuf/imbue-06.adoc[`imbue`] [.small]#[virtual]# | Changes translations. | xref:bsl/basic_syncbuf/overflow-05.adoc[`overflow`] | `overflow` overloads | xref:bsl/basic_syncbuf/pbackfail-04e6.adoc[`pbackfail`] [.small]#[virtual]# | Tries to back up the input sequence. | xref:bsl/basic_syncbuf/pbase-03.adoc[`pbase`] | Access to the put area. | xref:bsl/basic_syncbuf/pbump-00.adoc[`pbump`] | Moving the write position. | xref:bsl/basic_syncbuf/pptr-0c.adoc[`pptr`] | | xref:bsl/basic_syncbuf/seekoff-06.adoc[`seekoff`] [.small]#[virtual]# | Alters the stream positions. | xref:bsl/basic_syncbuf/seekpos-04.adoc[`seekpos`] [.small]#[virtual]# | Alters the stream positions. | xref:bsl/basic_syncbuf/setbuf-07.adoc[`setbuf`] [.small]#[virtual]# | Manipulates the buffer. | xref:bsl/basic_syncbuf/setg-06.adoc[`setg`] | Setting the three read area pointers. | xref:bsl/basic_syncbuf/setp-0e.adoc[`setp`] | Setting the three write area pointers. | xref:bsl/basic_syncbuf/showmanyc-05.adoc[`showmanyc`] [.small]#[virtual]# | Investigating the data available. | xref:bsl/basic_syncbuf/swap-07.adoc[`swap`] | | xref:bsl/basic_syncbuf/sync.adoc[`sync`] | Request a flush on the next `emit`, optionally emitting now. | xref:bsl/basic_syncbuf/uflow-08.adoc[`uflow`] [.small]#[virtual]# | Fetches more data from the controlled sequence. | xref:bsl/basic_syncbuf/underflow-04.adoc[`underflow`] [.small]#[virtual]# | Fetches more data from the controlled sequence. | xref:bsl/basic_syncbuf/xsgetn-00.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. |=== == Protected Using Declarations [cols="1,4"] |=== | Name| Description | xref:bsl/basic_syncbuf/eback-05.adoc[`eback`] | Return the start of the get area (inherited). | xref:bsl/basic_syncbuf/egptr-0d.adoc[`egptr`] | Return the end of the get area (inherited). | xref:bsl/basic_syncbuf/epptr-09.adoc[`epptr`] | Return the end of the put area (inherited). | xref:bsl/basic_syncbuf/gbump-0d.adoc[`gbump`] | Advance the get pointer by `n` characters (inherited). | xref:bsl/basic_syncbuf/gptr-09.adoc[`gptr`] | Return the current get pointer (inherited). | xref:bsl/basic_syncbuf/imbue-0b.adoc[`imbue`] | Imbue this stream buffer with a locale (inherited). | xref:bsl/basic_syncbuf/operator=.adoc[`operator=`] | Assign from a base `basic_streambuf` (inherited). | xref:bsl/basic_syncbuf/pbackfail-04e1.adoc[`pbackfail`] | Put a character back into the get area, or fail (inherited). | xref:bsl/basic_syncbuf/pbase-04.adoc[`pbase`] | Return the start of the put area (inherited). | xref:bsl/basic_syncbuf/pbump-0b.adoc[`pbump`] | Advance the put pointer by `n` characters (inherited). | xref:bsl/basic_syncbuf/pptr-05.adoc[`pptr`] | Return the current put pointer (inherited). | xref:bsl/basic_syncbuf/seekoff-01.adoc[`seekoff`] | Seek relative to a position in the controlled sequence (inherited). | xref:bsl/basic_syncbuf/seekpos-0c.adoc[`seekpos`] | Seek to an absolute position in the controlled sequence (inherited). | xref:bsl/basic_syncbuf/setbuf-08.adoc[`setbuf`] | Set an external character buffer (inherited). | xref:bsl/basic_syncbuf/setg-0e.adoc[`setg`] | Set the get area pointers (inherited). | xref:bsl/basic_syncbuf/setp-0f.adoc[`setp`] | Set the put area pointers (inherited). | xref:bsl/basic_syncbuf/showmanyc-0f.adoc[`showmanyc`] | Estimate how many characters can be extracted (inherited). | xref:bsl/basic_syncbuf/swap-0b.adoc[`swap`] | Exchange this buffer with another `basic_streambuf` (inherited). | xref:bsl/basic_syncbuf/uflow-06.adoc[`uflow`] | Return the current get character and advance the get pointer (inherited). | xref:bsl/basic_syncbuf/underflow-0e.adoc[`underflow`] | Return the current get character without advancing (inherited). | xref:bsl/basic_syncbuf/xsgetn-07.adoc[`xsgetn`] | Extract a sequence of characters from the get area (inherited). |=== == 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]#