FastLED 3.10.8
Loading...
Searching...
No Matches
fl::task::Handle Class Reference

Detailed Description

Task Handle with fluent API (was class fl::task, renamed to avoid namespace collision)

Definition at line 156 of file task.h.

#include <task.h>

+ Collaboration diagram for fl::task::Handle:

Public Member Functions

 Handle () FL_NO_EXCEPT=default
 Constructs an empty, invalid handle.
 
 Handle (const Handle &) FL_NO_EXCEPT=default
 Copies a handle, sharing ownership of the underlying task.
 
 Handle (Handle &&) FL_NO_EXCEPT=default
 Moves a handle without changing the underlying task.
 
 Handle (shared_ptr< ITaskImpl > impl) FL_NO_EXCEPT
 Constructs a handle for an existing task implementation.
 
Handle & cancel () FL_NO_EXCEPT
 Prevents future scheduled executions of the task.
 
Handle & catch_ (function< void(const Error &)> on_catch) FL_NO_EXCEPT
 Sets the callback invoked when task execution reports an error.
 
bool has_catch () const FL_NO_EXCEPT
 Returns whether an error callback is configured.
 
bool has_then () const FL_NO_EXCEPT
 Returns whether a success callback is configured.
 
int id () const FL_NO_EXCEPT
 Returns the task's unique identifier.
 
int interval_ms () const FL_NO_EXCEPT
 Returns the interval between runs, in milliseconds.
 
bool is_valid () const FL_NO_EXCEPT
 Returns whether this handle refers to a task.
 
bool isCoroutine () const FL_NO_EXCEPT
 Returns whether this handle refers to an OS-level coroutine.
 
bool isRunning () const FL_NO_EXCEPT
 Returns whether the represented coroutine is currently running.
 
u32 last_run_time () const FL_NO_EXCEPT
 Returns the timestamp of the most recent run, in milliseconds.
 
Handle & operator= (const Handle &) FL_NO_EXCEPT=default
 Copies a handle, sharing ownership of the underlying task.
 
Handle & operator= (Handle &&) FL_NO_EXCEPT=default
 Moves a handle without changing the underlying task.
 
bool ready_to_run (u32 current_time) const FL_NO_EXCEPT
 Tests whether the task is ready at a given timestamp.
 
void set_interval_ms (int interval_ms) FL_NO_EXCEPT
 Changes the interval between runs.
 
void set_last_run_time (u32 time) FL_NO_EXCEPT
 Records the timestamp of the most recent run.
 
void stop () FL_NO_EXCEPT
 Stops the coroutine represented by this handle.
 
Handle & then (function< void()> on_then) FL_NO_EXCEPT
 Sets the callback invoked when the task runs successfully.
 
string trace_label () const FL_NO_EXCEPT
 Returns the label of the task's creation trace, if available.
 
TaskType type () const FL_NO_EXCEPT
 Returns the task's scheduling mode.
 

Private Member Functions

void _execute_catch (const Error &error) FL_NO_EXCEPT
 
void _execute_then () FL_NO_EXCEPT
 
bool _has_then () const FL_NO_EXCEPT
 
int _id () const FL_NO_EXCEPT
 
bool _is_canceled () const FL_NO_EXCEPT
 
bool _ready_to_run (u32 current_time) const FL_NO_EXCEPT
 
bool _ready_to_run_frame_task (u32 current_time) const FL_NO_EXCEPT
 
void _set_id (int id) FL_NO_EXCEPT
 
void _set_last_run_time (u32 time) FL_NO_EXCEPT
 
string _trace_label () const FL_NO_EXCEPT
 
TaskType _type () const FL_NO_EXCEPT
 

Private Attributes

shared_ptr< ITaskImpl > mImpl
 

Friends

class Scheduler
 

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