proxygen
folly::pushmi::any_time_executor_ref< E, TP > Struct Template Reference

#include <executor.h>

Classes

struct  vtable
 

Public Types

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

Public Member Functions

 any_time_executor_ref ()=delete
 
 any_time_executor_ref (const any_time_executor_ref &)=default
 
requires TimeSender< wrapped_t< Wrapped >, is_single<> > any_time_executor_ref (Wrapped &w)
 
std::chrono::system_clock::time_point top ()
 
any_time_executor_ref executor ()
 
template<class SingleReceiver >
void submit (TP tp, SingleReceiver &&sa)
 

Private Types

using This = any_time_executor_ref
 
template<class T >
using wrapped_t = detail::not_any_time_executor_ref_t< T >
 

Private Attributes

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

Detailed Description

template<class E, class TP>
struct folly::pushmi::any_time_executor_ref< E, TP >

Definition at line 356 of file executor.h.

Member Typedef Documentation

template<class E , class TP >
using folly::pushmi::any_time_executor_ref< E, TP >::properties = property_set<is_time<>, is_executor<>, is_single<>>

Definition at line 367 of file executor.h.

template<class E , class TP >
using folly::pushmi::any_time_executor_ref< E, TP >::This = any_time_executor_ref
private

Definition at line 358 of file executor.h.

template<class E , class TP >
template<class T >
using folly::pushmi::any_time_executor_ref< E, TP >::wrapped_t = detail::not_any_time_executor_ref_t<T>
private

Definition at line 365 of file executor.h.

Constructor & Destructor Documentation

template<class E , class TP >
folly::pushmi::any_time_executor_ref< E, TP >::any_time_executor_ref ( )
delete
template<class E , class TP >
folly::pushmi::any_time_executor_ref< E, TP >::any_time_executor_ref ( const any_time_executor_ref< E, TP > &  )
default
template<class E , class TP >
requires TimeSender<wrapped_t<Wrapped>, is_single<> > folly::pushmi::any_time_executor_ref< E, TP >::any_time_executor_ref ( Wrapped &  w)
inline

Definition at line 375 of file executor.h.

References folly::gen::move, now(), folly::pushmi::now, s, folly::pushmi::submit, submit, and folly::pushmi::__adl::tp.

375  {
376  // This can't be a requirement because it asks if submit(w, now(w), any_receiver<E, T>)
377  // is well-formed (where T is an alias for any_time_executor_ref). If w
378  // has a submit that is constrained with ReceiverValue<any_receiver<E, T>, T'&>, that
379  // will ask whether value(any_receiver<E, T>, T'&) is well-formed. And *that* will
380  // ask whether T'& is convertible to T. That brings us right back to this
381  // constructor. Constraint recursion!
382  static_assert(
383  TimeSenderTo<Wrapped, any_receiver<E, This>>,
384  "Expecting to be passed a TimeSender that can send to a SingleReceiver"
385  " that accpets a value of type This and an error of type E");
386  struct s {
387  static TP now(void* pobj) {
388  return ::folly::pushmi::now(*static_cast<Wrapped*>(pobj));
389  }
390  static void submit(void* pobj, TP tp, void* s) {
392  *static_cast<Wrapped*>(pobj),
393  tp,
394  std::move(*static_cast<any_receiver<E, This>*>(s)));
395  }
396  };
397  static const vtable vtbl{s::now, s::submit};
398  pobj_ = std::addressof(w);
399  vptr_ = &vtbl;
400  }
struct folly::pushmi::any_time_executor_ref::vtable * vptr_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::chrono::steady_clock::time_point now()
void submit(TP tp, SingleReceiver &&sa)
Definition: executor.h:406
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn now
static set< string > s

Member Function Documentation

template<class E , class TP >
any_time_executor_ref folly::pushmi::any_time_executor_ref< E, TP >::executor ( )
inline

Definition at line 404 of file executor.h.

404 { return *this; }
template<class E , class TP >
template<class SingleReceiver >
void folly::pushmi::any_time_executor_ref< E, TP >::submit ( TP  tp,
SingleReceiver &&  sa 
)
inline

Definition at line 406 of file executor.h.

References s.

406  {
407  // static_assert(
408  // ConvertibleTo<SingleReceiver, any_receiver<E, This>>,
409  // "requires any_receiver<E, any_time_executor_ref<E, TP>>");
410  any_receiver<E, This> s{(SingleReceiver&&) sa};
411  vptr_->submit_(pobj_, tp, &s);
412  }
struct folly::pushmi::any_time_executor_ref::vtable * vptr_
void(* submit_)(void *, TP, void *)
Definition: executor.h:362
static set< string > s
template<class E , class TP >
std::chrono::system_clock::time_point folly::pushmi::any_time_executor_ref< E, TP >::top ( )
inline

Definition at line 401 of file executor.h.

401  {
402  return vptr_->now_(pobj_);
403  }
struct folly::pushmi::any_time_executor_ref::vtable * vptr_

Member Data Documentation

template<class E , class TP >
void* folly::pushmi::any_time_executor_ref< E, TP >::pobj_
private

Definition at line 359 of file executor.h.

template<class E , class TP >
struct folly::pushmi::any_time_executor_ref::vtable* folly::pushmi::any_time_executor_ref< E, TP >::vptr_
private

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