|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <RuntimeScheduler.h>
Inheritance diagram for RuntimeScheduler:
Collaboration diagram for RuntimeScheduler:Public Types | |
| using | TaskId = quint64 |
| using | Callback = std::function< void()> |
Public Member Functions | |
| RuntimeScheduler (QObject *parent=nullptr) | |
| ~RuntimeScheduler () override | |
| virtual quint64 | nowUs () const =0 |
| qint64 | nowMs () const |
| virtual TaskId | schedule (QObject *context, std::chrono::microseconds delay, Callback callback)=0 |
| virtual void | cancel (TaskId task)=0 |
| Cancellation from another thread is ignored. All other access and destruction must occur on the owner thread. | |
Static Public Member Functions | |
| static RuntimeScheduler * | orDefault (RuntimeScheduler *scheduler, QObject *owner) |
| scheduler, or a QtRuntimeScheduler owned by owner when it is null. | |
Static Public Attributes | |
| static constexpr auto | MAX_DELAY |
Protected Member Functions | |
| bool | _canSchedule (QObject *context, std::chrono::microseconds delay, const Callback &callback) const |
| bool | _isCurrentThread () const |
One-thread monotonic clock and deferred callbacks, shared by production controllers and deterministic replay. Classes that accept an injected scheduler create their own when none is supplied; an injected scheduler must share the owner's thread and outlive it.
Definition at line 11 of file RuntimeScheduler.h.
| using RuntimeScheduler::Callback = std::function<void()> |
Definition at line 16 of file RuntimeScheduler.h.
| using RuntimeScheduler::TaskId = quint64 |
Definition at line 15 of file RuntimeScheduler.h.
|
explicit |
Definition at line 15 of file RuntimeScheduler.cc.
|
override |
Definition at line 20 of file RuntimeScheduler.cc.
|
protected |
Definition at line 30 of file RuntimeScheduler.cc.
References _isCurrentThread(), and MAX_DELAY.
Referenced by QtRuntimeScheduler::schedule().
|
protected |
Definition at line 25 of file RuntimeScheduler.cc.
Referenced by _canSchedule(), and QtRuntimeScheduler::cancel().
|
pure virtual |
Cancellation from another thread is ignored. All other access and destruction must occur on the owner thread.
Implemented in QtRuntimeScheduler.
|
inline |
Definition at line 28 of file RuntimeScheduler.h.
References nowUs().
Referenced by NTRIPConnectionStats::correctionAgeSec(), and GPSCorrectionManager::setConfiguration().
|
pure virtual |
Implemented in QtRuntimeScheduler.
Referenced by NTRIPSourceTableController::fetch(), GPSCorrectionManager::GPSCorrectionManager(), nowMs(), and NTRIPVehicleGgaSource::setVehicle().
|
static |
scheduler, or a QtRuntimeScheduler owned by owner when it is null.
Definition at line 10 of file RuntimeScheduler.cc.
|
pure virtual |
Nonpositive delays defer until the next dispatch. Context must share this object's thread. Calls from other threads and delays above MAX_DELAY are rejected with task ID zero. Destroying context suppresses its callback. No ordering is promised for equal deadlines.
Implemented in QtRuntimeScheduler.
|
staticconstexpr |
Definition at line 17 of file RuntimeScheduler.h.
Referenced by _canSchedule().