FreeRTOS C++ Wrappers
1.6.0
C++ interface to FreeRTOS
|
#include <workqueue.hpp>
Public Member Functions | |
WorkItem (bool freeAfterComplete=false) | |
virtual | ~WorkItem () |
bool | FreeAfterRun () |
virtual void | Run ()=0 |
Private Attributes | |
const bool | FreeItemAfterCompleted |
This class encapsulates the idea of a discrete, non-repeating task. Create a WorkItem when there is something you need to do on a different Thread, but doesn't have to happen periodically. This is a great construct for one off fire and forget tasks.
This is an abstract base class. To use this, you need to subclass it. All of your WorkItems should be derived from this class. Then implement the virtual Run function. This is a similar design to Java threading.
Definition at line 67 of file workqueue.hpp.
WorkItem::WorkItem | ( | bool | freeAfterComplete = false | ) |
Our constructor.
freeAfterComplete | If you pass in a true, you are requesing the WorkQueue itself to delete this WorkItem after it has run it. |
Definition at line 46 of file cworkqueue.cpp.
|
virtual |
Our destructor.
Definition at line 52 of file cworkqueue.cpp.
bool WorkItem::FreeAfterRun | ( | ) |
Allows a client to decide if this WorkItem is marked for automatic deletion.
Definition at line 57 of file cworkqueue.cpp.
|
pure virtual |
Implementation of your actual WorkItem function. You must override this function.
|
private |
Designates whether this WorkItem should be deleted after the WorkQueue has run it.
Definition at line 117 of file workqueue.hpp.