|
Uni20
Asynchronous tensor and runtime library.
|
Exclusive mutable-access buffer for one Async<T> epoch.
More...
#include <buffers.hpp>
Public Types | |
| using | element_type = std::conditional_t< is_async_alias_v< T >, T const &, T & > |
| using | value_type = T |
Public Member Functions | |
| bool | await_ready () const noexcept |
| Reports whether the writer epoch is immediately writable. | |
| WriteAccessProxy< T > | await_resume () & |
| Resume and return a non-owning mutable write proxy. | |
| OwningWriteAccessProxy< T > | await_resume () && |
| Resume and return an owning mutable write proxy. | |
| WriteAccessProxy< T > | await_resume () const & |
| Resume and return a non-owning mutable write proxy. | |
| void | await_suspend (BasicTask &&t) noexcept |
| Suspend until the writer epoch becomes writable. | |
| template<typename... Args> requires (!is_async_alias_v<T> && std::constructible_from<T, Args...>) | |
| T & | emplace_assert (Args &&... args) |
| Construct the destination value in-place when immediately writable. | |
| std::shared_ptr< EpochContext > | epoch_context_shared () const noexcept |
| Returns the epoch context used for exception propagation. | |
| T | move_from_wait () |
| Wait for writability and move out the contained value. | |
| auto | operator co_await () &&noexcept -> OwningWriteAwaiter< T > |
Enable co_await for rvalue write buffers and transfer ownership. | |
| auto | operator co_await () &noexcept -> WriteBuffer & |
Enable co_await for lvalue write buffers. | |
| auto | operator co_await () const &noexcept -> WriteBuffer const & |
Enable co_await for const lvalue write buffers. | |
| WriteBuffer & | operator= (WriteBuffer &&other) noexcept |
| Move assignment. | |
| WriteBuffer & | operator= (WriteBuffer const &)=delete |
| void | register_exception_sink (TaskPromiseBase &promise, bool explicit_sink) const |
| Register this buffer as an exception sink with a promise. | |
| void | release () noexcept |
| Release the writer epoch held by this buffer. | |
| auto | storage () & |
| Awaiter yielding direct access to writer shared storage. | |
| auto | storage () &&-> OwningStorageAwaiter< T > requires(!is_async_alias_v< T >) |
| Awaiter yielding owning access to writer shared storage. | |
| auto | take () & |
| Awaiter that takes the stored value. | |
| auto | take () &&-> OwningTakeAwaiter< T > requires(!is_async_alias_v< T >) |
| Awaiter that takes the stored value from an rvalue buffer. | |
| auto | take_release () & |
| Awaiter that takes the value and releases the writer epoch. | |
| auto | take_release () &&-> OwningTakeAwaiter< T > requires(!is_async_alias_v< T >) |
| Awaiter that takes the value and releases the writer epoch from an rvalue buffer. | |
| WriteBuffer && | transfer () &&noexcept |
| Transfer this write buffer into the owning-await path. | |
| WriteBuffer && | transfer () &noexcept |
| Transfer this write buffer into the owning-await path. | |
| WriteAssignProxy< T > | write () |
| Build an assignment-only proxy that consumes this writer. | |
| template<typename U > requires (!is_async_alias_v<T> || detail::async_alias_assignment_source<T, U>) | |
| void | write (U &&val) |
| Schedule assignment into this write buffer. | |
| template<typename U > requires ((!is_async_alias_v<T> && std::assignable_from<T&, U &&>) || detail::async_alias_assignable_from<T, U &&>) | |
| void | write_assert (U &&val) |
| Assign immediately when the writer is known to be ready. | |
| template<typename U > requires (!is_async_alias_v<T>) | |
| void | write_move (U &&val) |
| Schedule move-assignment into this write buffer. | |
| template<typename U > requires (!is_async_alias_v<T> && std::assignable_from<T&, U &&>) | |
| void | write_move_assert (U &&val) |
| Move-assign immediately when the writer is known to be ready. | |
| WriteBuffer (EpochContextWriter< T > writer) | |
| Construct a write buffer tied to a writer context. | |
| WriteBuffer (WriteBuffer &&other) noexcept | |
| Move constructor. | |
| WriteBuffer (WriteBuffer const &)=delete | |
| ~WriteBuffer () noexcept | |
| Destructor unregisters exception sink and invalidates debug proxy state. | |
Exclusive mutable-access buffer for one Async<T> epoch.
Write names the exclusive producer role, not write-only memory access. Independent values may be inspected, mutated, constructed, replaced, or moved out. Async aliases expose their descriptor as read-only and permit only ADL-customized write-through assignment. co_await writer yields a borrowed proxy tied to the WriteBuffer<T> object. co_await writer.transfer() yields an owning proxy whose lifetime no longer depends on the original buffer object. Specialized awaiters such as storage() and take() are paths through this one capability; they do not create additional writer epochs.
| using uni20::async::WriteBuffer< T >::element_type = std::conditional_t<is_async_alias_v<T>, T const&, T&> |
| using uni20::async::WriteBuffer< T >::value_type = T |
|
inlineexplicit |
Construct a write buffer tied to a writer context.
| writer | RAII writer handle for this operation. |
|
inlinenoexcept |
Destructor unregisters exception sink and invalidates debug proxy state.
|
delete |
|
inlinenoexcept |
Move constructor.
| other | Source write buffer. |
|
inlinenoexcept |
Reports whether the writer epoch is immediately writable.
true when no suspension is needed.
|
inline |
Resume and return a non-owning mutable write proxy.
|
inline |
Resume and return an owning mutable write proxy.
|
inline |
Resume and return a non-owning mutable write proxy.
|
inlinenoexcept |
Suspend until the writer epoch becomes writable.
| t | Owning task to suspend and enqueue. |
|
inline |
Construct the destination value in-place when immediately writable.
| Args | Constructor argument types. |
| args | Constructor arguments. |
|
inlinenoexcept |
Returns the epoch context used for exception propagation.
|
inline |
Wait for writability and move out the contained value.
|
inlinenoexcept |
Enable co_await for rvalue write buffers and transfer ownership.
|
inlinenoexcept |
Enable co_await for lvalue write buffers.
|
inlinenoexcept |
Enable co_await for const lvalue write buffers.
|
inlinenoexcept |
Move assignment.
| other | Source write buffer. |
*this.
|
delete |
|
inline |
Register this buffer as an exception sink with a promise.
| promise | Promise that owns the sink list. |
| explicit_sink | Whether this sink came from propagate_exceptions_to. |
|
inlinenoexcept |
Release the writer epoch held by this buffer.
|
inline |
Awaiter yielding direct access to writer shared storage.
|
inline |
Awaiter yielding owning access to writer shared storage.
|
inline |
Awaiter that takes the stored value.
|
inline |
Awaiter that takes the stored value from an rvalue buffer.
|
inline |
Awaiter that takes the value and releases the writer epoch.
|
inline |
Awaiter that takes the value and releases the writer epoch from an rvalue buffer.
|
inlinenoexcept |
Transfer this write buffer into the owning-await path.
*this.
|
inlinenoexcept |
Transfer this write buffer into the owning-await path.
*this. | WriteAssignProxy< T > uni20::async::WriteBuffer< T >::write | ( | ) |
Build an assignment-only proxy that consumes this writer.
Build an assignment-only proxy from a write buffer.
| T | Stored value type. |
|
inline |
Schedule assignment into this write buffer.
| U | Source type. |
| val | Source expression. |
|
inline |
Assign immediately when the writer is known to be ready.
| U | Source type assignable to T&. |
| val | Source value. |
|
inline |
Schedule move-assignment into this write buffer.
| U | Source type. |
| val | Source expression. |
|
inline |
Move-assign immediately when the writer is known to be ready.
| U | Source type assignable to T&. |
| val | Source value. |