vdr 2.7.2
|
#include <timers.h>
Public Member Functions | |
cTimers (void) | |
const cTimer * | GetById (int Id, const char *Remote=NULL) const |
cTimer * | GetById (int Id, const char *Remote=NULL) |
const cTimer * | GetTimer (const cTimer *Timer) const |
cTimer * | GetTimer (const cTimer *Timer) |
const cTimer * | GetMatch (time_t t) const |
cTimer * | GetMatch (time_t t) |
const cTimer * | GetMatch (const cEvent *Event, eTimerMatch *Match=NULL) const |
cTimer * | GetMatch (const cEvent *Event, eTimerMatch *Match=NULL) |
const cTimer * | GetTimerForEvent (const cEvent *Event, eTimerFlags Flags=tfNone) const |
int | GetMaxPriority (void) const |
const cTimer * | GetNextActiveTimer (void) const |
const cTimer * | UsesChannel (const cChannel *Channel) const |
bool | SetEvents (const cSchedules *Schedules) |
bool | SpawnPatternTimers (const cSchedules *Schedules) |
bool | AdjustSpawnedTimers (void) |
bool | DeleteExpired (bool Force) |
void | Add (cTimer *Timer, cTimer *After=NULL) |
void | Ins (cTimer *Timer, cTimer *Before=NULL) |
void | Del (cTimer *Timer, bool DeleteObject=true) |
bool | StoreRemoteTimers (const char *ServerName=NULL, const cStringList *RemoteTimers=NULL) |
![]() | |
cConfig (const char *NeedsLocking=NULL) | |
virtual | ~cConfig () |
const char * | FileName (void) |
bool | Load (const char *FileName=NULL, bool AllowComments=false, bool MustExist=false) |
bool | Save (void) const |
![]() | |
cList (const char *NeedsLocking=NULL) | |
const cTimer * | Get (int Index) const |
cTimer * | Get (int Index) |
const cTimer * | First (void) const |
cTimer * | First (void) |
const cTimer * | Last (void) const |
cTimer * | Last (void) |
const cTimer * | Prev (const cTimer *Object) const |
cTimer * | Prev (const cTimer *Object) |
const cTimer * | Next (const cTimer *Object) const |
cTimer * | Next (const cTimer *Object) |
![]() | |
virtual | ~cListBase () |
bool | Lock (cStateKey &StateKey, bool Write=false, int TimeoutMs=0) const |
void | SetSyncStateKey (cStateKey &StateKey) |
void | SetUseGarbageCollector (void) |
void | SetExplicitModify (void) |
void | SetModified (void) |
void | Add (cListObject *Object, cListObject *After=NULL) |
void | Ins (cListObject *Object, cListObject *Before=NULL) |
void | Del (cListObject *Object, bool DeleteObject=true) |
virtual void | Move (int From, int To) |
void | Move (cListObject *From, cListObject *To) |
bool | Contains (const cListObject *Object) const |
const cListObject * | Get (int Index) const |
cListObject * | Get (int Index) |
int | Count (void) const |
void | Sort (void) |
Static Public Member Functions | |
static const cTimers * | GetTimersRead (cStateKey &StateKey, int TimeoutMs=0) |
static cTimers * | GetTimersWrite (cStateKey &StateKey, int TimeoutMs=0) |
static bool | Load (const char *FileName) |
static int | NewTimerId (void) |
Private Attributes | |
time_t | lastDeleteExpired |
Static Private Attributes | |
static cTimers | timers |
static int | lastTimerId = 0 |
Additional Inherited Members | |
![]() | |
cListBase (const char *NeedsLocking=NULL) | |
![]() | |
cListObject * | objects |
cListObject * | lastObject |
int | count |
cStateLock | stateLock |
const char * | needsLocking |
bool | useGarbageCollector |
cTimers::cTimers | ( | void | ) |
Definition at line 1077 of file timers.c.
References lastDeleteExpired.
Definition at line 1210 of file timers.c.
References cListBase::Add(), cStatus::MsgTimerChange(), NewTimerId(), cTimer::Remote(), cTimer::SetId(), and tcAdd.
Referenced by cRecordControl::cRecordControl(), cTimer::SpawnPatternTimer(), and StoreRemoteTimers().
bool cTimers::AdjustSpawnedTimers | ( | void | ) |
Definition at line 1261 of file timers.c.
References cList< cTimer >::First(), cList< cTimer >::Next(), tfSpawned, and tfVps.
Referenced by main().
void cTimers::Del | ( | cTimer * | Timer, |
bool | DeleteObject = true ) |
Definition at line 1224 of file timers.c.
References cListBase::Del(), cStatus::MsgTimerChange(), and tcDel.
Referenced by cRecordControl::cRecordControl(), cMenuTimers::Delete(), DeleteExpired(), and StoreRemoteTimers().
bool cTimers::DeleteExpired | ( | bool | Force | ) |
Definition at line 1275 of file timers.c.
References Del(), DELETE_EXPIRED_TIMEOUT, cTimer::Expired(), cList< cTimer >::First(), isyslog, lastDeleteExpired, cList< cTimer >::Next(), cTimer::Remote(), cTimer::SetEvent(), cTimer::ToDescr(), and cTimer::TriggerRespawn().
Referenced by main().
|
inline |
const cTimer * cTimers::GetById | ( | int | Id, |
const char * | Remote = NULL ) const |
Definition at line 1103 of file timers.c.
References cList< cTimer >::First(), and cList< cTimer >::Next().
Referenced by GetById(), and StoreRemoteTimers().
|
inline |
Definition at line 198 of file timers.h.
References GetMatch().
const cTimer * cTimers::GetMatch | ( | const cEvent * | Event, |
eTimerMatch * | Match = NULL ) const |
Definition at line 1150 of file timers.c.
References cList< cTimer >::First(), cTimer::IsPatternTimer(), cList< cTimer >::Next(), cTimer::Remote(), tfSpawned, tmFull, and tmNone.
|
inline |
Definition at line 196 of file timers.h.
References GetMatch().
const cTimer * cTimers::GetMatch | ( | time_t | t | ) | const |
Definition at line 1127 of file timers.c.
References cList< cTimer >::First(), cList< cTimer >::Next(), and cTimer::Priority().
Referenced by cMenuEvent::cMenuEvent(), GetMatch(), GetMatch(), main(), and cMenuScheduleItem::Update().
int cTimers::GetMaxPriority | ( | void | ) | const |
Returns the maximum priority of all local timers that are currently recording.
If there is no local timer currently recording, -1 is returned.
Definition at line 1177 of file timers.c.
References cList< cTimer >::First(), max(), and cList< cTimer >::Next().
Referenced by main().
const cTimer * cTimers::GetNextActiveTimer | ( | void | ) | const |
Definition at line 1187 of file timers.c.
References cList< cTimer >::First(), cList< cTimer >::Next(), cTimer::StopTime(), and tfActive.
Definition at line 194 of file timers.h.
References GetTimer().
Definition at line 1114 of file timers.c.
References cTimer::Channel(), cTimer::Day(), cList< cTimer >::First(), cList< cTimer >::Next(), cTimer::Start(), cTimer::Stop(), and cTimer::WeekDays().
Referenced by GetTimer().
const cTimer * cTimers::GetTimerForEvent | ( | const cEvent * | Event, |
eTimerFlags | Flags = tfNone ) const |
Definition at line 1166 of file timers.c.
References cList< cTimer >::First(), cEvent::HasTimer(), and cList< cTimer >::Next().
Referenced by cTimer::SpawnPatternTimers().
Gets the list of timers for read access.
If TimeoutMs is given, it will wait that long to get a read lock before giving up. Otherwise it will wait indefinitely. If no read lock can be obtained within the given timeout, NULL will be returned. The list is locked and a pointer to it is returned if the state of the list is different than the state of the given StateKey. If both states are equal, the list of timers has not been modified since the last call with the same StateKey, and NULL will be returned (and the list is not locked). After the returned list of timers is no longer needed, the StateKey's Remove() function must be called to release the list. The time between calling cTimers::GetTimersRead() and StateKey.Remove() should be as short as possible. After calling StateKey.Remove() the list returned from this call must not be accessed any more. If you need to access the timers again later, a new call to GetTimersRead() must be made. A typical code sequence would look like this: cStateKey StateKey; if (const cTimers *Timers = cTimers::GetTimersRead(StateKey)) { // access the timers StateKey.Remove(); }
Definition at line 1200 of file timers.c.
References cListBase::Lock(), and timers.
Referenced by cSkinLCARSDisplayMenu::DrawTimers(), main(), cSVDRPClientHandler::ProcessConnections(), cMenuTimers::Set(), cMenuSchedule::Update(), and cMenuWhatsOn::Update().
Gets the list of timers for write access.
If TimeoutMs is given, it will wait that long to get a write lock before giving up. Otherwise it will wait indefinitely. If no write lock can be obtained within the given timeout, NULL will be returned. If a write lock can be obtained, the list of timers will be returned, regardless of the state values of the timers or the given StateKey. After the returned list of timers is no longer needed, the StateKey's Remove() function must be called to release the list. The time between calling cTimers::GetTimersWrite() and StateKey.Remove() should be as short as possible. After calling StateKey.Remove() the list returned from this call must not be accessed any more. If you need to access the timers again later, a new call to GetTimersWrite() must be made. The call to StateKey.Remove() will increment the state of the list of timers and will copy the new state value to the StateKey. You can suppress this by using 'false' as the parameter to the call, in which case the state values are left untouched. A typical code sequence would look like this: cStateKey StateKey; if (cTimers *Timers = cTimers::GetTimersWrite(StateKey)) { // access the timers StateKey.Remove(); }
Definition at line 1205 of file timers.c.
References cListBase::Lock(), and timers.
Referenced by cMenuTimers::Delete(), main(), cMenuTimers::OnOff(), and cSVDRPClientHandler::ProcessConnections().
Definition at line 1218 of file timers.c.
References cListBase::Ins(), cStatus::MsgTimerChange(), and tcAdd.
|
static |
Definition at line 1083 of file timers.c.
References cConfig< cTimer >::FileName(), cList< T >::First(), LOCK_TIMERS_WRITE, NewTimerId(), cList< T >::Next(), tfRecording, and timers.
Referenced by main().
|
static |
Definition at line 1098 of file timers.c.
References lastTimerId.
Referenced by Add(), HandleRemoteTimerModifications(), and Load().
bool cTimers::SetEvents | ( | const cSchedules * | Schedules | ) |
Definition at line 1239 of file timers.c.
References cList< cTimer >::First(), and cList< cTimer >::Next().
Referenced by main().
bool cTimers::SpawnPatternTimers | ( | const cSchedules * | Schedules | ) |
Definition at line 1249 of file timers.c.
References cList< cTimer >::First(), cList< cTimer >::Next(), and tfActive.
Referenced by main().
bool cTimers::StoreRemoteTimers | ( | const char * | ServerName = NULL, |
const cStringList * | RemoteTimers = NULL ) |
Stores the given list of RemoteTimers, which come from the VDR ServerName, in this list.
If no ServerName is given, all remote timers from all peer machines will be removed from this list. If no RemoteTimers are given, only the remote timers from ServerName will be removed from this list. The given list of RemoteTimers must be sorted numerically (by a call to its SortNumerically() function). Returns true if any remote timers have been added, deleted or modified.
Definition at line 1296 of file timers.c.
References Add(), cVector< T >::Append(), Del(), esyslog, cList< cTimer >::First(), GetById(), cList< cTimer >::Next(), cTimer::Parse(), cTimer::Remote(), cTimer::SetId(), cTimer::SetRemote(), cVector< T >::Size(), cStringList::SortNumerically(), and cString::sprintf().
Referenced by cSVDRPClientHandler::ProcessConnections().
Definition at line 1230 of file timers.c.
References cList< cTimer >::First(), and cList< cTimer >::Next().
|
private |
Definition at line 140 of file timers.h.
Referenced by cTimers(), and DeleteExpired().
|
staticprivate |
Definition at line 139 of file timers.h.
Referenced by NewTimerId().
|
staticprivate |
Definition at line 138 of file timers.h.
Referenced by GetTimersRead(), GetTimersWrite(), and Load().