proxygen
folly::ManualExecutor::ScheduledFunc Struct Reference

Public Member Functions

 ScheduledFunc (TimePoint const &t, Func &&f)
 
bool operator< (ScheduledFunc const &b) const
 
Func && moveOutFunc () const
 

Public Attributes

TimePoint time
 
size_t ordinal
 
Func func
 

Detailed Description

Definition at line 134 of file ManualExecutor.h.

Constructor & Destructor Documentation

folly::ManualExecutor::ScheduledFunc::ScheduledFunc ( TimePoint const &  t,
Func &&  f 
)
inline

Definition at line 139 of file ManualExecutor.h.

References folly::gen::seq().

139  : time(t), func(std::move(f)) {
140  static size_t seq = 0;
141  ordinal = seq++;
142  }
auto f
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Gen seq(Value first, Value last)
Definition: Base.h:484

Member Function Documentation

Func&& folly::ManualExecutor::ScheduledFunc::moveOutFunc ( ) const
inline

Definition at line 153 of file ManualExecutor.h.

References folly::gen::move.

153  {
154  return std::move(func);
155  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
bool folly::ManualExecutor::ScheduledFunc::operator< ( ScheduledFunc const &  b) const
inline

Definition at line 144 of file ManualExecutor.h.

References ordinal, and time.

144  {
145  // Earlier-scheduled things must be *higher* priority
146  // in the max-based std::priority_queue
147  if (time == b.time) {
148  return ordinal > b.ordinal;
149  }
150  return time > b.time;
151  }
char b

Member Data Documentation

Func folly::ManualExecutor::ScheduledFunc::func
mutable

Definition at line 137 of file ManualExecutor.h.

size_t folly::ManualExecutor::ScheduledFunc::ordinal

Definition at line 136 of file ManualExecutor.h.

Referenced by operator<().

TimePoint folly::ManualExecutor::ScheduledFunc::time

Definition at line 135 of file ManualExecutor.h.

Referenced by operator<().


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