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

#include <forwards.h>

Classes

union  data
 
struct  vtable
 

Public Types

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

Public Member Functions

 any_many_sender ()=default
 
 any_many_sender (any_many_sender &&that) noexcept
 
requires SenderTo< wrapped_t< Wrapped >, any_receiver< E, VN... >, is_many<> > any_many_sender (Wrapped obj) noexcept(insitu< Wrapped >())
 
 ~any_many_sender ()
 
any_many_senderoperator= (any_many_sender &&that) noexcept
 
any_executor< Eexecutor ()
 
void submit (any_receiver< 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_many_sender >::value, U >
 

Private Member Functions

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

Static Private Attributes

static constexpr vtable const noop_ {}
 

Detailed Description

template<class E, class... VN>
class folly::pushmi::any_many_sender< E, VN >

Definition at line 114 of file forwards.h.

Member Typedef Documentation

template<class E, class... VN>
using folly::pushmi::any_many_sender< E, VN >::properties = property_set<is_sender<>, is_many<>>

Definition at line 96 of file many_sender.h.

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

Definition at line 93 of file many_sender.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file many_sender.h.

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

49  : any_many_sender() {
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(data& src, any_receiver<E, VN...> out) {
62  *static_cast<Wrapped*>(src.pobj_), std::move(out));
63  }
64  };
65  static const vtable vtbl{s::op, s::executor, s::submit};
66  data_.pobj_ = new Wrapped(std::move(obj));
67  vptr_ = &vtbl;
68  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void submit(any_receiver< E, VN... > out)
Definition: many_sender.h:122
any_executor< E > executor()
Definition: many_sender.h:119
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_many_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 E, class... VN>
template<class Wrapped >
folly::pushmi::any_many_sender< E, VN >::any_many_sender ( Wrapped  obj,
std::true_type   
)
inlineprivatenoexcept

Definition at line 70 of file many_sender.h.

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

70  : any_many_sender() {
71  struct s {
72  static void op(data& src, data* dst) {
73  if (dst)
74  new (dst->buffer_)
75  Wrapped(std::move(*static_cast<Wrapped*>((void*)src.buffer_)));
76  static_cast<Wrapped const*>((void*)src.buffer_)->~Wrapped();
77  }
78  static any_executor<E> executor(data& src) {
79  return any_executor<E>{::folly::pushmi::executor(
80  *static_cast<Wrapped*>((void*)src.buffer_))};
81  }
82  static void submit(data& src, any_receiver<E, VN...> out) {
84  *static_cast<Wrapped*>((void*)src.buffer_), std::move(out));
85  }
86  };
87  static const vtable vtbl{s::op, s::executor, s::submit};
88  new (data_.buffer_) Wrapped(std::move(obj));
89  vptr_ = &vtbl;
90  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void submit(any_receiver< E, VN... > out)
Definition: many_sender.h:122
any_executor< E > executor()
Definition: many_sender.h:119
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_many_sender::data data_
static set< string > s
const
Definition: upload.py:398
char buffer_[sizeof(std::tuple< VN... >)]
Definition: many_sender.h:29
template<class E, class... VN>
folly::pushmi::any_many_sender< E, VN >::any_many_sender ( )
default
template<class E, class... VN>
folly::pushmi::any_many_sender< E, VN >::any_many_sender ( any_many_sender< E, VN > &&  that)
inlinenoexcept

Definition at line 99 of file many_sender.h.

References folly::pushmi::any_many_sender< E, VN >::data_, folly::pushmi::any_many_sender< E, VN >::vtable::op_, folly::pushmi::PUSHMI_TEMPLATE(), folly::pushmi::requires(), folly::f14::swap(), and folly::pushmi::any_many_sender< E, VN >::vptr_.

99  : any_many_sender() {
100  that.vptr_->op_(that.data_, &data_);
101  std::swap(that.vptr_, vptr_);
102  }
union folly::pushmi::any_many_sender::data data_
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<class E, class... VN>
requires SenderTo< wrapped_t<Wrapped>, any_receiver<E, VN...>, is_many<> > folly::pushmi::any_many_sender< E, VN >::any_many_sender ( Wrapped  obj)
inlineexplicitnoexcept

Definition at line 109 of file many_sender.h.

References folly::gen::move.

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

Definition at line 111 of file many_sender.h.

References folly::pushmi::any_many_sender< E, VN >::data_, and folly::pushmi::any_many_sender< E, VN >::vtable::op_.

Referenced by folly::pushmi::any_many_sender< E, VN >::operator=().

111  {
112  vptr_->op_(data_, nullptr);
113  }
union folly::pushmi::any_many_sender::data data_

Member Function Documentation

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

Definition at line 32 of file many_sender.h.

References folly::pushmi::any_many_sender< 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... >)]
Definition: many_sender.h:29
template<class E, class... VN>
any_many_sender& folly::pushmi::any_many_sender< E, VN >::operator= ( any_many_sender< E, VN > &&  that)
inlinenoexcept

Definition at line 114 of file many_sender.h.

References folly::pushmi::any_many_sender< E, VN >::any_many_sender(), folly::gen::move, and folly::pushmi::any_many_sender< E, VN >::~any_many_sender().

114  {
115  this->~any_many_sender();
116  new ((void*)this) any_many_sender(std::move(that));
117  return *this;
118  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class E, class... VN>
void folly::pushmi::any_many_sender< E, VN >::submit ( any_receiver< E, VN... >  out)
inline

Member Data Documentation

template<class E, class... VN>
constexpr any_many_sender< E, VN... >::vtable const folly::pushmi::any_many_sender< E, VN >::noop_ {}
staticprivate

Definition at line 46 of file many_sender.h.

Referenced by folly::pushmi::any_many_sender< E, VN >::submit().

template<class E, class... VN>
vtable const* folly::pushmi::any_many_sender< E, VN >::vptr_ = &noop_
private

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