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

Modified PeriodicHouseKeeperTask for tasks to be run once daily. More...

#include <housekeeper.h>

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

Public Member Functions

 DailyHouseKeeperTask (const QString &dbTag, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
 DailyHouseKeeperTask (const QString &dbTag, int minhour, int maxhour, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
virtual void SetHourWindow (int min, int max)
 
bool InWindow (const QDateTime &now) override
 
- Public Member Functions inherited from PeriodicHouseKeeperTask
 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 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)
 
- 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

void CalculateWindow (void) override
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

Private Attributes

QPair< int, int > m_windowHour
 

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...
 
- Protected Attributes inherited from PeriodicHouseKeeperTask
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}
 

Detailed Description

Modified PeriodicHouseKeeperTask for tasks to be run once daily.

This task type is for tasks that should only be run once daily. It follows the same behavior as the PeriodicHouseKeeperTask, but will restrict the run window to prevent a task from running a second time on the same day, and forces a task to at least thirty minutes before midnight if it has not yet run that day. This class supports a minhour and maxhour integer inputs to the constructer to allow further limiting of the window in which the task is allowed to run.

Definition at line 107 of file housekeeper.h.

Constructor & Destructor Documentation

◆ DailyHouseKeeperTask() [1/2]

DailyHouseKeeperTask::DailyHouseKeeperTask ( const QString &  dbTag,
HouseKeeperScope  scope = kHKGlobal,
HouseKeeperStartup  startup = kHKNormal 
)

Definition at line 439 of file housekeeper.cpp.

◆ DailyHouseKeeperTask() [2/2]

DailyHouseKeeperTask::DailyHouseKeeperTask ( const QString &  dbTag,
int  minhour,
int  maxhour,
HouseKeeperScope  scope = kHKGlobal,
HouseKeeperStartup  startup = kHKNormal 
)

Definition at line 447 of file housekeeper.cpp.

Member Function Documentation

◆ SetHourWindow()

void DailyHouseKeeperTask::SetHourWindow ( int  min,
int  max 
)
virtual

Definition at line 474 of file housekeeper.cpp.

Referenced by MythFillDatabaseTask::SetHourWindowFromDB().

◆ InWindow()

bool DailyHouseKeeperTask::InWindow ( const QDateTime &  now)
overridevirtual

Reimplemented from PeriodicHouseKeeperTask.

Definition at line 481 of file housekeeper.cpp.

Referenced by MythFillDatabaseTask::DoCheckRun().

◆ CalculateWindow()

void DailyHouseKeeperTask::CalculateWindow ( void  )
overrideprotectedvirtual

Reimplemented from PeriodicHouseKeeperTask.

Definition at line 455 of file housekeeper.cpp.

Referenced by DailyHouseKeeperTask(), and SetHourWindow().

Member Data Documentation

◆ m_windowHour

QPair<int, int> DailyHouseKeeperTask::m_windowHour
private

Definition at line 123 of file housekeeper.h.

Referenced by CalculateWindow(), InWindow(), and SetHourWindow().


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