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

#include <flow_many_sender.h>

Classes

union  data
 
struct  vtable
 

Public Types

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

Public Member Functions

 any_flow_many_sender ()=default
 
 any_flow_many_sender (any_flow_many_sender &&that) noexcept
 
requires FlowSender< wrapped_t< Wrapped >, is_many<> > any_flow_many_sender (Wrapped obj) noexcept(insitu< Wrapped >())
 
 ~any_flow_many_sender ()
 
any_flow_many_senderoperator= (any_flow_many_sender &&that) noexcept
 
any_executor< Eexecutor ()
 
void submit (any_flow_receiver< PE, PV, 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_many_sender >::value, U >
 

Private Member Functions

template<class Wrapped >
 any_flow_many_sender (Wrapped obj, std::false_type)
 
template<class Wrapped >
 any_flow_many_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_many_sender::data data_
 
vtable const * vptr_ = &noop_
 

Static Private Attributes

static constexpr vtable const noop_ {}
 

Detailed Description

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

Definition at line 26 of file flow_many_sender.h.

Member Typedef Documentation

template<class PE , class PV , class E , class... VN>
using folly::pushmi::any_flow_many_sender< PE, PV, E, VN >::properties = property_set<is_sender<>, is_flow<>, is_many<>>

Definition at line 94 of file flow_many_sender.h.

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

Definition at line 92 of file flow_many_sender.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file flow_many_sender.h.

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

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

Definition at line 68 of file flow_many_sender.h.

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

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

Definition at line 104 of file flow_many_sender.h.

References folly::gen::move.

105  : any_flow_many_sender{std::move(obj), bool_<insitu<Wrapped>()>{}} {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class PE , class PV , class E , class... VN>
folly::pushmi::any_flow_many_sender< PE, PV, E, VN >::~any_flow_many_sender ( )
inline

Member Function Documentation

template<class PE , class PV , class E , class... VN>
any_executor<E> folly::pushmi::any_flow_many_sender< PE, PV, E, VN >::executor ( )
inline
template<class PE , class PV , class E , class... VN>
template<class Wrapped >
static constexpr bool folly::pushmi::any_flow_many_sender< PE, PV, E, VN >::insitu ( )
inlinestaticprivate

Definition at line 32 of file flow_many_sender.h.

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

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

Member Data Documentation

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

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