proxygen
folly::pushmi::any_flow_single_sender< PE, E, VN > Class Template Reference

#include <flow_single_sender.h>

Classes

union  data
 
struct  vtable
 

Public Types

using properties = property_set< is_sender<>, is_flow<>, is_single<>>
 

Public Member Functions

 any_flow_single_sender ()=default
 
 any_flow_single_sender (any_flow_single_sender &&that) noexcept
 
requires FlowSender< wrapped_t< Wrapped >, is_single<> > any_flow_single_sender (Wrapped obj) noexcept(insitu< Wrapped >())
 
 ~any_flow_single_sender ()
 
any_flow_single_senderoperator= (any_flow_single_sender &&that) noexcept
 
any_executor< Eexecutor ()
 
void submit (any_flow_receiver< PE, std::ptrdiff_t, E, VN... > out)
 

Private Types

template<class T , class U = std::decay_t<T>>
using wrapped_t = std::enable_if_t<!std::is_same< U, any_flow_single_sender >::value, U >
 

Private Member Functions

template<class Wrapped >
 any_flow_single_sender (Wrapped obj, std::false_type)
 
template<class Wrapped >
 any_flow_single_sender (Wrapped obj, std::true_type) noexcept
 

Static Private Member Functions

template<class Wrapped >
static constexpr bool insitu ()
 

Private Attributes

union folly::pushmi::any_flow_single_sender::data data_
 
vtable const * vptr_ = &noop_
 

Static Private Attributes

static constexpr vtable const noop_ {}
 

Detailed Description

template<class PE, class E, class... VN>
class folly::pushmi::any_flow_single_sender< PE, E, VN >

Definition at line 26 of file flow_single_sender.h.

Member Typedef Documentation

template<class PE, class E, class... VN>
using folly::pushmi::any_flow_single_sender< PE, E, VN >::properties = property_set<is_sender<>, is_flow<>, is_single<>>

Definition at line 100 of file flow_single_sender.h.

template<class PE, class E, class... VN>
template<class T , class U = std::decay_t<T>>
using folly::pushmi::any_flow_single_sender< PE, E, VN >::wrapped_t = std::enable_if_t<!std::is_same<U, any_flow_single_sender>::value, U>
private

Definition at line 98 of file flow_single_sender.h.

Constructor & Destructor Documentation

template<class PE, class E, class... VN>
template<class Wrapped >
folly::pushmi::any_flow_single_sender< PE, E, VN >::any_flow_single_sender ( Wrapped  obj,
std::false_type   
)
inlineprivate

Definition at line 48 of file flow_single_sender.h.

References upload::const, folly::pushmi::any_flow_single_sender< PE, E, VN >::data_, folly::exchange(), folly::pushmi::any_flow_single_sender< PE, E, VN >::executor(), folly::pushmi::executor, folly::gen::move, folly::pushmi::any_flow_single_sender< PE, E, VN >::data::pobj_, s, folly::pushmi::any_flow_single_sender< PE, E, VN >::submit(), and submit.

50  struct s {
51  static void op(data& src, data* dst) {
52  if (dst)
53  dst->pobj_ = std::exchange(src.pobj_, nullptr);
54  delete static_cast<Wrapped const*>(src.pobj_);
55  }
56  static any_executor<E> executor(data& src) {
57  return any_executor<E>{
58  ::folly::pushmi::executor(*static_cast<Wrapped*>(src.pobj_))};
59  }
60  static void submit(
61  data& src,
62  any_flow_receiver<PE, std::ptrdiff_t, E, VN...> out) {
64  *static_cast<Wrapped*>(src.pobj_), std::move(out));
65  }
66  };
67  static const vtable vtbl{s::op, s::executor, s::submit};
68  data_.pobj_ = new Wrapped(std::move(obj));
69  vptr_ = &vtbl;
70  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
void submit(any_flow_receiver< PE, std::ptrdiff_t, E, VN... > out)
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
union folly::pushmi::any_flow_single_sender::data data_
T exchange(T &obj, U &&new_value)
Definition: Utility.h:120
static set< string > s
const
Definition: upload.py:398
template<class PE, class E, class... VN>
template<class Wrapped >
folly::pushmi::any_flow_single_sender< PE, E, VN >::any_flow_single_sender ( Wrapped  obj,
std::true_type   
)
inlineprivatenoexcept

