Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uni20::async::OwningTakeAwaiter< T > Class Template Reference

Awaiter that takes and releases a value from an owning writer. More...

#include <buffers.hpp>

Public Member Functions

bool await_ready () const noexcept
 Reports whether the writer epoch is immediately writable.
 
T await_resume ()
 Resume, move out the value, and release the writer epoch.
 
void await_suspend (BasicTask &&t) noexcept
 Suspend until the writer epoch becomes writable.
 
std::shared_ptr< EpochContext > epoch_context_shared () const noexcept
 Returns the epoch context used for exception propagation.
 
 OwningTakeAwaiter (EpochContextWriter< T > &&writer)
 Construct from an owning writer.
 

Detailed Description

template<typename T>
class uni20::async::OwningTakeAwaiter< T >

Awaiter that takes and releases a value from an owning writer.

Template Parameters
TStored value type.

Constructor & Destructor Documentation

◆ OwningTakeAwaiter()

template<typename T >
uni20::async::OwningTakeAwaiter< T >::OwningTakeAwaiter ( EpochContextWriter< T > &&  writer)
inlineexplicit

Construct from an owning writer.

Parameters
writerWriter handle transferred into this awaiter.

Member Function Documentation

◆ await_ready()

template<typename T >
bool uni20::async::OwningTakeAwaiter< T >::await_ready ( ) const
inlinenoexcept

Reports whether the writer epoch is immediately writable.

Returns
true when no suspension is needed.

◆ await_resume()

template<typename T >
T uni20::async::OwningTakeAwaiter< T >::await_resume ( )
inline

Resume, move out the value, and release the writer epoch.

Returns
Moved value.

◆ await_suspend()

template<typename T >
void uni20::async::OwningTakeAwaiter< T >::await_suspend ( BasicTask &&  t)
inlinenoexcept

Suspend until the writer epoch becomes writable.

Parameters
tOwning task to suspend and enqueue.

◆ epoch_context_shared()

template<typename T >
std::shared_ptr< EpochContext > uni20::async::OwningTakeAwaiter< T >::epoch_context_shared ( ) const
inlinenoexcept

Returns the epoch context used for exception propagation.

Returns
Shared pointer to the epoch context.

The documentation for this class was generated from the following file: