MythTV  master
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PeriodicHouseKeeperTask Class Reference

Modified HouseKeeperTask for tasks to be run at a regular interval. More...

#include <housekeeper.h>

Inheritance diagram for PeriodicHouseKeeperTask:
Inheritance graph
[legend]
Collaboration diagram for PeriodicHouseKeeperTask:
Collaboration graph
[legend]

Public Member Functions

 PeriodicHouseKeeperTask (const QString &dbTag, int period, float min=0.5, float max=1.1, int retry=0, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
bool DoCheckRun (QDateTime now) override
 
virtual bool InWindow (QDateTime now)
 
virtual bool PastWindow (QDateTime now)
 
QDateTime UpdateLastRun (QDateTime last, bool successful=true) override
 
void SetLastRun (QDateTime last, bool successful=true) override
 
virtual void SetWindow (float min, float max)
 
- Public Member Functions inherited from HouseKeeperTask
 HouseKeeperTask (const QString &dbTag, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
 ~HouseKeeperTask ()=default
 
bool CheckRun (QDateTime now)
 
bool Run (void)
 
bool ConfirmRun (void)
 
bool IsRunning (void)
 
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)
 
- Public Member Functions inherited from ReferenceCounter
 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)
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

Protected Attributes

int m_period
 
int m_retry
 
QPair< float, float > m_windowPercent
 
QPair< int, int > m_windowElapsed
 
float m_currentProb
 
- Protected Attributes inherited from ReferenceCounter
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 Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 

Detailed Description

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 84 of file housekeeper.h.

Constructor & Destructor Documentation

◆ PeriodicHouseKeeperTask()

PeriodicHouseKeeperTask::PeriodicHouseKeeperTask ( const QString &  dbTag,
int  period,
float  min = 0.5,
float  max = 1.1,
int  retry = 0,
HouseKeeperScope  scope = kHKGlobal,
HouseKeeperStartup  startup = kHKNormal 
)

Definition at line 320 of file housekeeper.cpp.

Member Function Documentation

◆ DoCheckRun()

bool PeriodicHouseKeeperTask::DoCheckRun ( QDateTime  now)
overridevirtual

◆ InWindow()

bool PeriodicHouseKeeperTask::InWindow ( QDateTime  now)
virtual

Reimplemented in DailyHouseKeeperTask.

Definition at line 409 of file housekeeper.cpp.

Referenced by DailyHouseKeeperTask::InWindow().

◆ PastWindow()

bool PeriodicHouseKeeperTask::PastWindow ( QDateTime  now)
virtual

Definition at line 421 of file housekeeper.cpp.

Referenced by DailyHouseKeeperTask::InWindow().

◆ UpdateLastRun()

QDateTime PeriodicHouseKeeperTask::UpdateLastRun ( QDateTime  last,
bool  successful = true 
)
overridevirtual

Reimplemented from HouseKeeperTask.

Definition at line 352 of file housekeeper.cpp.

Referenced by HardwareProfile::SubmitProfile().

◆ SetLastRun()

void PeriodicHouseKeeperTask::SetLastRun ( QDateTime  last,
bool  successful = true 
)
overridevirtual

Reimplemented from HouseKeeperTask.

Definition at line 361 of file housekeeper.cpp.

◆ SetWindow()

void PeriodicHouseKeeperTask::SetWindow ( float  min,
float  max 
)
virtual

Definition at line 345 of file housekeeper.cpp.

◆ CalculateWindow()

void PeriodicHouseKeeperTask::CalculateWindow ( void  )
protectedvirtual

Member Data Documentation

◆ m_period

int PeriodicHouseKeeperTask::m_period
protected

Definition at line 100 of file housekeeper.h.

Referenced by CalculateWindow(), and PeriodicHouseKeeperTask().

◆ m_retry

int PeriodicHouseKeeperTask::m_retry
protected

Definition at line 101 of file housekeeper.h.

Referenced by CalculateWindow(), and PeriodicHouseKeeperTask().

◆ m_windowPercent

QPair<float,float> PeriodicHouseKeeperTask::m_windowPercent
protected

Definition at line 102 of file housekeeper.h.

Referenced by CalculateWindow(), and SetWindow().

◆ m_windowElapsed

QPair<int,int> PeriodicHouseKeeperTask::m_windowElapsed
protected

◆ m_currentProb

float PeriodicHouseKeeperTask::m_currentProb
protected

Definition at line 104 of file housekeeper.h.

Referenced by DoCheckRun(), SetLastRun(), and UpdateLastRun().


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