3#ifndef PROGRAM_INFO_CACHE_H
4#define PROGRAM_INFO_CACHE_H
11#include <QWaitCondition>
47 void GetOrdered(std::vector<ProgramInfo*> &list,
bool newest_first =
false);
53 void Load(
bool updateUI =
true);
62 using Cache = QHash<uint,ProgramInfo*>;
73Q_DECLARE_OPERATORS_FOR_FLAGS(ProgramInfoCache::UpdateStates)
void GetOrdered(std::vector< ProgramInfo * > &list, bool newest_first=false)
void Add(const ProgramInfo &pginfo)
Adds a ProgramInfo to the cache.
QHash< uint, ProgramInfo * > Cache
bool Remove(uint recordingID)
Marks a ProgramInfo in the cache for deletion on the next call to Refresh().
bool IsLoadInProgress(void) const
void Load(bool updateUI=true)
ProgramInfoCache(QObject *o)
std::vector< ProgramInfo * > * m_nextCache
void Refresh(void)
Refreshed the cache.
Q_DECLARE_FLAGS(UpdateStates, UpdateState)
void UpdateFileSize(uint recordingID, uint64_t filesize, UpdateStates flags)
Updates a ProgramInfo in the cache.
QWaitCondition m_loadWait
void ScheduleLoad(bool updateUI=true)
ProgramInfoCache::UpdateStates Update(const ProgramInfo &pginfo)
Updates a ProgramInfo in the cache.
void WaitForLoadToComplete(void) const
ProgramInfo * GetRecordingInfo(uint recordingID) const
void Clear(void)
Clears the cache, m_lock must be held when this is called.
Holds information on recordings and videos.