Plaquette
 
Loading...
Searching...
No Matches
pq::AbstractTimer Class Referenceabstract
Inheritance diagram for pq::AbstractTimer:
Collaboration diagram for pq::AbstractTimer:

Public Member Functions

virtual void start ()
 Starts/restarts the chronometer.
 
virtual void start (float duration)
 Starts/restarts the chronometer with specific duration.
 
virtual void duration (float duration)
 Sets the duration of the chronometer.
 
virtual float duration () const
 Returns duration.
 
virtual float progress () const
 The progress of the timer process (in %).
 
virtual bool isFinished () const
 Returns true iff the chronometer has finished its process.
 
virtual bool isComplete () const
 
virtual void pause ()
 Interrupts the chronometer.
 
virtual void resume ()
 Resumes process.
 
virtual float elapsed () const
 The time currently elapsed by the chronometer (in seconds).
 
virtual bool hasPassed (float timeout) const
 Returns true iff elapsed time has passed given timeout.
 
virtual bool hasPassed (float timeout, bool restartIfPassed)
 
virtual void setTime (float time)
 Forces current time (in seconds).
 
virtual void addTime (float time)
 Adds/subtracts time to the chronometer.
 
virtual bool isRunning () const
 Returns true iff the chronometer is currently running.
 
bool isStarted () const
 
virtual void stop ()
 Interrupts the chronometer and resets to zero.
 
virtual void togglePause ()
 Toggles pause/unpause.
 

Protected Member Functions

 AbstractTimer (float duration)
 
virtual void update ()
 
virtual float _time () const =0
 
virtual void _setRunning (bool isRunning)
 

Protected Attributes

float _duration
 
float _invDuration
 
float _startTime
 
float _offsetTime
 
float _elapsedTime
 
bool _isRunning
 

Member Function Documentation

◆ _setRunning()

virtual void pq::AbstractChronometer::_setRunning ( bool  isRunning)
inlineprotectedvirtualinherited

Implements pq::Timeable.

◆ addTime()

void pq::AbstractChronometer::addTime ( float  time)
virtualinherited

Adds/subtracts time to the chronometer.

Implements pq::Timeable.

◆ duration() [1/2]

virtual float pq::AbstractTimer::duration ( ) const
inlinevirtual

Returns duration.

Reimplemented in pq::Ramp.

◆ duration() [2/2]

void pq::AbstractTimer::duration ( float  duration)
virtual

Sets the duration of the chronometer.

Reimplemented in pq::Ramp.

◆ hasPassed()

bool pq::AbstractChronometer::hasPassed ( float  timeout,
bool  restartIfPassed 
)
virtualinherited
Deprecated:
Returns true iff elapsed time has passed given timeout (optional argument to automatically restart if true).

◆ isComplete()

virtual bool pq::AbstractTimer::isComplete ( ) const
inlinevirtual

◆ isRunning()

virtual bool pq::AbstractChronometer::isRunning ( ) const
inlinevirtualinherited

Returns true iff the chronometer is currently running.

Implements pq::Timeable.

◆ isStarted()

bool pq::AbstractChronometer::isStarted ( ) const
inlineinherited

◆ pause()

void pq::AbstractChronometer::pause ( )
virtualinherited

Interrupts the chronometer.

Reimplemented from pq::Timeable.

◆ resume()

void pq::AbstractChronometer::resume ( )
virtualinherited

Resumes process.

Reimplemented from pq::Timeable.

◆ setTime()

void pq::AbstractChronometer::setTime ( float  time)
virtualinherited

Forces current time (in seconds).

Implements pq::Timeable.

Reimplemented in pq::Alarm, and pq::Ramp.

◆ start()

void pq::AbstractTimer::start ( )
virtual

Starts/restarts the chronometer.

Reimplemented from pq::Timeable.

Reimplemented in pq::Ramp.


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