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

#include <constrained_single_sender.h>

Inheritance diagram for folly::pushmi::any_constrained_single_sender< E, CV, VN >:
folly::pushmi::any_constrained_executor< E, CV >

Classes

union  data
 
struct  vtable
 

Public Types

using properties = property_set< is_constrained<>, is_single<>>
 

Public Member Functions

 any_constrained_single_sender ()=default
 
 any_constrained_single_sender (any_constrained_single_sender &&that) noexcept
 
requires ConstrainedSenderTo< wrapped_t< Wrapped >, any_receiver< E, VN... > > any_constrained_single_sender (Wrapped obj) noexcept(insitu< Wrapped >())
 
 ~any_constrained_single_sender ()
 
any_constrained_single_senderoperator= (any_constrained_single_sender &&that) noexcept
 
CV top ()
 
any_constrained_executor< E, CVexecutor ()
 
void submit (CV at, 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_constrained_single_sender >::value, U >
 

Private Member Functions

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

Static Private Attributes

static constexpr vtable const noop_ {}
 

Detailed Description

template<class E, class CV, class... VN>
class folly::pushmi::any_constrained_single_sender< E, CV, VN >

Definition at line 26 of file constrained_single_sender.h.

Member Typedef Documentation

template<class E, class CV, class... VN>
using folly::pushmi::any_constrained_single_sender< E, CV, VN >::properties = property_set<is_constrained<>, is_single<>>

Definition at line 106 of file constrained_single_sender.h.

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

Definition at line 103 of file constrained_single_sender.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file constrained_single_sender.h.

51  struct s {
52  static void op(data& src, data* dst) {
53  if (dst)
54  dst->pobj_ = std::exchange(src.pobj_, nullptr);
55  delete static_cast<Wrapped const*>(src.pobj_);
56  }
57  static CV top(data& src) {
58  return ::folly::pushmi::top(*static_cast<Wrapped*>(src.pobj_));
59  }
60  static any_constrained_executor<E, CV> executor(data& src) {
61  return any_constrained_executor<E, CV>{
62  executor(*static_cast<Wrapped*>(src.pobj_))};
63  }
64  static void submit(data& src, CV at, any_receiver<E, VN...> out) {
66  *static_cast<Wrapped*>(src.pobj_), std::move(at), std::move(out));
67  }
68  };
69  static const vtable vtbl{s::op, s::top, s::executor, s::submit};
70  data_.pobj_ = new Wrapped(std::move(obj));
71  vptr_ = &vtbl;
72  }
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_constrained_single_sender::data data_
void submit(CV at, any_receiver< E, VN... > out)
T exchange(T &obj, U &&new_value)
Definition: Utility.h:120
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn top
static set< string > s
const
Definition: upload.py:398
template<class E, class CV, class... VN>
template<class Wrapped >
folly::pushmi::any_constrained_single_sender< E, CV, VN >::any_constrained_single_sender ( Wrapped  obj,
std::true_type   
)
inlineprivatenoexcept

Definition at line 74 of file constrained_single_sender.h.

76  struct s {
77  static void op(data& src, data* dst) {
78  if (dst)
79  new (dst->buffer_) Wrapped(
80  std::move(*static_cast<Wrapped*>((void*)src.buffer_)));
81  static_cast<Wrapped const*>((void*)src.buffer_)->~Wrapped();
82  }
83  static CV top(data& src) {
84  return ::folly::pushmi::top(*static_cast<Wrapped*>((void*)src.buffer_));
85  }
86  static any_constrained_executor<E, CV> executor(data& src) {
87  return any_constrained_executor<E, CV>{::folly::pushmi::executor(
88  *static_cast<Wrapped*>((void*)src.buffer_))};
89  }
90  static void submit(data& src, CV cv, any_receiver<E, VN...> out) {
92  *static_cast<Wrapped*>((void*)src.buffer_),
93  std::move(cv),
94  std::move(out));
95  }
96  };
97  static const vtable vtbl{s::op, s::top, s::executor, s::submit};
98  new (data_.buffer_) Wrapped(std::move(obj));
99  vptr_ = &vtbl;
100  }
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_constrained_single_sender::data data_
void submit(CV at, any_receiver< E, VN... > out)
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn top
static set< string > s
const
Definition: upload.py:398
template<class E, class CV, class... VN>
folly::pushmi::any_constrained_single_sender< E, CV, VN >::any_constrained_single_sender ( any_constrained_single_sender< E, CV, VN > &&  that)
inlinenoexcept

Definition at line 109 of file constrained_single_sender.h.

111  that.vptr_->op_(that.data_, &data_);
112  std::swap(that.vptr_, vptr_);
113  }
union folly::pushmi::any_constrained_single_sender::data data_
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<class E, class CV, class... VN>
requires ConstrainedSenderTo<wrapped_t<Wrapped>, any_receiver<E, VN...> > folly::pushmi::any_constrained_single_sender< E, CV, VN >::any_constrained_single_sender ( Wrapped  obj)
inlineexplicitnoexcept

Definition at line 116 of file constrained_single_sender.h.

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

Member Function Documentation

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

Definition at line 32 of file constrained_single_sender.h.

32  {
33  return sizeof(Wrapped) <= sizeof(data::buffer_) &&
35  }
static const char *const value
Definition: Conv.cpp:50
template<class E, class CV, class... VN>
any_constrained_single_sender& folly::pushmi::any_constrained_single_sender< E, CV, VN >::operator= ( any_constrained_single_sender< E, CV, VN > &&  that)
inlinenoexcept

Definition at line 122 of file constrained_single_sender.h.

122  {
124  new ((void*)this) any_constrained_single_sender(std::move(that));
125  return *this;
126  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class E, class CV, class... VN>
void folly::pushmi::any_constrained_single_sender< E, CV, VN >::submit ( CV  at,
any_receiver< E, VN... >  out 
)
inline

Definition at line 133 of file constrained_single_sender.h.

Referenced by folly::pushmi::any_constrained_single_sender< E, TP, VN... >::any_constrained_single_sender().

133  {
134  vptr_->submit_(data_, std::move(at), std::move(out));
135  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void(* submit_)(data &, CV, any_receiver< E, VN... >)
union folly::pushmi::any_constrained_single_sender::data data_
template<class E, class CV, class... VN>
CV folly::pushmi::any_constrained_single_sender< E, CV, VN >::top ( )
inline

Member Data Documentation

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

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