YOrch 1.0.0
Loading...
Searching...
No Matches
yorch::task_result< T > Struct Template Reference

Represents a step result that may carry a produced value. More...

#include <result.hpp>

Collaboration diagram for yorch::task_result< T >:

Public Types

using value_type = T
 Value type carried by this result wrapper.
 

Public Member Functions

 task_result ()=delete
 
 task_result (const task_result &)=default
 
 task_result (task_result &&)=default
 
task_resultoperator= (const task_result &)=default
 
task_resultoperator= (task_result &&)=default
 
 ~task_result ()=default
 
constexpr bool has_value () const noexcept
 
constexpr T & value () &noexcept
 
constexpr const T & value () const &noexcept
 
constexpr T && value () &&noexcept
 

Static Public Member Functions

template<typename U >
static constexpr task_result success (U &&value) noexcept(std::is_nothrow_constructible_v< T, U && >)
 
static constexpr task_result failure () noexcept
 
static constexpr task_result retry () noexcept
 
static constexpr task_result abort_branch () noexcept
 
static constexpr task_result abort_execution () noexcept
 
static constexpr task_result from_step (step_result s) noexcept
 

Public Attributes

step_result step {}
 Execution status of the current step.
 

Detailed Description

template<typename T>
struct yorch::task_result< T >

Represents a step result that may carry a produced value.

task_result<T> models a value produced by a task and intended to flow through the execution pipeline. T must be a non-reference type so the result keeps clear value semantics instead of exposing an alias to external storage.

In the current contract, only success results may carry a payload. All non-success states are value-less and therefore do not require constructing a placeholder T.

Template Parameters
TValue type produced by the task. Must not be void or a reference type.

Definition at line 96 of file result.hpp.

Member Typedef Documentation

◆ value_type

template<typename T >
using yorch::task_result< T >::value_type = T

Value type carried by this result wrapper.

Definition at line 104 of file result.hpp.

Constructor & Destructor Documentation

◆ task_result() [1/3]

template<typename T >
yorch::task_result< T >::task_result ( )
delete

◆ task_result() [2/3]

template<typename T >
yorch::task_result< T >::task_result ( const task_result< T > &  )
default

◆ task_result() [3/3]

template<typename T >
yorch::task_result< T >::task_result ( task_result< T > &&  )
default

◆ ~task_result()

template<typename T >
yorch::task_result< T >::~task_result ( )
default

Member Function Documentation

◆ abort_branch()

template<typename T >
static constexpr task_result yorch::task_result< T >::abort_branch ( )
inlinestaticconstexprnoexcept

Definition at line 130 of file result.hpp.

◆ abort_execution()

template<typename T >
static constexpr task_result yorch::task_result< T >::abort_execution ( )
inlinestaticconstexprnoexcept

Definition at line 134 of file result.hpp.

◆ failure()

template<typename T >
static constexpr task_result yorch::task_result< T >::failure ( )
inlinestaticconstexprnoexcept

Definition at line 122 of file result.hpp.

◆ from_step()

template<typename T >
static constexpr task_result yorch::task_result< T >::from_step ( step_result  s)
inlinestaticconstexprnoexcept

Definition at line 138 of file result.hpp.

◆ has_value()

template<typename T >
constexpr bool yorch::task_result< T >::has_value ( ) const
inlineconstexprnoexcept

Definition at line 144 of file result.hpp.

◆ operator=() [1/2]

template<typename T >
task_result & yorch::task_result< T >::operator= ( const task_result< T > &  )
default

◆ operator=() [2/2]

template<typename T >
task_result & yorch::task_result< T >::operator= ( task_result< T > &&  )
default

◆ retry()

template<typename T >
static constexpr task_result yorch::task_result< T >::retry ( )
inlinestaticconstexprnoexcept

Definition at line 126 of file result.hpp.

◆ success()

template<typename T >
template<typename U >
static constexpr task_result yorch::task_result< T >::success ( U &&  value)
inlinestaticconstexprnoexcept

Definition at line 117 of file result.hpp.

◆ value() [1/3]

template<typename T >
constexpr T && yorch::task_result< T >::value ( ) &&
inlineconstexprnoexcept

Definition at line 156 of file result.hpp.

◆ value() [2/3]

template<typename T >
constexpr T & yorch::task_result< T >::value ( ) &
inlineconstexprnoexcept

Definition at line 148 of file result.hpp.

◆ value() [3/3]

template<typename T >
constexpr const T & yorch::task_result< T >::value ( ) const &
inlineconstexprnoexcept

Definition at line 152 of file result.hpp.

Member Data Documentation

◆ step

template<typename T >
step_result yorch::task_result< T >::step {}

Execution status of the current step.

Definition at line 114 of file result.hpp.


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