Definition at line 72 of file flow_single_sender.h.

References folly::pushmi::any_flow_single_sender< PE, E, VN >::data::buffer_, upload::const, folly::pushmi::any_flow_single_sender< PE, E, VN >::data_, folly::pushmi::any_flow_single_sender< PE, E, VN >::executor(), folly::pushmi::executor, folly::gen::move, s, folly::pushmi::any_flow_single_sender< PE, E, VN >::submit(), and submit.

74  struct s {
75  static void op(data& src, data* dst) {
76  if (dst)
77  new (dst->buffer_)
78  Wrapped(std::move(*static_cast<Wrapped*>((void*)src.buffer_)));
79  static_cast<Wrapped const*>((void*)src.buffer_)->~Wrapped();
80  }
81  static any_executor<E> executor(data& src) {
82  return any_executor<E>{::folly::pushmi::executor(
83  *static_cast<Wrapped*>((void*)src.buffer_))};
84  }
85  static void submit(
86  data& src,
87  any_flow_receiver<PE, std::ptrdiff_t, E, VN...> out) {
89  *static_cast<Wrapped*>((void*)src.buffer_), std::move(out));
90  }
91  };
92  static const vtable vtbl{s::op, s::executor, s::submit};
93  new (data_.buffer_) Wrapped(std::move(obj));
94  vptr_ = &vtbl;
95  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
void submit(any_flow_receiver< PE, std::ptrdiff_t, E, VN... > out)
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
char buffer_[sizeof(std::tuple< VN... >)]
union folly::pushmi::any_flow_single_sender::data data_
static set< string > s
const
Definition: upload.py:398
template<class PE, class E, class... VN>
folly::pushmi::any_flow_single_sender< PE, E, VN >::any_flow_single_sender ( any_flow_single_sender< PE, E, VN > &&  that)
inlinenoexcept
template<class PE, class E, class... VN>
requires FlowSender<wrapped_t<Wrapped>, is_single<> > folly::pushmi::any_flow_single_sender< PE, E, VN >::any_flow_single_sender ( Wrapped  obj)
inlineexplicitnoexcept

Definition at line 110 of file flow_single_sender.h.

References folly::gen::move.

111  : any_flow_single_sender{std::move(obj), bool_<insitu<Wrapped>()>{}} {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

template<class PE, class E, class... VN>
template<class Wrapped >
static constexpr bool folly::pushmi::any_flow_single_sender< PE, E, VN >::insitu ( )
inlinestaticprivate

Definition at line 32 of file flow_single_sender.h.

References folly::pushmi::any_flow_single_sender< PE, E, VN >::data::buffer_, and value.

32  {
33  return sizeof(Wrapped) <= sizeof(data::buffer_) &&
35  }
static const char *const value
Definition: Conv.cpp:50
char buffer_[sizeof(std::tuple< VN... >)]
template<class PE, class E, class... VN>
any_flow_single_sender& folly::pushmi::any_flow_single_sender< PE, E, VN >::operator= ( any_flow_single_sender< PE, E, VN > &&  that)
inlinenoexcept
template<class PE, class E, class... VN>
void folly::pushmi::any_flow_single_sender< PE, E, VN >::submit ( any_flow_receiver< PE, std::ptrdiff_t, E, VN... >  out)
inline

Member Data Documentation

template<class PE, class E, class... VN>
constexpr any_flow_single_sender< PE, E, VN... >::vtable const folly::pushmi::any_flow_single_sender< PE, E, VN >::noop_ {}
staticprivate
template<class PE, class E, class... VN>
vtable const* folly::pushmi::any_flow_single_sender< PE, E, VN >::vptr_ = &noop_
private

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