LibreOffice Module salhelper (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
salhelper::Timer Class Referenceabstract

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

#include <timer.hxx>

Inheritance diagram for salhelper::Timer:
[legend]
Collaboration diagram for salhelper::Timer:
[legend]

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...
 
Timerm_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...
 

Detailed Description

Interface for the Timer and handling the event.

Definition at line 123 of file timer.hxx.

Constructor & Destructor Documentation

◆ Timer() [1/4]

Timer::Timer ( )

Constructor.

Definition at line 71 of file timer.cxx.

◆ Timer() [2/4]

Timer::Timer ( const TTimeValue Time)

Constructor.

Definition at line 79 of file timer.cxx.

◆ Timer() [3/4]

Timer::Timer ( const TTimeValue Time,
const TTimeValue RepeatTime 
)

Constructor.

Definition at line 87 of file timer.cxx.

References Repeat.

◆ ~Timer()

Timer::~Timer ( )
protectedvirtual

Destructor.

Definition at line 95 of file timer.cxx.

References stop().

◆ Timer() [4/4]

salhelper::Timer::Timer ( const Timer rTimer)
private

Copy constructor deleted.

Member Function Documentation

◆ addTime()

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.

◆ expiresBefore()

sal_Bool Timer::expiresBefore ( const Timer pTimer) const

Does pTimer expires before us?

Definition at line 130 of file timer.cxx.

References m_aExpired.

Referenced by salhelper::TimerManager::registerTimer().

◆ getRemainingTime()

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().

◆ isExpired()

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().

◆ isTicking()

sal_Bool Timer::isTicking ( ) const

Returns sal_True if timer is running.

Definition at line 116 of file timer.cxx.

Referenced by start().

◆ onShot()

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

What should be done when the 'timer fires'.

Referenced by salhelper::TimerManager::checkForTimeout().

◆ operator=()

void SAL_CALL salhelper::Timer::operator= ( const Timer rTimer)
private

Copy assignment operator deleted.

◆ setAbsoluteTime()

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.

◆ setRemainingTime() [1/2]

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().

◆ setRemainingTime() [2/2]

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.

◆ start()

void Timer::start ( )

Start timer.

Definition at line 100 of file timer.cxx.

References salhelper::TTimeValue::isEmpty(), isTicking(), m_aTimeOut, and setRemainingTime().

◆ stop()

void Timer::stop ( )

Abort timer prematurely.

Definition at line 111 of file timer.cxx.

Referenced by ~Timer().

Friends And Related Function Documentation

◆ TimerManager

friend class TimerManager
friend

Definition at line 218 of file timer.hxx.

Member Data Documentation

◆ m_aExpired

TTimeValue salhelper::Timer::m_aExpired
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().

◆ m_aRepeatDelta

TTimeValue salhelper::Timer::m_aRepeatDelta
protected

holds the time interveal of successive expirations.

Definition at line 202 of file timer.hxx.

Referenced by salhelper::TimerManager::checkForTimeout(), setAbsoluteTime(), and setRemainingTime().

◆ m_aTimeOut

TTimeValue salhelper::Timer::m_aTimeOut
protected

holds (initial) expiration time of this timer.

Definition at line 194 of file timer.hxx.

Referenced by setAbsoluteTime(), and start().

◆ m_pNext

Timer* salhelper::Timer::m_pNext
protected

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