FastLED 3.9.15
Loading...
Searching...
No Matches
fl::detail::PromiseImpl< T > Class Template Reference

Detailed Description

template<typename T>
class fl::detail::PromiseImpl< T >

Implementation class for promise - holds the actual state and logic.

Definition at line 259 of file promise.h.

#include <promise.h>

+ Collaboration diagram for fl::detail::PromiseImpl< T >:

Public Member Functions

 PromiseImpl ()
 
const Errorerror () const
 Get error (only valid if rejected)
 
bool is_completed () const
 Check if promise is completed.
 
bool is_rejected () const
 Check if promise is rejected.
 
bool is_resolved () const
 Check if promise is resolved.
 
bool reject (const Error &error)
 Reject promise with error.
 
bool resolve (const T &value)
 Resolve promise with value.
 
bool resolve (T &&value)
 
void set_catch_callback (fl::function< void(const Error &)> callback)
 Set error callback.
 
void set_then_callback (fl::function< void(const T &)> callback)
 Set success callback.
 
void update ()
 Update promise state - processes callbacks if needed.
 
const T & value () const
 Get value (only valid if resolved)
 

Private Member Functions

void process_callbacks ()
 Process pending callbacks.
 

Private Attributes

bool mCallbacksProcessed
 
fl::function< void(const Error &)> mCatchCallback
 
Error mError
 
PromiseState_t mState
 
fl::function< void(const T &)> mThenCallback
 
mValue
 

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