QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ScheduledTask Class Reference

#include <ScheduledTask.h>

Public Member Functions

 ScheduledTask (RuntimeScheduler *scheduler, QObject *context)
 
 ~ScheduledTask ()
 
bool schedule (std::chrono::microseconds delay, RuntimeScheduler::Callback callback)
 
bool scheduleRepeating (std::chrono::microseconds interval, RuntimeScheduler::Callback callback)
 
void cancel ()
 
bool active () const
 

Detailed Description

Owns one deferred callback on the scheduler's thread; replacing or destroying it cancels the callback. All access, including destruction, must occur on that thread.

Definition at line 11 of file ScheduledTask.h.

Constructor & Destructor Documentation

◆ ScheduledTask()

ScheduledTask::ScheduledTask ( RuntimeScheduler *  scheduler,
QObject *  context 
)

Definition at line 9 of file ScheduledTask.cc.

◆ ~ScheduledTask()

ScheduledTask::~ScheduledTask ( )

Definition at line 15 of file ScheduledTask.cc.

References cancel().

Member Function Documentation

◆ active()

bool ScheduledTask::active ( ) const

Definition at line 63 of file ScheduledTask.cc.

◆ cancel()

◆ schedule()

bool ScheduledTask::schedule ( std::chrono::microseconds  delay,
RuntimeScheduler::Callback  callback 
)

Definition at line 21 of file ScheduledTask.cc.

References cancel().

Referenced by scheduleRepeating(), and NTRIPManager::setConfiguration().

◆ scheduleRepeating()

bool ScheduledTask::scheduleRepeating ( std::chrono::microseconds  interval,
RuntimeScheduler::Callback  callback 
)

Runs callback every interval until cancelled or replaced. Each run is rescheduled before the callback, so the callback may cancel or replace it.

Definition at line 40 of file ScheduledTask.cc.

References cancel(), schedule(), and scheduleRepeating().

Referenced by scheduleRepeating(), NTRIPConnectionStats::start(), and GPSReceiver::startConnectionPolling().


The documentation for this class was generated from the following files: