proxygen
folly::detail::async_timeout_wrapper< TCallback > Struct Template Reference

#include <AsyncTimeout.h>

Inheritance diagram for folly::detail::async_timeout_wrapper< TCallback >:
folly::AsyncTimeout

Public Member Functions

template<typename UCallback >
 async_timeout_wrapper (TimeoutManager *manager, UCallback &&callback)
 
void timeoutExpired () noexceptoverride
 
- Public Member Functions inherited from folly::AsyncTimeout
 AsyncTimeout (TimeoutManager *timeoutManager)
 
 AsyncTimeout (EventBase *eventBase)
 
 AsyncTimeout (TimeoutManager *timeoutManager, InternalEnum internal)
 
 AsyncTimeout (EventBase *eventBase, InternalEnum internal)
 
 AsyncTimeout ()
 
virtual ~AsyncTimeout ()
 
bool scheduleTimeout (uint32_t milliseconds)
 
bool scheduleTimeout (TimeoutManager::timeout_type timeout)
 
void cancelTimeout ()
 
bool isScheduled () const
 
void attachTimeoutManager (TimeoutManager *timeoutManager, InternalEnum internal=InternalEnum::NORMAL)
 
void attachEventBase (EventBase *eventBase, InternalEnum internal=InternalEnum::NORMAL)
 
void detachTimeoutManager ()
 
void detachEventBase ()
 
const TimeoutManagergetTimeoutManager ()
 
struct event * getEvent ()
 

Private Attributes

TCallback callback_
 

Additional Inherited Members

- Public Types inherited from folly::AsyncTimeout
typedef TimeoutManager::InternalEnum InternalEnum
 
- Static Public Member Functions inherited from folly::AsyncTimeout
template<typename TCallback >
static std::unique_ptr< AsyncTimeoutmake (TimeoutManager &manager, TCallback &&callback)
 
template<typename TCallback >
static std::unique_ptr< AsyncTimeoutschedule (TimeoutManager::timeout_type timeout, TimeoutManager &manager, TCallback &&callback)
 

Detailed Description

template<typename TCallback>
struct folly::detail::async_timeout_wrapper< TCallback >

Wraps a function object as an AsyncTimeout instance.

Author
: Marcelo Juchem marce.nosp@m.lo@f.nosp@m.b.com

Definition at line 242 of file AsyncTimeout.h.

Constructor & Destructor Documentation

template<typename TCallback >
template<typename UCallback >
folly::detail::async_timeout_wrapper< TCallback >::async_timeout_wrapper ( TimeoutManager manager,
UCallback &&  callback 
)
inline

Definition at line 244 of file AsyncTimeout.h.

245  : AsyncTimeout(manager), callback_(std::forward<UCallback>(callback)) {}

Member Function Documentation

template<typename TCallback >
void folly::detail::async_timeout_wrapper< TCallback >::timeoutExpired ( )
inlineoverridevirtualnoexcept

timeoutExpired() is invoked when the timeout period has expired.

Implements folly::AsyncTimeout.

Definition at line 247 of file AsyncTimeout.h.

References callback_, and folly::pushmi::__adl::noexcept().

247  {
248  static_assert(
249  noexcept(std::declval<TCallback>()()),
250  "callback must be declared noexcept, e.g.: `[]() noexcept {}`");
251  callback_();
252  }
requires E e noexcept(noexcept(s.error(std::move(e))))

Member Data Documentation

template<typename TCallback >
TCallback folly::detail::async_timeout_wrapper< TCallback >::callback_
private

Definition at line 255 of file AsyncTimeout.h.


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