Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QTimerInfoList Class Reference

#include <qtimerinfo_unix_p.h>

+ Collaboration diagram for QTimerInfoList:

Public Types

using Duration = QAbstractEventDispatcher::Duration
 
using TimerInfo = QAbstractEventDispatcher::TimerInfoV2
 

Public Member Functions

 QTimerInfoList ()
 
std::optional< DurationtimerWait ()
 
void timerInsert (QTimerInfo *)
 
Duration remainingDuration (Qt::TimerId timerId) const
 
void registerTimer (Qt::TimerId timerId, Duration interval, Qt::TimerType timerType, QObject *object)
 
bool unregisterTimer (Qt::TimerId timerId)
 
bool unregisterTimers (QObject *object)
 
QList< TimerInforegisteredTimers (QObject *object) const
 
int activateTimers ()
 
bool hasPendingTimers ()
 
void clearTimers ()
 
bool isEmpty () const
 
qsizetype size () const
 
auto findTimerById (Qt::TimerId timerId) const
 

Public Attributes

std::chrono::steady_clock::time_point currentTime
 

Detailed Description

Definition at line 45 of file qtimerinfo_unix_p.h.

Member Typedef Documentation

◆ Duration

◆ TimerInfo

Constructor & Destructor Documentation

◆ QTimerInfoList()

QTimerInfoList::QTimerInfoList ( )
default

Member Function Documentation

◆ activateTimers()

int QTimerInfoList::activateTimers ( )

Definition at line 373 of file qtimerinfo_unix.cpp.

References QList< T >::begin(), byTimeout(), calculateNextTimeout(), QList< T >::cbegin(), QList< T >::cend(), QList< T >::constFirst(), QList< T >::end(), QTimerInfo::interval, QList< T >::isEmpty(), it, iter, now, qt_disable_lowpriority_timers, qToUnderlying(), QCoreApplication::sendEvent(), and QList< T >::size().

Referenced by QEventDispatcherUNIXPrivate::activateTimers(), QCocoaEventDispatcherPrivate::processTimers(), and timerSourceDispatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearTimers()

void QTimerInfoList::clearTimers ( )
inline

Definition at line 68 of file qtimerinfo_unix_p.h.

References qDeleteAll().

Referenced by QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findTimerById()

auto QTimerInfoList::findTimerById ( Qt::TimerId timerId) const
inline

Definition at line 78 of file qtimerinfo_unix_p.h.

Referenced by remainingDuration(), and unregisterTimer().

+ Here is the caller graph for this function:

◆ hasPendingTimers()

bool QTimerInfoList::hasPendingTimers ( )

Updates the currentTime member to the current time, and returns true if the first timer's timeout is in the future (after currentTime).

The list is sorted by timeout, thus it's enough to check the first timer only.

Definition at line 42 of file qtimerinfo_unix.cpp.

References QList< T >::at(), QList< T >::isEmpty(), and QTimerInfo::timeout.

+ Here is the call graph for this function:

◆ isEmpty()

bool QTimerInfoList::isEmpty ( ) const
inline

Definition at line 74 of file qtimerinfo_unix_p.h.

Referenced by QCocoaEventDispatcherPrivate::maybeStartCFRunLoopTimer().

+ Here is the caller graph for this function:

◆ registeredTimers()

auto QTimerInfoList::registeredTimers ( QObject * object) const

Definition at line 360 of file qtimerinfo_unix.cpp.

References QList< T >::emplaceBack(), QAbstractEventDispatcher::TimerInfoV2::interval, and list.

Referenced by QEventDispatcherWasm::timersForObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerTimer()

void QTimerInfoList::registerTimer ( Qt::TimerId timerId,
QTimerInfoList::Duration interval,
Qt::TimerType timerType,
QObject * object )

Definition at line 277 of file qtimerinfo_unix.cpp.

References calculateCoarseTimerTimeout(), Qt::CoarseTimer, currentTime, expected, Qt::PreciseTimer, roundToMillisecond(), roundToSecs(), timerInsert(), and Qt::VeryCoarseTimer.

Referenced by QEventDispatcherWasm::registerTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remainingDuration()

QTimerInfoList::Duration QTimerInfoList::remainingDuration ( Qt::TimerId timerId) const

Definition at line 259 of file qtimerinfo_unix.cpp.

References QList< T >::cend(), findTimerById(), it, now, and qWarning.

Referenced by QEventDispatcherWasm::remainingTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

qsizetype QTimerInfoList::size ( ) const
inline

Definition at line 76 of file qtimerinfo_unix_p.h.

◆ timerInsert()

void QTimerInfoList::timerInsert ( QTimerInfo * ti)

Definition at line 55 of file qtimerinfo_unix.cpp.

References byTimeout(), QList< T >::cbegin(), QList< T >::cend(), and QList< T >::insert().

Referenced by registerTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ timerWait()

std::optional< QTimerInfoList::Duration > QTimerInfoList::timerWait ( )

Definition at line 238 of file qtimerinfo_unix.cpp.

References QList< T >::cbegin(), QList< T >::cend(), it, now, and roundToMillisecond().

Referenced by QCocoaEventDispatcherPrivate::maybeStartCFRunLoopTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterTimer()

bool QTimerInfoList::unregisterTimer ( Qt::TimerId timerId)

Definition at line 320 of file qtimerinfo_unix.cpp.

References QList< T >::cend(), QList< T >::erase(), findTimerById(), and it.

Referenced by QEventDispatcherWasm::unregisterTimer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterTimers()

bool QTimerInfoList::unregisterTimers ( QObject * object)

Definition at line 337 of file qtimerinfo_unix.cpp.

References QList< T >::isEmpty(), o, and QList< T >::removeIf().

Referenced by QEventDispatcherWasm::unregisterTimers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ currentTime

std::chrono::steady_clock::time_point QTimerInfoList::currentTime
mutable

Definition at line 52 of file qtimerinfo_unix_p.h.

Referenced by registerTimer().


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