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

Output sink passed to direct-output tasks. More...

#include <direct_out.hpp>

Public Member Functions

constexpr direct_out (detail::typed_slot< T, detail::slot_logical_policy::maybe_payload > &slot) noexcept
 
constexpr direct_out (detail::slot_view< T > slot) noexcept
 Binds the sink to an already-created typed slot view.
 
template<typename... Args>
constexpr T & emplace (Args &&... args) noexcept(noexcept(slot_.emplace(std::forward< Args >(args)...)))
 
template<typename... Args>
constexpr step_result success (Args &&... args) noexcept(noexcept(emplace(std::forward< Args >(args)...)))
 
constexpr void destroy () noexcept
 
constexpr bool has_value () const noexcept
 

Detailed Description

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

Output sink passed to direct-output tasks.

direct_out<T> models maybe-payload semantics: receiving the sink does not guarantee that the task will call emplace(...) before returning. The sink always materializes an owned payload in the destination slot; it does not model alias/reference output semantics. This is why it only accepts maybe-capable storage and stores a slot_view<T> instead of a plain slot reference; the same public sink can target a typed one-to-one slot or an erased compact-layout slot.

If a task needs to mutate a direct-parent payload and then forward that same object into its own output slot, prefer consume_prev<T>() plus out.success(std::move(value)) so the ownership transfer stays explicit.

Definition at line 28 of file direct_out.hpp.

Constructor & Destructor Documentation

◆ direct_out() [1/2]

template<typename T >
constexpr yorch::direct_out< T >::direct_out ( detail::typed_slot< T, detail::slot_logical_policy::maybe_payload > &  slot)
inlineexplicitconstexprnoexcept

Definition at line 34 of file direct_out.hpp.

◆ direct_out() [2/2]

template<typename T >
constexpr yorch::direct_out< T >::direct_out ( detail::slot_view< T >  slot)
inlineexplicitconstexprnoexcept

Binds the sink to an already-created typed slot view.

Definition at line 41 of file direct_out.hpp.

Member Function Documentation

◆ destroy()

template<typename T >
constexpr void yorch::direct_out< T >::destroy ( )
inlineconstexprnoexcept

Definition at line 57 of file direct_out.hpp.

◆ emplace()

template<typename T >
template<typename... Args>
constexpr T & yorch::direct_out< T >::emplace ( Args &&...  args)
inlineconstexprnoexcept

Definition at line 45 of file direct_out.hpp.

◆ has_value()

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

Definition at line 61 of file direct_out.hpp.

◆ success()

template<typename T >
template<typename... Args>
constexpr step_result yorch::direct_out< T >::success ( Args &&...  args)
inlineconstexprnoexcept

Definition at line 51 of file direct_out.hpp.


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