MythTV
master
|
Modified HouseKeeperTask for tasks to be run at a regular interval. More...
#include <housekeeper.h>
Public Member Functions | |
PeriodicHouseKeeperTask (const QString &dbTag, std::chrono::seconds period, float min=0.5, float max=1.1, std::chrono::seconds retry=0s, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal) | |
bool | DoCheckRun (const QDateTime &now) override |
virtual bool | InWindow (const QDateTime &now) |
virtual bool | PastWindow (const QDateTime &now) |
QDateTime | UpdateLastRun (const QDateTime &last, bool successful=true) override |
void | SetLastRun (const QDateTime &last, bool successful=true) override |
virtual void | SetWindow (float min, float max) |
![]() | |
HouseKeeperTask (const QString &dbTag, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal) | |
~HouseKeeperTask () override=default | |
bool | CheckRun (const QDateTime &now) |
bool | Run (void) |
bool | ConfirmRun (void) const |
bool | IsRunning (void) const |
bool | CheckImmediate (void) |
bool | CheckStartup (void) |
QString | GetTag (void) |
QDateTime | GetLastRun (void) |
QDateTime | GetLastSuccess (void) |
HouseKeeperScope | GetScope (void) |
QDateTime | QueryLastRun (void) |
QDateTime | QueryLastSuccess (void) |
QDateTime | UpdateLastRun (bool successful=true) |
virtual bool | DoRun (void) |
virtual void | Terminate (void) |
![]() | |
ReferenceCounter (const QString &debugName, bool logDebug=true) | |
Creates reference counter with an initial value of 1. More... | |
virtual int | IncrRef (void) |
Increments reference count. More... | |
virtual int | DecrRef (void) |
Decrements reference count and deletes on 0. More... | |
Protected Member Functions | |
virtual void | CalculateWindow (void) |
![]() | |
virtual | ~ReferenceCounter (void) |
Called on destruction, will warn if object deleted with references in place. More... | |
Protected Attributes | |
std::chrono::seconds | m_period |
std::chrono::seconds | m_retry |
QPair< float, float > | m_windowPercent |
QPair< std::chrono::seconds, std::chrono::seconds > | m_windowElapsed |
double | m_currentProb { 1.0 } |
![]() | |
bool | m_logDebug |
This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
QAtomicInt | m_referenceCount {1} |
Additional Inherited Members | |
![]() | |
static void | PrintDebug (void) |
Print out any leaks if that level of debugging is enabled. More... | |
Modified HouseKeeperTask for tasks to be run at a regular interval.
This task type is to be used for tasks that need to be run at a regular interval. The period argument in the constructor defines this interval in integer seconds. The min and max attributes control the region over which the task can be run, given as a float multiple of the period. The defaults are 0.5-1.1. The test for running is a linearly increasing probability from the start to end of this period, and the task is forced to run if the end of the period is reached.
Definition at line 85 of file housekeeper.h.
PeriodicHouseKeeperTask::PeriodicHouseKeeperTask | ( | const QString & | dbTag, |
std::chrono::seconds | period, | ||
float | min = 0.5 , |
||
float | max = 1.1 , |
||
std::chrono::seconds | retry = 0s , |
||
HouseKeeperScope | scope = kHKGlobal , |
||
HouseKeeperStartup | startup = kHKNormal |
||
) |
Definition at line 327 of file housekeeper.cpp.
|
overridevirtual |
Reimplemented from HouseKeeperTask.
Reimplemented in MythFillDatabaseTask, ArtworkTask, ThemeUpdateTask, and RadioStreamUpdateTask.
Definition at line 375 of file housekeeper.cpp.
Referenced by RadioStreamUpdateTask::DoCheckRun(), ThemeUpdateTask::DoCheckRun(), ArtworkTask::DoCheckRun(), HardwareProfileTask::DoCheckRun(), and MythFillDatabaseTask::DoCheckRun().
|
virtual |
Reimplemented in DailyHouseKeeperTask.
Definition at line 419 of file housekeeper.cpp.
Referenced by DailyHouseKeeperTask::InWindow().
|
virtual |
Definition at line 431 of file housekeeper.cpp.
Referenced by DailyHouseKeeperTask::InWindow().
|
overridevirtual |
Reimplemented from HouseKeeperTask.
Definition at line 359 of file housekeeper.cpp.
Referenced by HardwareProfile::SubmitProfile().
|
overridevirtual |
Reimplemented from HouseKeeperTask.
Definition at line 368 of file housekeeper.cpp.
|
virtual |
Definition at line 352 of file housekeeper.cpp.
|
protectedvirtual |
Reimplemented in DailyHouseKeeperTask.
Definition at line 338 of file housekeeper.cpp.
Referenced by DailyHouseKeeperTask::CalculateWindow(), PeriodicHouseKeeperTask(), SetLastRun(), SetWindow(), and UpdateLastRun().
|
protected |
Definition at line 101 of file housekeeper.h.
Referenced by CalculateWindow(), and PeriodicHouseKeeperTask().
|
protected |
Definition at line 102 of file housekeeper.h.
Referenced by CalculateWindow(), and PeriodicHouseKeeperTask().
|
protected |
Definition at line 103 of file housekeeper.h.
Referenced by CalculateWindow(), and SetWindow().
|
protected |
Definition at line 104 of file housekeeper.h.
Referenced by CalculateWindow(), DailyHouseKeeperTask::CalculateWindow(), DoCheckRun(), InWindow(), and PastWindow().
|
protected |
Definition at line 105 of file housekeeper.h.
Referenced by DoCheckRun(), SetLastRun(), and UpdateLastRun().