Container System 0.1.0
High-performance C++20 type-safe container framework with SIMD-accelerated serialization
Loading...
Searching...
No Matches
kcenon::container::async::detail::async_state< T > Struct Template Reference

Shared state for async operations. More...

#include <async_container.h>

Collaboration diagram for kcenon::container::async::detail::async_state< T >:
Collaboration graph

Public Member Functions

 async_state (std::function< T()> work)
 
 async_state (const async_state &)=delete
 
async_stateoperator= (const async_state &)=delete
 
 async_state (async_state &&)=delete
 
async_stateoperator= (async_state &&)=delete
 

Public Attributes

std::function< T()> work_
 
std::optional< T > result_
 
std::exception_ptr exception_
 
std::atomic< bool > ready_ {false}
 

Detailed Description

template<typename T>
struct kcenon::container::async::detail::async_state< T >

Shared state for async operations.

This state is shared between the awaitable and the worker thread using shared_ptr, ensuring thread-safe access even when the awaitable is moved or destroyed.

Definition at line 66 of file async_container.h.

Constructor & Destructor Documentation

◆ async_state() [1/3]

template<typename T >
kcenon::container::async::detail::async_state< T >::async_state ( std::function< T()> work)
inlineexplicit

Definition at line 73 of file async_container.h.

74 : work_(std::move(work)) {}

◆ async_state() [2/3]

template<typename T >
kcenon::container::async::detail::async_state< T >::async_state ( const async_state< T > & )
delete

◆ async_state() [3/3]

template<typename T >
kcenon::container::async::detail::async_state< T >::async_state ( async_state< T > && )
delete

Member Function Documentation

◆ operator=() [1/2]

template<typename T >
async_state & kcenon::container::async::detail::async_state< T >::operator= ( async_state< T > && )
delete

◆ operator=() [2/2]

template<typename T >
async_state & kcenon::container::async::detail::async_state< T >::operator= ( const async_state< T > & )
delete

Member Data Documentation

◆ exception_

template<typename T >
std::exception_ptr kcenon::container::async::detail::async_state< T >::exception_

Definition at line 70 of file async_container.h.

◆ ready_

template<typename T >
std::atomic<bool> kcenon::container::async::detail::async_state< T >::ready_ {false}

Definition at line 71 of file async_container.h.

71{false};

◆ result_

template<typename T >
std::optional<T> kcenon::container::async::detail::async_state< T >::result_

Definition at line 69 of file async_container.h.

◆ work_

template<typename T >
std::function<T()> kcenon::container::async::detail::async_state< T >::work_

Definition at line 68 of file async_container.h.


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