Task Class Referenceabstract
Class to support running a background task. More...
#include <Task.h>
Inheritance diagram for Task:
Public Types | |
enum class | State { Suspended , Sleeping , Running } |
State of a task. More... | |
enum class | Notify { None , Suspending , Resuming , Sleeping , Waking } |
Notification of state change. More... | |
Public Member Functions | |
virtual | ~Task () |
bool | resume () |
Call to set task running. More... | |
void | suspend () |
Suspend a task. More... | |
void | sleep (unsigned interval) |
Puts the task to sleep for a while. More... | |
Protected Member Functions | |
virtual void | loop ()=0 |
Inherited classes override this to perform actual work. More... | |
virtual void | onNotify (Notify code) |
Called immediately before calling to loop() to indicate a state change. More... | |
Detailed Description
Class to support running a background task.
Member Enumeration Documentation
◆ Notify
|
strong |
◆ State
|
strong |
Constructor & Destructor Documentation
◆ ~Task()
|
inlinevirtual |
Member Function Documentation
◆ loop()
|
protectedpure virtual |
Inherited classes override this to perform actual work.
Implemented in Jerryscript::Task.
◆ onNotify()
|
inlineprotectedvirtual |
Called immediately before calling to loop() to indicate a state change.
◆ resume()
|
inline |
Call to set task running.
- Return values
-
bool true on success, false if task queue is full
◆ sleep()
|
inline |
Puts the task to sleep for a while.
- Parameters
-
interval Time in milliseconds
◆ suspend()
|
inline |
Suspend a task.
The documentation for this class was generated from the following file: