23 template <
class PE,
class PV,
class E,
class... VN>
31 template <
class Wrapped>
50 template <
class Wrapped>
75 template <
class Wrapped>
82 static_cast<Wrapped
const*
>((
void*)src.
buffer_)->~Wrapped();
101 template <
class T,
class U = std::decay_t<T>>
114 ReceiveValue<wrapped_t<Wrapped>, VN...> &&
115 ReceiveError<wrapped_t<Wrapped>, E>)
127 if (!started_) {std::abort();}
128 if (done_){
return; }
132 if (!started_) {std::abort();}
133 if (done_){
return; }
138 if (!started_) {std::abort();}
139 if (done_){
return; }
145 if (started_) {std::abort();}
152 template <
class PE,
class PV,
class E,
class... VN>
156 template <
class VF,
class EF,
class DF,
class StrtF>
162 bool started_ =
false;
172 !detail::is_v<VF, on_error_fn>,
173 "the first parameter is the value implementation, but on_error{} was passed");
175 !detail::is_v<EF, on_value_fn>,
176 "the second parameter is the error implementation, but on_value{} was passed");
180 : flow_receiver(
std::
move(nf), EF{}, DF{}) {}
182 : flow_receiver(VF{},
std::move(ef), DF{}) {}
184 : flow_receiver(VF{}, EF{},
std::move(df)) {}
191 StrtF strtf = StrtF{})
199 if (!started_) {std::abort();}
200 if (done_){
return; }
206 static_assert(NothrowInvocable<EF&, E>,
"error function must be noexcept");
207 if (!started_) {std::abort();}
208 if (done_){
return; }
213 if (!started_) {std::abort();}
214 if (done_){
return; }
221 if (started_) {std::abort();}
238 bool started_ =
false;
249 !detail::is_v<DVF, on_error_fn>,
250 "the first parameter is the value implementation, but on_error{} was passed");
252 !detail::is_v<DEF, on_value_fn>,
253 "the second parameter is the error implementation, but on_value{} was passed");
256 : flow_receiver(
std::
move(d), DVF{}, DEF{}, DDF{}) {}
258 : data_(
std::
move(d)), nf_(), ef_(), df_(df) {}
266 DStrtF strtf = DStrtF{})
277 (
requires Invocable<DVF&, Data&, V>)
279 if (!started_) {std::abort();}
280 if (done_){
return; }
284 (
requires Invocable<DEF&, Data&, E>)
287 NothrowInvocable<DEF&, Data&, E>,
"error function must be noexcept");
288 if (!started_) {std::abort();}
289 if (done_){
return; }
294 if (!started_) {std::abort();}
295 if (done_){
return; }
300 (
requires Invocable<DStrtF&, Data&, Up&&>)
302 if (started_) {std::abort();}
304 strtf_(data_, (Up &&) up);
310 :
public flow_receiver<ignoreVF, abortEF, ignoreDF, ignoreStrtF> {
316 Receiver<
T, is_flow<>> &&
333 not lazy::FlowReceiverDataArg<VF>)))
334 auto operator()(VF nf)
const {
338 template <
class... EFN>
343 template <
class... DFN>
353 not lazy::Invocable<EF&>)))
354 auto operator()(VF nf, EF ef)
const {
363 not lazy::FlowReceiverDataArg<EF>)))
364 auto operator()(EF ef, DF df)
const {
371 not lazy::FlowReceiverDataArg<VF>)))
372 auto operator()(VF nf, EF
ef, DF df)
const {
380 not lazy::FlowReceiverDataArg<VF>)))
381 auto operator()(VF nf, EF ef, DF
df, StrtF strtf)
const {
388 lazy::FlowReceiverDataArg<Data>))
389 auto operator()(
Data d)
const {
396 lazy::FlowReceiverDataArg<Data>))
397 auto operator()(
Data d, DVF nf)
const {
403 lazy::FlowReceiverDataArg<Data>))
410 lazy::FlowReceiverDataArg<Data>))
417 lazy::FlowReceiverDataArg<Data>
419 not lazy::Invocable<DEF&, Data&>)))
420 auto operator()(
Data d, DVF
nf, DEF ef)
const {
426 lazy::Invocable<DDF&, Data&>))
427 auto operator()(
Data d, DEF
ef, DDF df)
const {
434 lazy::Invocable<DDF&, Data&>))
435 auto operator()(
Data d, DVF nf, DEF
ef, DDF df)
const {
442 lazy::Invocable<DDF&, Data&>))
443 auto operator()(
Data d, DVF nf, DEF ef, DDF
df, DStrtF strtf)
const {
451 #if __cpp_deduction_guides >= 201703 458 not lazy::FlowReceiverDataArg<VF>)))
462 template <
class... EFN>
466 template <
class... DFN>
475 not lazy::Invocable<EF&>)))
484 not lazy::FlowReceiverDataArg<EF>)))
492 not lazy::FlowReceiverDataArg<VF>)))
500 not lazy::FlowReceiverDataArg<VF>)))
507 lazy::FlowReceiverDataArg<Data>))
514 lazy::FlowReceiverDataArg<Data>))
520 lazy::FlowReceiverDataArg<Data>))
526 lazy::FlowReceiverDataArg<Data>))
534 lazy::Invocable<DDF&, Data&>))
540 lazy::FlowReceiverDataArg<Data>
542 not lazy::Invocable<DEF&, Data&>)))
549 lazy::Invocable<DDF&, Data&>))
556 lazy::Invocable<DDF&, Data&>))
560 PUSHMI_TEMPLATE(
class Data,
class DVF,
class DEF,
class DDF,
class DStrtF)
563 lazy::Invocable<DDF&, Data&> ))
564 flow_receiver(Data d, DVF nf, DEF ef, DDF df, DStrtF strtf) ->
any_flow_receiver & operator=(any_flow_receiver &&that) noexcept
constexpr flow_receiver(DF df)
static void s_value(data &, VN...)
static void s_starting(data &, any_receiver< PE, PV >)
void starting(any_receiver< PE, PV > up)
requires Invocable< EF &, E > void error(E e) noexcept
requires PUSHMI_EXP(lazy::True<> PUSHMI_AND lazy::FlowReceiverDataArg< Data >)) auto operator()(Data d) const
constexpr detail::Map< Move > move
requires Invocable< DVF &, Data &, V > void value(V &&v)
constexpr flow_receiver(Data d, DDF df)
constexpr flow_receiver(EF ef)
PUSHMI_INLINE_VAR constexpr __adl::set_error_fn set_error
void(* error_)(data &, E) noexcept
static constexpr vtable const noop_
—— Concurrent Priority Queue Implementation ——
auto operator()(on_done_fn< DFN... > df) const
any_flow_receiver(Wrapped obj, std::false_type)
property_set_insert_t< properties_t< Data >, property_set< is_receiver<>, is_flow<>>> properties
requires E e noexcept(noexcept(s.error(std::move(e))))
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
typename std::enable_if_t< PropertySet< PS0 > &&PropertySet< PS1 >, detail::property_set_insert< PS0, PS1 >>::type property_set_insert_t
bool_constant< true > true_type
constexpr flow_receiver(Data d, DVF nf, DEF ef=DEF{}, DDF df=DDF{}, DStrtF strtf=DStrtF{})
requires PUSHMI_EXP(lazy::True<> PUSHMI_BROKEN_SUBSUMPTION(PUSHMI_ANDnot lazy::FlowReceiverDataArg< VF >))) auto operator()(VF nf) const
char buffer_[sizeof(std::tuple< VN... >)]
static constexpr bool insitu()
requires Invocable< StrtF &, Up && > void starting(Up &&up)
any_flow_receiver(Wrapped obj, std::true_type) noexcept
constexpr flow_receiver(VF nf, EF ef, DF df=DF{}, StrtF strtf=StrtF{})
requires FlowUpTo< wrapped_t< Wrapped >, any_receiver< PE, PV > > &&ReceiveValue< wrapped_t< Wrapped >, VN... > &&ReceiveError< wrapped_t< Wrapped >, E > any_flow_receiver(Wrapped obj) noexcept(insitu< Wrapped >())
requires Invocable< DEF &, Data &, E > void error(E &&e) noexcept
PUSHMI_CONCEPT_DEF(template(class PS) concept Cardinality, has_cardinality_v< PS >)
any_flow_receiver(any_flow_receiver &&that) noexcept
void(* starting_)(data &, any_receiver< PE, PV >)
static const char *const value
requires Invocable< VF &, V > void value(V &&v)
#define PUSHMI_INLINE_VAR
union folly::pushmi::any_flow_receiver::data data_
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_flow_receiver_fn make_flow_receiver
std::integral_constant< bool, B > bool_
PUSHMI_INLINE_VAR constexpr __adl::set_starting_fn set_starting
void(* value_)(data &, VN...)
constexpr flow_receiver(EF ef, DF df)
requires requires(detail::apply_impl(std::declval< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&f
constexpr flow_receiver(Data d)
static void s_done(data &)
T exchange(T &obj, U &&new_value)
PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender< detail
auto operator()(on_error_fn< EFN... > ef) const
std::enable_if_t<!std::is_same< U, any_flow_receiver >::value, U > wrapped_t
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
static void s_op(data &, data *)
bool_constant< false > false_type
#define PUSHMI_TYPE_CONSTRAINT(...)
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
constexpr flow_receiver(Data d, DEF ef, DDF df=DDF{})
#define PUSHMI_BROKEN_SUBSUMPTION(...)
requires Invocable< DStrtF &, Data &, Up && > void starting(Up &&up)
constexpr flow_receiver(VF nf)
static void s_error(data &, E) noexcept
any_flow_receiver()=default
void(* op_)(data &, data *)
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done