StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Detail::FunctionState< Args > Struct Template Reference

Function and its arguments, allocated on Base's heap. More...

#include <StormByte/safe/thread.hxx>

Collaboration diagram for StormByte::Safe::Detail::FunctionState< Args >:

Public Member Functions

STORMBYTE_FORCE_INLINE FunctionState (Function< void(Args...)> &&fn, Args &&... args)
 Capture the callback and its arguments.

Static Public Member Functions

static STORMBYTE_FORCE_INLINE void Run (void *raw)
 Invoke Call and destroy the state.

Public Attributes

Function< void(Args...)> function
 Creator-owned callback.
std::tuple< Args... > arguments
 Arguments captured before the execution starts.

Detailed Description

template<class... Args>
struct StormByte::Safe::Detail::FunctionState< Args >

Function and its arguments, allocated on Base's heap.

Template Parameters
ArgsArgument types of the void function.

Call runs in the new execution. Its Status stays there. A Base exception does not escape: an uncaught exception would terminate the process.

Constructor & Destructor Documentation

◆ FunctionState()

template<class... Args>
STORMBYTE_FORCE_INLINE StormByte::Safe::Detail::FunctionState< Args >::FunctionState ( Function< void(Args...)> && fn,
Args &&... args )
inline

Capture the callback and its arguments.

Parameters
fnCallback. Moved.
argsArguments.

Member Function Documentation

◆ Run()

template<class... Args>
STORMBYTE_FORCE_INLINE void StormByte::Safe::Detail::FunctionState< Args >::Run ( void * raw)
inlinestatic

Invoke Call and destroy the state.

Parameters
rawState address. Not null.

Member Data Documentation

◆ arguments

template<class... Args>
std::tuple<Args...> StormByte::Safe::Detail::FunctionState< Args >::arguments

Arguments captured before the execution starts.

◆ function

template<class... Args>
Function<void(Args...)> StormByte::Safe::Detail::FunctionState< Args >::function

Creator-owned callback.


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