BoosterSeat  0.1
A C++ library that includes common utilities that are used in other projects.
bst::ITimer Class Referenceabstract

Interface for a timer class. More...

#include <timer.hpp>

Inheritance diagram for bst::ITimer:
Collaboration diagram for bst::ITimer:

Public Member Functions

virtual ~ITimer ()=default
 Destructor. More...
 
virtual bool isDone () const =0
 Check if the timer has expired. More...
 
virtual void reset ()=0
 Reset the timer to the current time. More...
 
virtual void setDone ()=0
 Set the timer to be done. Changes the start time. More...
 
virtual void setTimeout (int timeout_ms)=0
 Set the timeout of the timer. Does not reset the timer. More...
 

Detailed Description

Interface for a timer class.

Constructor & Destructor Documentation

◆ ~ITimer()

virtual bst::ITimer::~ITimer ( )
virtualdefault

Destructor.

Member Function Documentation

◆ reset()

virtual void bst::ITimer::reset ( )
pure virtual

Reset the timer to the current time.

Implemented in bst::SoftwareTimer, and bst::Timer.

◆ isDone()

virtual bool bst::ITimer::isDone ( ) const
pure virtual

Check if the timer has expired.

Implemented in bst::SoftwareTimer, and bst::Timer.

◆ setTimeout()

virtual void bst::ITimer::setTimeout ( int  timeout_ms)
pure virtual

Set the timeout of the timer. Does not reset the timer.

Todo:
Change to size_t

Implemented in bst::SoftwareTimer, and bst::Timer.

◆ setDone()

virtual void bst::ITimer::setDone ( )
pure virtual

Set the timer to be done. Changes the start time.

Implemented in bst::SoftwareTimer, and bst::Timer.