[syncstream.syncbuf.members] (original) (raw)
31 Input/output library [input.output]
31.11 Synchronized output streams [syncstream]
31.11.2 Class template basic_syncbuf [syncstream.syncbuf]
31.11.2.4 Member functions [syncstream.syncbuf.members]
Effects: Atomically transfers the associated output of *thisto the stream buffer *wrapped, so that it appears in the output stream as a contiguous sequence of characters.
_wrapped_->pubsync() is called if and only if a call was made to sync()since the most recent call to emit(), if any.
Synchronization: All emit() calls transferring characters to the same stream buffer object appear to execute in a total order consistent with the “happens before” relation ([intro.races]), where each emit() call synchronizes with subsequent emit() calls in that total order.
Postconditions: On success, the associated output is empty.
Returns: true if all of the following conditions hold; otherwise false:
- wrapped == nullptr is false.
- All of the characters in the associated output were successfully transferred.
- The call to _wrapped_->pubsync() (if any) succeeded.
Remarks: May call member functions of _wrapped_while holding a lock uniquely associated with wrapped.
streambuf_type* get_wrapped() const noexcept;
allocator_type get_allocator() const noexcept;
Returns: A copy of the allocator that was set in the constructor or assignment operator.
void set_emit_on_sync(bool b) noexcept;
Effects: emit-on-sync = b.