|
Uni20
Asynchronous tensor and runtime library.
|
RAII-scoped representation of a writer’s participation in an epoch. More...
#include <epoch_context.hpp>
Public Member Functions | |
| T & | data () const |
| Access the stored data while holding the writer gate. | |
| template<typename... Args> requires std::constructible_from<T, Args...> | |
| T & | emplace (Args &&... args) |
| std::shared_ptr< EpochContext > | epoch_context_shared () const noexcept |
| EpochContextWriter ()=delete | |
| EpochContextWriter (EpochContextWriter &&other) noexcept | |
| Move constructor transferring the writer handle. | |
| EpochContextWriter (shared_storage< T > storage, std::shared_ptr< EpochContext > epoch) noexcept | |
| Construct an active writer. | |
| T && | move_from_wait () |
| Wait for the epoch to become available, and then return a prvalue-reference to the value. | |
| operator bool () const noexcept | |
| Copy constructor acquiring a writer reference for diagnostics. | |
| EpochContextWriter & | operator= (EpochContextWriter &&other) noexcept |
| Move assignment transferring the writer handle. | |
| EpochContextWriter & | operator= (EpochContextWriter const &)=delete |
| bool | ready () const noexcept |
| Check whether the writer may proceed immediately. | |
| void | release () noexcept |
| Wait for the epoch to become available, and then return a prvalue-reference to the value. | |
| void | resume () const noexcept |
| void | set_exception (std::exception_ptr e) const noexcept |
| shared_storage< T > & | storage () |
| void | suspend (BasicTask &&t) |
| Suspend the writer task and submit to the epoch context. | |
| bool | value_is_initialized () const noexcept |
| Report whether the associated value is currently initialized. | |
| ~EpochContextWriter () | |
| Destructor releasing any held writer epoch. | |
RAII-scoped representation of a writer’s participation in an epoch.
Constructed by EpochQueue and passed into a WriteBuffer<T>, this class manages the binding and release of a writer coroutine to a single EpochContext. It ensures that the write gate is completed exactly once, either manually via release() or automatically on destruction.
|
delete |
|
inlinenoexcept |
Construct an active writer.
| value | Shared pointer to the stored value. |
| epoch | Epoch tracked by this writer. |
|
inlinenoexcept |
Move constructor transferring the writer handle.
| other | Writer being moved from. |
|
inline |
Destructor releasing any held writer epoch.
|
inline |
Access the stored data while holding the writer gate.
| buffer_write_uninitialized | if storage is not yet constructed. |
|
inline |
|
inlinenoexcept |
| T && uni20::async::EpochContextWriter< T >::move_from_wait | ( | ) |
Wait for the epoch to become available, and then return a prvalue-reference to the value.
Wait for a writer context and move out the stored value.
| T | Stored value type. |
|
inlineexplicitnoexcept |
Copy constructor acquiring a writer reference for diagnostics.
|
inlinenoexcept |
Move assignment transferring the writer handle.
| other | Writer being moved from. |
|
delete |
|
inlinenoexcept |
Check whether the writer may proceed immediately.
|
inlinenoexcept |
Wait for the epoch to become available, and then return a prvalue-reference to the value.
Finalize this write gate, if not already done.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
Suspend the writer task and submit to the epoch context.
| t | The coroutine to bind and schedule. |
|
inlinenoexcept |
Report whether the associated value is currently initialized.