tmp/tmp1l4ph9nb/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Member functions <a id="syncstream.syncbuf.members">[[syncstream.syncbuf.members]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
bool emit();
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Effects:* Atomically transfers the associated output of `*this` to the
|
| 8 |
+
stream buffer `*wrapped`, so that it appears in the output stream as a
|
| 9 |
+
contiguous sequence of characters. `wrapped->pubsync()` is called if and
|
| 10 |
+
only if a call was made to `sync()` since the most recent call to
|
| 11 |
+
`emit()`, if any.
|
| 12 |
+
|
| 13 |
+
*Returns:* `true` if all of the following conditions hold; otherwise
|
| 14 |
+
`false`:
|
| 15 |
+
|
| 16 |
+
- `wrapped == nullptr` is `false`.
|
| 17 |
+
- All of the characters in the associated output were successfully
|
| 18 |
+
transferred.
|
| 19 |
+
- The call to `wrapped->pubsync()` (if any) succeeded.
|
| 20 |
+
|
| 21 |
+
*Ensures:* On success, the associated output is empty.
|
| 22 |
+
|
| 23 |
+
*Synchronization:* All `emit()` calls transferring characters to the
|
| 24 |
+
same stream buffer object appear to execute in a total order consistent
|
| 25 |
+
with the “happens before” relation [[intro.races]], where each `emit()`
|
| 26 |
+
call synchronizes with subsequent `emit()` calls in that total order.
|
| 27 |
+
|
| 28 |
+
*Remarks:* May call member functions of `wrapped` while holding a lock
|
| 29 |
+
uniquely associated with `wrapped`.
|
| 30 |
+
|
| 31 |
+
``` cpp
|
| 32 |
+
streambuf_type* get_wrapped() const noexcept;
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
*Returns:* `wrapped`.
|
| 36 |
+
|
| 37 |
+
``` cpp
|
| 38 |
+
allocator_type get_allocator() const noexcept;
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
*Returns:* A copy of the allocator that was set in the constructor or
|
| 42 |
+
assignment operator.
|
| 43 |
+
|
| 44 |
+
``` cpp
|
| 45 |
+
void set_emit_on_sync(bool b) noexcept;
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
*Effects:* `emit_on_sync = b`.
|
| 49 |
+
|