proxygen
folly::pushmi::any_executor_ref< E > Struct Template Reference

#include <executor.h>

Classes

struct  vtable
 

Public Types

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

Public Member Functions

 any_executor_ref ()=delete
 
 any_executor_ref (const any_executor_ref &)=default
 
requires Sender< wrapped_t< Wrapped >, is_executor<>, is_single<> > any_executor_ref (Wrapped &w)
 
any_executor_ref executor ()
 
template<class SingleReceiver >
void submit (SingleReceiver &&sa)
 

Private Types

using This = any_executor_ref
 
template<class T >
using wrapped_t = detail::not_any_executor_ref_t< T >
 

Private Attributes

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

Detailed Description

template<class E>
struct folly::pushmi::any_executor_ref< E >

Definition at line 43 of file executor.h.

Member Typedef Documentation

Definition at line 53 of file executor.h.

template<class E >
using folly::pushmi::any_executor_ref< E >::This = any_executor_ref
private

Definition at line 45 of file executor.h.

template<class E >
template<class T >
using folly::pushmi::any_executor_ref< E >::wrapped_t = detail::not_any_executor_ref_t<T>
private

Definition at line 51 of file executor.h.

Constructor & Destructor Documentation

template<class E >
folly::pushmi::any_executor_ref< E >::any_executor_ref ( )
delete
template<class E >
folly::pushmi::any_executor_ref< E >::any_executor_ref ( const any_executor_ref< E > &  )
default
template<class E >
requires Sender<wrapped_t<Wrapped>, is_executor<>, is_single<> > folly::pushmi::any_executor_ref< E >::any_executor_ref ( Wrapped &  w)
inline

Definition at line 61 of file executor.h.

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

61  {
62  // This can't be a requirement because it asks if submit(w, any_receiver<E,T>)
63  // is well-formed (where T is an alias for any_executor_ref). If w
64  // has a submit that is constrained with SingleReceiver<any_receiver<E,T>, T'&, E'>, that
65  // will ask whether value(any_receiver<E,T>, T'&) is well-formed. And *that* will
66  // ask whether T'& is convertible to T. That brings us right back to this
67  // constructor. Constraint recursion!
68  static_assert(
69  SenderTo<Wrapped, any_receiver<E,This>>,
70  "Expecting to be passed a Sender that can send to a SingleReceiver"
71  " that accpets a value of type This and an error of type E");
72  struct s {
73  static void submit(void* pobj, void* s) {
75  *static_cast<Wrapped*>(pobj),
76  std::move(*static_cast<any_receiver<E, This>*>(s)));
77  }
78  };
79  static const vtable vtbl{s::submit};
80  pobj_ = std::addressof(w);
81  vptr_ = &vtbl;
82  }
struct folly::pushmi::any_executor_ref::vtable * vptr_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void submit(SingleReceiver &&sa)
Definition: executor.h:85
static set< string > s

Member Function Documentation

template<class E >
any_executor_ref folly::pushmi::any_executor_ref< E >::executor ( )
inline

Definition at line 83 of file executor.h.

83 { return *this; }
template<class E >
template<class SingleReceiver >
void folly::pushmi::any_executor_ref< E >::submit ( SingleReceiver &&  sa)
inline

Definition at line 85 of file executor.h.

References s.

85  {
86  // static_assert(
87  // ConvertibleTo<SingleReceiver, any_receiver<E, This>>,
88  // "requires any_receiver<E, any_executor_ref<E>>");
89  any_receiver<E, This> s{(SingleReceiver&&) sa};
90  vptr_->submit_(pobj_, &s);
91  }
struct folly::pushmi::any_executor_ref::vtable * vptr_
void(* submit_)(void *, void *)
Definition: executor.h:48
static set< string > s

Member Data Documentation

template<class E >
void* folly::pushmi::any_executor_ref< E >::pobj_
private

Definition at line 46 of file executor.h.

template<class E >
struct folly::pushmi::any_executor_ref::vtable* folly::pushmi::any_executor_ref< E >::vptr_
private

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