BMA Server Framework
Public Member Functions | Protected Member Functions | List of all members
BMATimer Class Referenceabstract

#include <BMATimer.h>

Inheritance diagram for BMATimer:
Inheritance graph
[legend]
Collaboration diagram for BMATimer:
Collaboration graph
[legend]

Public Member Functions

 BMATimer (BMAEPoll &ePoll)
 
 BMATimer (BMAEPoll &ePoll, double delay)
 
void setTimer (double delay)
 
void clearTimer ()
 
double getElapsed ()
 
double getEpoch ()
 

Protected Member Functions

virtual void onTimeout ()=0
 

Detailed Description

BMATimer

Set and trigger callback upon specified timeout.

The BMATimer 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 BMATimer::clearTimer ( )

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

◆ getElapsed()

double BMATimer::getElapsed ( )

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

◆ onTimeout()

virtual void BMATimer::onTimeout ( )
protectedpure virtual

This method is called when the time out occurs.

◆ setTimer()

void BMATimer::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: