|
Motion Master 6.0.0-alpha.50
Next-generation motion control software
|
Interface for work executed once per game loop cycle. More...
#include <cyclic_task.h>
Public Member Functions | |
| virtual | ~CyclicTask ()=default |
| Virtual destructor. | |
| virtual void | execute (const CycleContext &ctx)=0 |
| Called once per cycle, after process data has been exchanged and device parameters updated. | |
Interface for work executed once per game loop cycle.
Implementations must be non-blocking and must not allocate heap memory or perform I/O on the calling thread. Any async work (e.g. pushing data to a WebSocket) must be handed off to another thread via a lock-free channel.
Tasks are registered with GameLoop::addTask() before run() is called and are owned by the caller (the composition root). GameLoop holds non-owning pointers, so a task must outlive every call to run().
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Called once per cycle, after process data has been exchanged and device parameters updated.
Must return before the next cycle deadline. Blocking here stalls the entire RT loop.
| ctx | Per-cycle timing context (grid index + skipped count). Tasks that act only on the freshest state may ignore it. |
Implemented in ProcessDataCyclicTask.