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 <libmythbase/housekeeper.h>

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

Public Member Functions

 DailyHouseKeeperTask (const QString &dbTag, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
 DailyHouseKeeperTask (const QString &dbTag, std::chrono::hours minhour, std::chrono::hours maxhour, HouseKeeperScope scope=kHKGlobal, HouseKeeperStartup startup=kHKNormal)
 
virtual void SetHourWindow (std::chrono::hours min, std::chrono::hours max)
 
bool InWindow (const QDateTime &now) override
 
- Public Member Functions inherited from 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)
 
bool DoCheckRun (const 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 () 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)
 
- 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< std::chrono::hours, std::chrono::hours > 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
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 }
 
- 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 108 of file housekeeper.h.

Constructor & Destructor Documentation

◆ DailyHouseKeeperTask() [1/2]

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

Definition at line 453 of file housekeeper.cpp.

◆ DailyHouseKeeperTask() [2/2]

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

Definition at line 461 of file housekeeper.cpp.

Member Function Documentation

◆ SetHourWindow()

void DailyHouseKeeperTask::SetHourWindow ( std::chrono::hours  min,
std::chrono::hours  max 
)
virtual

Definition at line 489 of file housekeeper.cpp.

Referenced by MythFillDatabaseTask::SetHourWindowFromDB().

◆ InWindow()

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

Reimplemented from PeriodicHouseKeeperTask.

Definition at line 496 of file housekeeper.cpp.

Referenced by MythFillDatabaseTask::DoCheckRun().

◆ CalculateWindow()

void DailyHouseKeeperTask::CalculateWindow ( void  )
overrideprotectedvirtual

Reimplemented from PeriodicHouseKeeperTask.

Definition at line 470 of file housekeeper.cpp.

Referenced by DailyHouseKeeperTask(), and SetHourWindow().

Member Data Documentation

◆ m_windowHour

QPair<std::chrono::hours, std::chrono::hours> DailyHouseKeeperTask::m_windowHour
private

Definition at line 125 of file housekeeper.h.

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


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