My Project
Public Member Functions | Protected Member Functions | List of all members
core::Timer Class Referenceabstract

#include <Timer.h>

Inheritance diagram for core::Timer:
Inheritance graph
[legend]
Collaboration diagram for core::Timer:
Collaboration graph
[legend]

Public Member Functions

 Timer (EPoll &ePoll)
 
 Timer (EPoll &ePoll, double delay)
 
void setTimer (double delay)
 
void clearTimer ()
 
double getElapsed ()
 
double getEpoch ()
 

Protected Member Functions

virtual void onTimeout ()=0
 

Detailed Description

Timer

Set and trigger callback upon specified timeout.

The Timer is used to establish a timer using the timer socket interface. It cannot be instantiated directly but must be extended.

Member Function Documentation

◆ clearTimer()

void core::Timer::clearTimer ( )

Use the clearTimer() to unset the timer and return the timer to an idle state.

◆ getElapsed()

double core::Timer::getElapsed ( )

Use the getElapsed() method to obtain the amount of time that has elapsed since the timer was set.

◆ onTimeout()

virtual void core::Timer::onTimeout ( )
protectedpure virtual

This method is called when the time out occurs.

◆ setTimer()

void core::Timer::setTimer ( double  delay)

Use the setTimer() method to set the time out value for timer. Setting the timer also starts the timer countdown. The clearTimer() method can be used to reset the timer without triggering the onTimeout() callback.

Parameters
delaythe amount of time in seconds to wait before trigering the onTimeout function.

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