YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::PromiseType< V, E, Lazy > Class Template Reference

#include <promise_type.hpp>

Inheritance diagram for yaclib::detail::PromiseType< V, E, Lazy >:
[legend]
Collaboration diagram for yaclib::detail::PromiseType< V, E, Lazy >:
[legend]

Public Member Functions

 PromiseType () noexcept
 
auto get_return_object () noexcept
 
auto initial_suspend () noexcept
 
Destroy final_suspend () noexcept
 
void unhandled_exception () noexcept
 
template<typename Value >
void return_value (Value &&value) noexcept(std::is_nothrow_constructible_v< Result< V, E >, Value && >)
 
void return_value (Unit) noexcept
 
auto Handle () noexcept
 
- Public Member Functions inherited from yaclib::detail::OneCounter< ResultCore< V, E >, PromiseTypeDeleter< Lazy > >
 OneCounter (std::size_t, Args &&... args) noexcept(std::is_nothrow_constructible_v< ResultCore< V, E >, Args &&... >)
 
constexpr bool SubEqual (std::size_t) const
 
void Add (std::size_t) noexcept
 
void Sub (std::size_t) noexcept
 
- Public Member Functions inherited from yaclib::detail::ResultCore< V, E >
InlineCoreHere (InlineCore &caller) noexcept override
 
 ResultCore () noexcept
 
template<typename... Args>
 ResultCore (Args &&... args) noexcept(std::is_nothrow_constructible_v< Result< V, E >, Args &&... >)
 
 ~ResultCore () noexcept override
 
template<typename... Args>
void Store (Args &&... args) noexcept(std::is_nothrow_constructible_v< Result< V, E >, Args &&... >)
 
Result< V, E > & Get () noexcept
 
- Public Member Functions inherited from yaclib::detail::BaseCore
void StoreCallback (InlineCore &callback) noexcept
 
bool Empty () const noexcept
 
bool SetCallback (InlineCore &callback) noexcept
 
bool Reset () noexcept
 
void CallInline (InlineCore &callback) noexcept
 
template<bool SymmetricTransfer>
Transfer< SymmetricTransferSetInline (InlineCore &callback) noexcept
 
template<bool SymmetricTransfer>
Transfer< SymmetricTransferSetResult () noexcept
 
void MoveExecutorTo (BaseCore &callback) noexcept
 
- Public Member Functions inherited from yaclib::IRef
virtual void IncRef () noexcept
 Increments reference counter.
 
virtual ~IRef () noexcept=default
 

Additional Inherited Members

- Public Types inherited from yaclib::detail::BaseCore
enum  State : std::uintptr_t { kEmpty = std::uintptr_t{0} , kResult = std::numeric_limits<std::uintptr_t>::max() }
 
template<bool SymmetricTransfer>
using Transfer = InlineCore *
 
- Public Attributes inherited from yaclib::detail::ResultCore< V, E >
union { 
 
   Result< V, E >   _result 
 
   Callback   _self 
 
};  
 
- Public Attributes inherited from yaclib::detail::BaseCore
IExecutorPtr _executor {NoRefTag{}, &MakeInline()}
 
- Public Attributes inherited from yaclib::detail::Node
Nodenext = nullptr
 
- Protected Member Functions inherited from yaclib::detail::BaseCore
 BaseCore (State callback) noexcept
 
- Protected Attributes inherited from yaclib::detail::BaseCore
yaclib_std::atomic_uintptr_t _callback
 

Detailed Description

template<typename V, typename E, bool Lazy>
class yaclib::detail::PromiseType< V, E, Lazy >

Definition at line 44 of file promise_type.hpp.

Constructor & Destructor Documentation

◆ PromiseType()

template<typename V , typename E , bool Lazy>
yaclib::detail::PromiseType< V, E, Lazy >::PromiseType ( )
inlinenoexcept

Definition at line 48 of file promise_type.hpp.

Member Function Documentation

◆ final_suspend()

template<typename V , typename E , bool Lazy>
Destroy yaclib::detail::PromiseType< V, E, Lazy >::final_suspend ( )
inlinenoexcept

Definition at line 67 of file promise_type.hpp.

◆ get_return_object()

template<typename V , typename E , bool Lazy>
auto yaclib::detail::PromiseType< V, E, Lazy >::get_return_object ( )
inlinenoexcept

Definition at line 51 of file promise_type.hpp.

References yaclib::MakeContract().

◆ Handle()

template<typename V , typename E , bool Lazy>
auto yaclib::detail::PromiseType< V, E, Lazy >::Handle ( )
inlinenoexcept

Definition at line 84 of file promise_type.hpp.

References yaclib::MakeContract(), and YACLIB_ASSERT.

◆ initial_suspend()

template<typename V , typename E , bool Lazy>
auto yaclib::detail::PromiseType< V, E, Lazy >::initial_suspend ( )
inlinenoexcept

Definition at line 59 of file promise_type.hpp.

References yaclib::MakeContract().

◆ return_value() [1/2]

template<typename V , typename E , bool Lazy>
void yaclib::detail::PromiseType< V, E, Lazy >::return_value ( Unit  )
inlinenoexcept

Definition at line 80 of file promise_type.hpp.

References yaclib::detail::ResultCore< V, E >::Store().

◆ return_value() [2/2]

template<typename V , typename E , bool Lazy>
template<typename Value >
void yaclib::detail::PromiseType< V, E, Lazy >::return_value ( Value &&  value)
inlinenoexcept

◆ unhandled_exception()

template<typename V , typename E , bool Lazy>
void yaclib::detail::PromiseType< V, E, Lazy >::unhandled_exception ( )
inlinenoexcept

Definition at line 71 of file promise_type.hpp.

References yaclib::detail::ResultCore< V, E >::Store().


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