LibreOffice: salhelper::Timer Class Reference

LibreOffice LibreOffice 26.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
salhelper::Timer Class Referenceabstract

Interface for the Timer and handling the event. More...

`#include <timer.hxx>`

Inheritance diagram for salhelper::Timer:

## Public Member Functions
| Timer ()
| Constructor.
| Timer (const TTimeValue &Time)
| Constructor.
| Timer (const TTimeValue &Time, const TTimeValue &RepeatTime)
| Constructor.
void | start ()
| Start timer.
void | stop ()
| Abort timer prematurely.
sal_Bool | isTicking () const
| Returns sal_True if timer is running.
sal_Bool | isExpired () const
| Is the timer expired?
sal_Bool | expiresBefore (const Timer *pTimer) const
| Does pTimer expires before us?
void | setAbsoluteTime (const TTimeValue &Time)
| Set the absolute time when the timer should fire.
void | setRemainingTime (const TTimeValue &Remaining)
| Set the time to fire to 'now' + Remaining.
void | setRemainingTime (const TTimeValue &Remaining, const TTimeValue &Repeat)
| Set the time to fire to 'now' + Remaining with repeat interveal Repeat.
void | addTime (const TTimeValue &Time)
| Adds Time to the 'fire time'.
TTimeValue | getRemainingTime () const
| Returns the remaining time before timer expiration relative to now.
Public Member Functions inherited from salhelper::SimpleReferenceObject
| SimpleReferenceObject ()
void | acquire ()
void | release ()

## Static Public Member Functions
static void | joinThread ()
| Internal method to shutdown the timer thread.
static void | startThread ()
| Internal method to re-start the timer thread if necessary.
Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * | operator new (std::size_t nSize)
| see general class documentation
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
| see general class documentation
static void | operator delete (void *pPtr)
| see general class documentation
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow)
| see general class documentation

## Protected Member Functions
virtual | ~Timer () SAL_OVERRIDE
| Destructor.
virtual void | onShot ()=0
| What should be done when the 'timer fires'.
Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
void | staticize ()
| mark reference count as not to be touched, and the related object as having an indefinite lifespan.

## Protected Attributes
TTimeValue | m_aTimeOut
| holds (initial) expiration time of this timer.
TTimeValue | m_aExpired
| holds the time of expiration of this timer.
TTimeValue | m_aRepeatDelta
| holds the time interveal of successive expirations.
Timer * | m_pNext
| Pointer to the next timer (to fire).
Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount | m_nCount

## Friends
class | TimerManager

## Detailed Description

Interface for the Timer and handling the event.

## Constructor & Destructor Documentation

## ◆ Timer() [1/3]

salhelper::Timer::Timer | ( |  | ) |

Constructor.

## ◆ Timer() [2/3]

salhelper::Timer::Timer | ( | const TTimeValue & | Time | ) |

Constructor.

## ◆ Timer() [3/3]

salhelper::Timer::Timer | ( | const TTimeValue & | Time,
|  | const TTimeValue & | RepeatTime )

Constructor.

## ◆ ~Timer()

virtual salhelper::Timer::~Timer | ( |  | ) |
| protectedvirtual

Destructor.

## Member Function Documentation

## ◆ addTime()

void salhelper::Timer::addTime | ( | const TTimeValue & | Time | ) |

Adds Time to the 'fire time'.

## ◆ expiresBefore()

sal_Bool salhelper::Timer::expiresBefore | ( | const Timer * | pTimer | ) | const

Does pTimer expires before us?

## ◆ getRemainingTime()

TTimeValue salhelper::Timer::getRemainingTime | ( |  | ) | const

Returns the remaining time before timer expiration relative to now.

## ◆ isExpired()

sal_Bool salhelper::Timer::isExpired | ( |  | ) | const

Is the timer expired?

## ◆ isTicking()

sal_Bool salhelper::Timer::isTicking | ( |  | ) | const

Returns sal_True if timer is running.

## ◆ joinThread()

void salhelper::Timer::joinThread | ( |  | ) |
| static

Internal method to shutdown the timer thread.

## ◆ onShot()

virtual void salhelper::Timer::onShot | ( |  | ) |
| protectedpure virtual

What should be done when the 'timer fires'.

## ◆ setAbsoluteTime()

void salhelper::Timer::setAbsoluteTime | ( | const TTimeValue & | Time | ) |

Set the absolute time when the timer should fire.

## ◆ setRemainingTime() [1/2]

void salhelper::Timer::setRemainingTime | ( | const TTimeValue & | Remaining | ) |

Set the time to fire to 'now' + Remaining.

## ◆ setRemainingTime() [2/2]

void salhelper::Timer::setRemainingTime | ( | const TTimeValue & | Remaining,
|  | const TTimeValue & | Repeat )

Set the time to fire to 'now' + Remaining with repeat interveal Repeat.

## ◆ start()

void salhelper::Timer::start | ( |  | ) |

Start timer.

## ◆ startThread()

void salhelper::Timer::startThread | ( |  | ) |
| static

Internal method to re-start the timer thread if necessary.

## ◆ stop()

void salhelper::Timer::stop | ( |  | ) |

Abort timer prematurely.

## Friends And Related Symbol Documentation

## ◆ TimerManager

friend class TimerManager
| friend

## Member Data Documentation

## ◆ m_aExpired

TTimeValue salhelper::Timer::m_aExpired
| protected

holds the time of expiration of this timer.

## ◆ m_aRepeatDelta

TTimeValue salhelper::Timer::m_aRepeatDelta
| protected

holds the time interveal of successive expirations.

## ◆ m_aTimeOut

TTimeValue salhelper::Timer::m_aTimeOut
| protected

holds (initial) expiration time of this timer.

## ◆ m_pNext

Timer* salhelper::Timer::m_pNext
| protected

Pointer to the next timer (to fire).

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

- salhelper/timer.hxx