folly::TimerFD

Synopsis

Declared in <folly/io/async/TimerFD.h>

class TimerFD
    : public folly::EventHandler
    , public DelayedDestruction

Base Classes

NameDescription
folly::EventHandlerThe EventHandler class is used to asynchronously wait for events on a file descriptor.
DelayedDestructionDelayedDestruction is a helper class to ensure objects are not deleted while they still have functions executing in a higher stack frame.

Types

NameDescription
Destructor Helper class to allow DelayedDestruction classes to be used with std::shared_ptr.
DestructorGuard Classes should create a DestructorGuard object on the stack in any function that may invoke callback functions.
IntrusivePtr This smart pointer is a convenient way to manage a concrete DelayedDestructorBase child. It can replace the equivalent raw pointer and provide automatic memory management.

Enums

NameDescription
EventFlags Bitset flags describing the I/O events a handler can wait for.

Member Functions

NameDescription
TimerFD [constructor]Construct from EventBase
~TimerFD [destructor] [virtual]Destructor
operator= Assignment operators
activateEvent Make an event active.
attachEventBase Attach the handler to a EventBase.
cancel
changeHandlerFD Change the file descriptor that this handler is associated with.
destroy [virtual]destroy() requests destruction of the object.
detachEventBase Detach the handler from its EventBase.
getDestroyPending Returns whether destruction has been requested but deferred.
getRegisteredEvents Return the set of events that we're currently registered for.
handlerReady [virtual]
initHandler Attach the handler to a EventBase, and change the file descriptor.
isHandlerRegistered Returns true if the handler is currently registered.
isPending Returns true if the handler is registered but has not yet fired.
onTimeout [virtual]
registerHandler Register the handler.
registerInternalHandler Register the handler as an internal event.
schedule
setEdgeTriggered If supported by the backend updates the event to be edge-triggered. Returns true iff the update was successful.
unregisterHandler Unregister the handler, if it is registered.

Protected Member Functions

NameDescription
close
getDestructorGuardCount Get the number of DestructorGuards currently protecting this object.
onDelayedDestroy [virtual]Implement onDelayedDestroy in subclasses. onDelayedDestroy() is invoked when the object is potentially being destroyed.

Derived Classes

NameDescription
TimerFDTimeoutManager Manages many timeouts on a single TimerFD.