LibreOffice Module salhelper (master) 1
|
Interface for the Timer and handling the event. More...
#include <timer.hxx>
Public Member Functions | |
Timer () | |
Constructor. More... | |
Timer (const TTimeValue &Time) | |
Constructor. More... | |
Timer (const TTimeValue &Time, const TTimeValue &RepeatTime) | |
Constructor. More... | |
void SAL_CALL | start () |
Start timer. More... | |
void SAL_CALL | stop () |
Abort timer prematurely. More... | |
sal_Bool SAL_CALL | isTicking () const |
Returns sal_True if timer is running. More... | |
sal_Bool SAL_CALL | isExpired () const |
Is the timer expired? More... | |
sal_Bool SAL_CALL | expiresBefore (const Timer *pTimer) const |
Does pTimer expires before us? More... | |
void SAL_CALL | setAbsoluteTime (const TTimeValue &Time) |
Set the absolute time when the timer should fire. More... | |
void SAL_CALL | setRemainingTime (const TTimeValue &Remaining) |
Set the time to fire to 'now' + Remaining. More... | |
void SAL_CALL | setRemainingTime (const TTimeValue &Remaining, const TTimeValue &Repeat) |
Set the time to fire to 'now' + Remaining with repeat interveal Repeat. More... | |
void SAL_CALL | addTime (const TTimeValue &Time) |
Adds Time to the 'fire time'. More... | |
TTimeValue SAL_CALL | getRemainingTime () const |
Returns the remaining time before timer expiration relative to now. More... | |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Protected Member Functions | |
virtual | ~Timer () SAL_OVERRIDE |
Destructor. More... | |
virtual void SAL_CALL | onShot ()=0 |
What should be done when the 'timer fires'. More... | |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Protected Attributes | |
TTimeValue | m_aTimeOut |
holds (initial) expiration time of this timer. More... | |
TTimeValue | m_aExpired |
holds the time of expiration of this timer. More... | |
TTimeValue | m_aRepeatDelta |
holds the time interveal of successive expirations. More... | |
Timer * | m_pNext |
Pointer to the next timer (to fire). More... | |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
Private Member Functions | |
Timer (const Timer &rTimer) SAL_DELETED_FUNCTION | |
Copy constructor deleted. More... | |
void SAL_CALL | operator= (const Timer &rTimer) SAL_DELETED_FUNCTION |
Copy assignment operator deleted. More... | |
Friends | |
class | TimerManager |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
see general class documentation More... | |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
see general class documentation More... | |
static void | operator delete (void *pPtr) |
see general class documentation More... | |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
see general class documentation More... | |
Timer::Timer | ( | const TTimeValue & | Time | ) |
Timer::Timer | ( | const TTimeValue & | Time, |
const TTimeValue & | RepeatTime | ||
) |
|
protectedvirtual |
|
private |
Copy constructor deleted.
void Timer::addTime | ( | const TTimeValue & | Time | ) |
Adds Time to the 'fire time'.
Definition at line 163 of file timer.cxx.
References salhelper::TTimeValue::addTime(), Delta, and m_aExpired.
Does pTimer expires before us?
Definition at line 130 of file timer.cxx.
References m_aExpired.
Referenced by salhelper::TimerManager::registerTimer().
TTimeValue Timer::getRemainingTime | ( | ) | const |
Returns the remaining time before timer expiration relative to now.
Definition at line 168 of file timer.cxx.
References m_aExpired.
Referenced by salhelper::TimerManager::run().
sal_Bool Timer::isExpired | ( | ) | const |
Is the timer expired?
Definition at line 121 of file timer.cxx.
References m_aExpired.
Referenced by salhelper::TimerManager::checkForTimeout().
sal_Bool Timer::isTicking | ( | ) | const |
|
protectedpure virtual |
What should be done when the 'timer fires'.
Referenced by salhelper::TimerManager::checkForTimeout().
|
private |
Copy assignment operator deleted.
void Timer::setAbsoluteTime | ( | const TTimeValue & | Time | ) |
Set the absolute time when the timer should fire.
Definition at line 138 of file timer.cxx.
References m_aExpired, m_aRepeatDelta, m_aTimeOut, salhelper::TTimeValue::normalize(), and Time.
void Timer::setRemainingTime | ( | const TTimeValue & | Remaining | ) |
Set the time to fire to 'now' + Remaining.
Definition at line 147 of file timer.cxx.
References salhelper::TTimeValue::addTime(), and m_aExpired.
Referenced by start().
void Timer::setRemainingTime | ( | const TTimeValue & | Remaining, |
const TTimeValue & | Repeat | ||
) |
Set the time to fire to 'now' + Remaining with repeat interveal Repeat.
Definition at line 154 of file timer.cxx.
References salhelper::TTimeValue::addTime(), m_aExpired, m_aRepeatDelta, and Repeat.
void Timer::start | ( | ) |
Start timer.
Definition at line 100 of file timer.cxx.
References salhelper::TTimeValue::isEmpty(), isTicking(), m_aTimeOut, and setRemainingTime().
void Timer::stop | ( | ) |
|
friend |
|
protected |
holds the time of expiration of this timer.
Definition at line 198 of file timer.hxx.
Referenced by addTime(), salhelper::TimerManager::checkForTimeout(), expiresBefore(), getRemainingTime(), isExpired(), setAbsoluteTime(), and setRemainingTime().
|
protected |
holds the time interveal of successive expirations.
Definition at line 202 of file timer.hxx.
Referenced by salhelper::TimerManager::checkForTimeout(), setAbsoluteTime(), and setRemainingTime().
|
protected |
holds (initial) expiration time of this timer.
Definition at line 194 of file timer.hxx.
Referenced by setAbsoluteTime(), and start().
|
protected |
Pointer to the next timer (to fire).
Definition at line 206 of file timer.hxx.
Referenced by salhelper::TimerManager::checkForTimeout(), salhelper::TimerManager::lookupTimer(), salhelper::TimerManager::registerTimer(), and salhelper::TimerManager::unregisterTimer().