adapnex::core::LambdaTask
A helper class allowing a task to be defined by a lambda function.
Synopsis
Declared in <adapnex/core/task.h>
class LambdaTask final
: public Task
Description
|
Care should be taken to ensure the lifetime of any objects captured by reference is sufficiently long to prevent undefined behaviour by accessing invalid memory. For example: While the underlying objets pointed to by shared pointers may well persist beyond the scope of the shared pointer, the shared pointer object itself will not. Therefore, in most cases shared pointers should be captured by value and not by reference. |
Base Classes
| Name | Description |
|---|---|
Task represents a base class to implement schedulable application components. Tasks are combined via TaskGroup and executed by the scheduler according to the given scheduling parameters. See Application::CreateCyclicTaskGroup() and Application::CreateFreewheelingTaskGroup(). |
Member Functions
Name |
Description |
|
Constructs a LambdaTask with the given update function. |
Protected Member Functions
Name |
Description |
|
The PostUpdate method provides an opportunity to do some processing after all Update() methods have been invoked each cycle. Drivers generally use this to update any outputs that might have been written to by other tasks. |
|
The PreUpdate method provides an opportunity to do some processing before any Update() methods are invoked each cycle. Drivers generally use this step to update any inputs that might be consumed by other tasks. |
|
The Setup method is called once during the setup phase of the application after the setup() function has returned. Any remaining configuration or memory allocation that could not be handled in the constructor should occur here. The order in the Setup methods for each Task are called is dependent on the order in which the containing task groups are created followed by the order in which the tasks are added to their respective task groups. Drivers generally use this step to initialize any peripherals or devices, based on the previously defined configuration. |
|
Created with MrDocs