Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::async::Task< T, Allocator > Class Template Reference

Lightweight C++20 coroutine task with zero-heap resumption chaining and configurable frame allocator. More...

#include <Task.hpp>

+ Collaboration diagram for corium::async::Task< T, Allocator >:

Classes

struct  promise_type
 

Public Types

using AllocatorType = Allocator
 
using ValueType = T
 

Public Member Functions

bool await_ready () const noexcept
 Awaiter interface for co_await chaining.
 
await_resume ()
 
std::coroutine_handle await_suspend (std::coroutine_handle<> awaiting) noexcept
 
bool done () const noexcept
 Check if coroutine has completed execution.
 
std::coroutine_handle< promise_typehandle () const noexcept
 Access raw coroutine handle.
 
Taskoperator= (const Task &)=delete
 
Taskoperator= (Task &&other) noexcept
 
void resume ()
 Resume the coroutine explicitly.
 
constexpr Task () noexcept=default
 
 Task (const Task &)=delete
 
 Task (std::coroutine_handle< promise_type > handle) noexcept
 
 Task (Task &&other) noexcept
 
 ~Task ()
 

Detailed Description

template<typename T = void, typename Allocator = HeapFrameAllocator>
class corium::async::Task< T, Allocator >

Lightweight C++20 coroutine task with zero-heap resumption chaining and configurable frame allocator.

Template Parameters
TResult type returned by the coroutine (defaults to void).
AllocatorFrame allocation policy (HeapFrameAllocator default or StaticFrameAllocator).

Member Typedef Documentation

◆ AllocatorType

template<typename T = void, typename Allocator = HeapFrameAllocator>
using corium::async::Task< T, Allocator >::AllocatorType = Allocator

◆ ValueType

template<typename T = void, typename Allocator = HeapFrameAllocator>
using corium::async::Task< T, Allocator >::ValueType = T

Constructor & Destructor Documentation

◆ Task() [1/4]

template<typename T = void, typename Allocator = HeapFrameAllocator>
constexpr corium::async::Task< T, Allocator >::Task ( )
constexprdefaultnoexcept
+ Here is the caller graph for this function:

◆ Task() [2/4]

template<typename T = void, typename Allocator = HeapFrameAllocator>
corium::async::Task< T, Allocator >::Task ( std::coroutine_handle< promise_type handle)
inlineexplicitnoexcept

◆ ~Task()

template<typename T = void, typename Allocator = HeapFrameAllocator>
corium::async::Task< T, Allocator >::~Task ( )
inline

◆ Task() [3/4]

template<typename T = void, typename Allocator = HeapFrameAllocator>
corium::async::Task< T, Allocator >::Task ( const Task< T, Allocator > &  )
delete

◆ Task() [4/4]

template<typename T = void, typename Allocator = HeapFrameAllocator>
corium::async::Task< T, Allocator >::Task ( Task< T, Allocator > &&  other)
inlinenoexcept

Member Function Documentation

◆ await_ready()

template<typename T = void, typename Allocator = HeapFrameAllocator>
bool corium::async::Task< T, Allocator >::await_ready ( ) const
inlinenoexcept

Awaiter interface for co_await chaining.

◆ await_resume()

template<typename T = void, typename Allocator = HeapFrameAllocator>
T corium::async::Task< T, Allocator >::await_resume ( )
inline

◆ await_suspend()

template<typename T = void, typename Allocator = HeapFrameAllocator>
std::coroutine_handle corium::async::Task< T, Allocator >::await_suspend ( std::coroutine_handle<>  awaiting)
inlinenoexcept

◆ done()

template<typename T = void, typename Allocator = HeapFrameAllocator>
bool corium::async::Task< T, Allocator >::done ( ) const
inlinenoexcept

Check if coroutine has completed execution.

◆ handle()

template<typename T = void, typename Allocator = HeapFrameAllocator>
std::coroutine_handle< promise_type > corium::async::Task< T, Allocator >::handle ( ) const
inlinenoexcept

Access raw coroutine handle.

◆ operator=() [1/2]

template<typename T = void, typename Allocator = HeapFrameAllocator>
Task & corium::async::Task< T, Allocator >::operator= ( const Task< T, Allocator > &  )
delete

◆ operator=() [2/2]

template<typename T = void, typename Allocator = HeapFrameAllocator>
Task & corium::async::Task< T, Allocator >::operator= ( Task< T, Allocator > &&  other)
inlinenoexcept

◆ resume()

template<typename T = void, typename Allocator = HeapFrameAllocator>
void corium::async::Task< T, Allocator >::resume ( )
inline

Resume the coroutine explicitly.


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