proxygen
countdown< R > Struct Template Reference

Public Types

using properties = mi::properties_t< decltype(R{}())>
 

Public Member Functions

 countdown (std::atomic< int > &c)
 
template<class ExecutorRef >
void value (ExecutorRef exec)
 
template<class E >
void error (E e)
 
void done ()
 
requires mi::Invocable< decltype(mi::set_value), Up, std::ptrdiff_t > void starting (Up up)
 
requires mi::True &&mi::Invocable< decltype(mi::set_value), Up > void starting (Up up) volatile
 

Public Attributes

std::atomic< int > * counter
 

Detailed Description

template<class R>
struct countdown< R >

Definition at line 40 of file PushmiBenchmarks.cpp.

Member Typedef Documentation

template<class R >
using countdown< R >::properties = mi::properties_t<decltype(R{}())>

Definition at line 43 of file PushmiBenchmarks.cpp.

Constructor & Destructor Documentation

template<class R >
countdown< R >::countdown ( std::atomic< int > &  c)
inlineexplicit

Definition at line 41 of file PushmiBenchmarks.cpp.

41 : counter(&c) {}
char c
std::atomic< int > * counter

Member Function Documentation

template<class R >
void countdown< R >::done ( )
inline
template<class R >
template<class E >
void countdown< R >::error ( e)
inline

Definition at line 50 of file PushmiBenchmarks.cpp.

50  {
51  std::abort();
52  }
template<class R >
requires mi::Invocable< decltype(mi::set_value), Up, std::ptrdiff_t> void countdown< R >::starting ( Up  up)
inline

Definition at line 58 of file PushmiBenchmarks.cpp.

References folly::pushmi::PUSHMI_TEMPLATE(), folly::pushmi::requires(), and folly::pushmi::set_value.

58  {
59  mi::set_value(up, 1);
60  }
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
template<class R >
requires mi::True&& mi:: Invocable<decltype(mi::set_value), Up> void countdown< R >::starting ( Up  up) volatile
inline

Definition at line 63 of file PushmiBenchmarks.cpp.

References folly::pushmi::set_value.

63  {
64  mi::set_value(up);
65  }
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
template<class R >
template<class ExecutorRef >
void countdown< R >::value ( ExecutorRef  exec)

Definition at line 70 of file PushmiBenchmarks.cpp.

References submit.

70  {
71  if (--*counter >= 0) {
72  exec | op::submit(R{}(*this));
73  }
74 }
std::atomic< int > * counter

Member Data Documentation

template<class R >
std::atomic<int>* countdown< R >::counter

Definition at line 45 of file PushmiBenchmarks.cpp.


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