[#bsl-basic_syncbuf]
= xref:bsl.adoc[bsl]::basic&lowbar;syncbuf
:relfileprefix: ../
:mrdocs:

Forward declaration of `basic&lowbar;syncbuf`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;syncbuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS = char&lowbar;traits&lt;CHAR&lowbar;TYPE&gt;,
    class ALLOCATOR = xref:bsl/allocator-0df.adoc[allocator&lt;CHAR&lowbar;TYPE&gt;]&gt;
class basic&lowbar;syncbuf
    : public std::basic&lowbar;streambuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;
    , public xref:BloombergLP/bslstl/SyncBufBase.adoc[BloombergLP::bslstl::SyncBufBase]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `std::basic&lowbar;streambuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;`
| The actual work of input and output (interface)&period;
| `xref:BloombergLP/bslstl/SyncBufBase.adoc[BloombergLP::bslstl::SyncBufBase]`
| Allocator&hyphen;independent base of `basic&lowbar;syncbuf`&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/basic_syncbuf/__streambuf_type.adoc[`&lowbar;&lowbar;streambuf&lowbar;type`] 
| @&lcub; This is a non&hyphen;standard type&period;
| xref:bsl/basic_syncbuf/allocator_type.adoc[`allocator&lowbar;type`] 
| Allocator type used by this stream buffer&period;
| xref:bsl/basic_syncbuf/char_type.adoc[`char&lowbar;type`] 
| Character type manipulated by this stream buffer&period;
| xref:bsl/basic_syncbuf/int_type.adoc[`int&lowbar;type`] 
| Integer type returned by stream operations&period;
| xref:bsl/basic_syncbuf/off_type.adoc[`off&lowbar;type`] 
| Offset type used by the character traits&period;
| xref:bsl/basic_syncbuf/pos_type.adoc[`pos&lowbar;type`] 
| Position type used by the character traits&period;
| xref:bsl/basic_syncbuf/streambuf_type.adoc[`streambuf&lowbar;type`] 
| Stream buffer type wrapped by this synchronized buffer&period;
| xref:bsl/basic_syncbuf/traits_type.adoc[`traits&lowbar;type`] 
| Character traits type used by this stream buffer&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/basic_syncbuf/2constructor-0a.adoc[`basic&lowbar;syncbuf`]         [.small]#[constructor]#
| Constructors
| xref:bsl/basic_syncbuf/2destructor.adoc[`&#126;basic&lowbar;syncbuf`] [.small]#[destructor]# [.small]#[virtual]#
| Call `emit`&period; Any exceptions thrown by `emit` are ignored&period;
| xref:bsl/basic_syncbuf/operator_assign-0e.adoc[`operator&equals;`] 
| Move&hyphen;assign from the specified `original`&period;
| xref:bsl/basic_syncbuf/emit.adoc[`emit`] 
| Atomically emit buffered characters to the wrapped stream buffer&period;
| xref:bsl/basic_syncbuf/get_allocator.adoc[`get&lowbar;allocator`] 
| Return the allocator used to supply memory&period;
| xref:bsl/basic_syncbuf/get_wrapped.adoc[`get&lowbar;wrapped`] 
| Return the wrapped buffer supplied at construction&period;
| xref:bsl/basic_syncbuf/getloc-09.adoc[`getloc`] 
| Locale access&period;
| xref:bsl/basic_syncbuf/in_avail-0b.adoc[`in&lowbar;avail`] 
| Looking ahead into the stream&period;
| xref:bsl/basic_syncbuf/pubimbue-0d.adoc[`pubimbue`] 
| Entry point for imbue()&period;
| xref:bsl/basic_syncbuf/pubseekoff-00b.adoc[`pubseekoff`] 
| Alters the stream position&period;
| xref:bsl/basic_syncbuf/pubseekpos-0e.adoc[`pubseekpos`] 
| Alters the stream position&period;
| xref:bsl/basic_syncbuf/pubsetbuf-0d.adoc[`pubsetbuf`] 
| Entry points for derived buffer functions&period;
| xref:bsl/basic_syncbuf/pubsync-01.adoc[`pubsync`] 
| Calls virtual sync function&period;
| xref:bsl/basic_syncbuf/sbumpc-0a3.adoc[`sbumpc`] 
| Getting the next character&period;
| xref:bsl/basic_syncbuf/set_emit_on_sync.adoc[`set&lowbar;emit&lowbar;on&lowbar;sync`] 
| Call the `emit` function by each `sync` call if the specified `value` is `true`&period;
| xref:bsl/basic_syncbuf/sgetc-09.adoc[`sgetc`] 
| Getting the next character&period;
| xref:bsl/basic_syncbuf/sgetn-0c.adoc[`sgetn`] 
| Entry point for xsgetn&period;
| xref:bsl/basic_syncbuf/snextc-0a.adoc[`snextc`] 
| Getting the next character&period;
| xref:bsl/basic_syncbuf/sputbackc-0d.adoc[`sputbackc`] 
| Pushing characters back into the input stream&period;
| xref:bsl/basic_syncbuf/sputc-06.adoc[`sputc`] 
| Entry point for all single&hyphen;character output functions&period;
| xref:bsl/basic_syncbuf/sputn-08.adoc[`sputn`] 
| Entry point for all single&hyphen;character output functions&period;
| xref:bsl/basic_syncbuf/sungetc-0b.adoc[`sungetc`] 
| Moving backwards in the input stream&period;
| xref:bsl/basic_syncbuf/swap-05.adoc[`swap`] 
| Exchange the value of this object with `other`&period;
|===


== Using Declarations

[cols="1,4"]
|===
| Name| Description
| xref:bsl/basic_syncbuf/getloc-06.adoc[`getloc`] 
| Return the currently imbued locale (inherited)&period;
| xref:bsl/basic_syncbuf/in_avail-0e.adoc[`in&lowbar;avail`] 
| Return how many characters are available in the get area (inherited)&period;
| xref:bsl/basic_syncbuf/pubimbue-03.adoc[`pubimbue`] 
| Imbue the stream buffer with a locale (inherited)&period;
| xref:bsl/basic_syncbuf/pubseekoff-008.adoc[`pubseekoff`] 
| Seek relative to a position in the sequence (inherited)&period;
| xref:bsl/basic_syncbuf/pubseekpos-0d.adoc[`pubseekpos`] 
| Seek to an absolute position in the sequence (inherited)&period;
| xref:bsl/basic_syncbuf/pubsetbuf-04.adoc[`pubsetbuf`] 
| Associate a character buffer with this stream buffer (inherited)&period;
| xref:bsl/basic_syncbuf/pubsync-09.adoc[`pubsync`] 
| Synchronize the put and&sol;or get area with the underlying sequence (inherited)&period;
| xref:bsl/basic_syncbuf/sbumpc-0ab.adoc[`sbumpc`] 
| Return the current get character and advance the get pointer (inherited)&period;
| xref:bsl/basic_syncbuf/sgetc-0f.adoc[`sgetc`] 
| Return the current get character without advancing (inherited)&period;
| xref:bsl/basic_syncbuf/sgetn-04.adoc[`sgetn`] 
| Read a sequence of characters from the get area (inherited)&period;
| xref:bsl/basic_syncbuf/snextc-0d.adoc[`snextc`] 
| Advance the get pointer and return the next character (inherited)&period;
| xref:bsl/basic_syncbuf/sputbackc-0e.adoc[`sputbackc`] 
| Put a character back into the get area (inherited)&period;
| xref:bsl/basic_syncbuf/sputc-0e.adoc[`sputc`] 
| Write a character to the put area (inherited)&period;
| xref:bsl/basic_syncbuf/sputn-0b.adoc[`sputn`] 
| Write a sequence of characters to the put area (inherited)&period;
| xref:bsl/basic_syncbuf/sungetc-0d.adoc[`sungetc`] 
| Move the get pointer back by one character (inherited)&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/basic_syncbuf/operator_assign-09.adoc[`operator&equals;`] 
| 
| xref:bsl/basic_syncbuf/__safe_gbump.adoc[`&lowbar;&lowbar;safe&lowbar;gbump`] 
| 
| xref:bsl/basic_syncbuf/__safe_pbump.adoc[`&lowbar;&lowbar;safe&lowbar;pbump`] 
| 
| xref:bsl/basic_syncbuf/eback-0c.adoc[`eback`] 
| Access to the get area&period;
| 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&period;
| xref:bsl/basic_syncbuf/gptr-04.adoc[`gptr`] 
| 
| xref:bsl/basic_syncbuf/imbue-06.adoc[`imbue`]  [.small]#[virtual]#
| Changes translations&period;
| 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&period;
| xref:bsl/basic_syncbuf/pbase-03.adoc[`pbase`] 
| Access to the put area&period;
| xref:bsl/basic_syncbuf/pbump-00.adoc[`pbump`] 
| Moving the write position&period;
| xref:bsl/basic_syncbuf/pptr-0c.adoc[`pptr`] 
| 
| xref:bsl/basic_syncbuf/seekoff-06.adoc[`seekoff`]  [.small]#[virtual]#
| Alters the stream positions&period;
| xref:bsl/basic_syncbuf/seekpos-04.adoc[`seekpos`]  [.small]#[virtual]#
| Alters the stream positions&period;
| xref:bsl/basic_syncbuf/setbuf-07.adoc[`setbuf`]  [.small]#[virtual]#
| Manipulates the buffer&period;
| xref:bsl/basic_syncbuf/setg-06.adoc[`setg`] 
| Setting the three read area pointers&period;
| xref:bsl/basic_syncbuf/setp-0e.adoc[`setp`] 
| Setting the three write area pointers&period;
| xref:bsl/basic_syncbuf/showmanyc-05.adoc[`showmanyc`]  [.small]#[virtual]#
| Investigating the data available&period;
| 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&period;
| xref:bsl/basic_syncbuf/uflow-08.adoc[`uflow`]  [.small]#[virtual]#
| Fetches more data from the controlled sequence&period;
| xref:bsl/basic_syncbuf/underflow-04.adoc[`underflow`]  [.small]#[virtual]#
| Fetches more data from the controlled sequence&period;
| xref:bsl/basic_syncbuf/xsgetn-00.adoc[`xsgetn`]  [.small]#[virtual]#
| Multiple character extraction&period;
| 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[`&lowbar;M&lowbar;buf&lowbar;locale`] 
| Current locale setting&period;
| xref:bsl/basic_syncbuf/_M_in_beg.adoc[`&lowbar;M&lowbar;in&lowbar;beg`] 
| Start of get area&period;
| xref:bsl/basic_syncbuf/_M_in_cur.adoc[`&lowbar;M&lowbar;in&lowbar;cur`] 
| Current read area&period;
| xref:bsl/basic_syncbuf/_M_in_end.adoc[`&lowbar;M&lowbar;in&lowbar;end`] 
| End of get area&period;
| xref:bsl/basic_syncbuf/_M_out_beg.adoc[`&lowbar;M&lowbar;out&lowbar;beg`] 
| Start of put area&period;
| xref:bsl/basic_syncbuf/_M_out_cur.adoc[`&lowbar;M&lowbar;out&lowbar;cur`] 
| Current put area&period;
| xref:bsl/basic_syncbuf/_M_out_end.adoc[`&lowbar;M&lowbar;out&lowbar;end`] 
| End of put area&period;
|===


== Protected Using Declarations

[cols="1,4"]
|===
| Name| Description
| xref:bsl/basic_syncbuf/eback-05.adoc[`eback`] 
| Return the start of the get area (inherited)&period;
| xref:bsl/basic_syncbuf/egptr-0d.adoc[`egptr`] 
| Return the end of the get area (inherited)&period;
| xref:bsl/basic_syncbuf/epptr-09.adoc[`epptr`] 
| Return the end of the put area (inherited)&period;
| xref:bsl/basic_syncbuf/gbump-0d.adoc[`gbump`] 
| Advance the get pointer by `n` characters (inherited)&period;
| xref:bsl/basic_syncbuf/gptr-09.adoc[`gptr`] 
| Return the current get pointer (inherited)&period;
| xref:bsl/basic_syncbuf/imbue-0b.adoc[`imbue`] 
| Imbue this stream buffer with a locale (inherited)&period;
| xref:bsl/basic_syncbuf/operator=.adoc[`operator&equals;`] 
| Assign from a base `basic&lowbar;streambuf` (inherited)&period;
| xref:bsl/basic_syncbuf/pbackfail-04e1.adoc[`pbackfail`] 
| Put a character back into the get area, or fail (inherited)&period;
| xref:bsl/basic_syncbuf/pbase-04.adoc[`pbase`] 
| Return the start of the put area (inherited)&period;
| xref:bsl/basic_syncbuf/pbump-0b.adoc[`pbump`] 
| Advance the put pointer by `n` characters (inherited)&period;
| xref:bsl/basic_syncbuf/pptr-05.adoc[`pptr`] 
| Return the current put pointer (inherited)&period;
| xref:bsl/basic_syncbuf/seekoff-01.adoc[`seekoff`] 
| Seek relative to a position in the controlled sequence (inherited)&period;
| xref:bsl/basic_syncbuf/seekpos-0c.adoc[`seekpos`] 
| Seek to an absolute position in the controlled sequence (inherited)&period;
| xref:bsl/basic_syncbuf/setbuf-08.adoc[`setbuf`] 
| Set an external character buffer (inherited)&period;
| xref:bsl/basic_syncbuf/setg-0e.adoc[`setg`] 
| Set the get area pointers (inherited)&period;
| xref:bsl/basic_syncbuf/setp-0f.adoc[`setp`] 
| Set the put area pointers (inherited)&period;
| xref:bsl/basic_syncbuf/showmanyc-0f.adoc[`showmanyc`] 
| Estimate how many characters can be extracted (inherited)&period;
| xref:bsl/basic_syncbuf/swap-0b.adoc[`swap`] 
| Exchange this buffer with another `basic&lowbar;streambuf` (inherited)&period;
| xref:bsl/basic_syncbuf/uflow-06.adoc[`uflow`] 
| Return the current get character and advance the get pointer (inherited)&period;
| xref:bsl/basic_syncbuf/underflow-0e.adoc[`underflow`] 
| Return the current get character without advancing (inherited)&period;
| xref:bsl/basic_syncbuf/xsgetn-07.adoc[`xsgetn`] 
| Extract a sequence of characters from the get area (inherited)&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/swap-0a4.adoc[`swap`]
| Swap the specified `a` with the specified `b` using `a&period;swap(b)` expression&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
