proxygen
folly::pushmi::any_constrained_executor_ref< E, CV > Struct Template Reference

#include <executor.h>

Classes

struct  vtable
 

Public Types

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

Public Member Functions

 any_constrained_executor_ref ()=delete
 
 any_constrained_executor_ref (const any_constrained_executor_ref &)=default
 
requires ConstrainedSender< wrapped_t< Wrapped >, is_single<> > any_constrained_executor_ref (Wrapped &w)
 
CV top ()
 
any_constrained_executor_ref executor ()
 
template<class SingleReceiver >
void submit (CV cv, SingleReceiver &&sa)
 

Private Types

using This = any_constrained_executor_ref
 
template<class T >
using wrapped_t = detail::not_any_constrained_executor_ref_t< T >
 

Private Attributes

void * pobj_
 
struct folly::pushmi::any_constrained_executor_ref::vtablevptr_
 

Detailed Description

template<class E, class CV>
struct folly::pushmi::any_constrained_executor_ref< E, CV >

Definition at line 192 of file executor.h.

Member Typedef Documentation

Definition at line 203 of file executor.h.

template<class E , class CV >
using folly::pushmi::any_constrained_executor_ref< E, CV >::This = any_constrained_executor_ref
private

Definition at line 194 of file executor.h.

template<class E , class CV >
template<class T >
using folly::pushmi::any_constrained_executor_ref< E, CV >::wrapped_t = detail::not_any_constrained_executor_ref_t<T>
private

Definition at line 201 of file executor.h.

Constructor & Destructor Documentation

template<class E , class CV >
folly::pushmi::any_constrained_executor_ref< E, CV >::any_constrained_executor_ref ( )
delete
template<class E , class CV >
requires ConstrainedSender<wrapped_t<Wrapped>, is_single<> > folly::pushmi::any_constrained_executor_ref< E, CV >::any_constrained_executor_ref ( Wrapped &  w)
inline

Definition at line 211 of file executor.h.

References folly::gen::move, s, folly::pushmi::submit, submit, and folly::pushmi::top.

211  {
212  // This can't be a requirement because it asks if submit(w, top(w), any_receiver<E,T>)
213  // is well-formed (where T is an alias for any_constrained_executor_ref). If w
214  // has a submit that is constrained with ReceiveValue<any_receiver<E,T>, T'&>, that
215  // will ask whether value(any_receiver<E,T>, T'&) is well-formed. And *that* will
216  // ask whether T'& is convertible to T. That brings us right back to this
217  // constructor. Constraint recursion!
218  static_assert(
219  ConstrainedSenderTo<Wrapped, any_receiver<E,This>>,
220  "Expecting to be passed a ConstrainedSender that can send to a SingleReceiver"
221  " that accpets a value of type This and an error of type E");
222  struct s {
223  static CV top(void* pobj) {
224  return ::folly::pushmi::top(*static_cast<Wrapped*>(pobj));
225  }
226  static void submit(void* pobj, CV cv, void* s) {
228  *static_cast<Wrapped*>(pobj),
229  cv,
230  std::move(*static_cast<any_receiver<E, This>*>(s)));
231  }
232  };
233  static const vtable vtbl{s::top, s::submit};
234  pobj_ = std::addressof(w);
235  vptr_ = &vtbl;
236  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
struct folly::pushmi::any_constrained_executor_ref::vtable * vptr_
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn top
void submit(CV cv, SingleReceiver &&sa)
Definition: executor.h:242
static set< string > s

Member Function Documentation

template<class E , class CV >
any_constrained_executor_ref folly::pushmi::any_constrained_executor_ref< E, CV >::executor ( )
inline

Definition at line 240 of file executor.h.

240 { return *this; }
template<class E , class CV >
template<class SingleReceiver >
void folly::pushmi::any_constrained_executor_ref< E, CV >::submit ( CV  cv,
SingleReceiver &&  sa 
)
inline

Definition at line 242 of file executor.h.

References s.

242  {
243  // static_assert(
244  // ConvertibleTo<SingleReceiver, any_receiver<E, This>>,
245  // "requires any_receiver<E, any_constrained_executor_ref<E, TP>>");
246  any_receiver<E, This> s{(SingleReceiver&&) sa};
247  vptr_->submit_(pobj_, cv, &s);
248  }
struct folly::pushmi::any_constrained_executor_ref::vtable * vptr_
static set< string > s
template<class E , class CV >
CV folly::pushmi::any_constrained_executor_ref< E, CV >::top ( )
inline

Definition at line 237 of file executor.h.

237  {
238  return vptr_->top_(pobj_);
239  }
struct folly::pushmi::any_constrained_executor_ref::vtable * vptr_

Member Data Documentation

template<class E , class CV >
void* folly::pushmi::any_constrained_executor_ref< E, CV >::pobj_
private

Definition at line 195 of file executor.h.


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