mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
mrs_lib::internal::TimerImplInterface Class Referenceabstract

Abstract interface for timer implementations. More...

#include <timer.hpp>

Public Member Functions

 TimerImplInterface ()=default
 Default constructor.
virtual ~TimerImplInterface ()=default
 Virtual destructor.
 TimerImplInterface (const TimerImplInterface &)=delete
TimerImplInterface & operator= (const TimerImplInterface &)=delete
 TimerImplInterface (TimerImplInterface &&)=delete
TimerImplInterface & operator= (TimerImplInterface &&)=delete
virtual void stop ()=0
 Stop the timer.
virtual void start_or_reset ()=0
 Start the timer or reset its countdown.
virtual void set_period (std::chrono::nanoseconds period)=0
 Change the timer period.
virtual bool is_running () const =0
 Check whether the timer is running.

Detailed Description

Abstract interface for timer implementations.

This interface allows the public Timer class to use different timer implementations through the Pimpl idiom.

Member Function Documentation

◆ is_running()

virtual bool mrs_lib::internal::TimerImplInterface::is_running ( ) const
nodiscardpure virtual

Check whether the timer is running.

Returns
true if the timer is running, otherwise false.

◆ set_period()

virtual void mrs_lib::internal::TimerImplInterface::set_period ( std::chrono::nanoseconds period)
pure virtual

Change the timer period.

Parameters
periodNew timer period.

Implementations should reset the timer when the period is changed.


The documentation for this class was generated from the following file:
  • /home/runner/work/mrs_lib/mrs_lib/include/mrs_lib/timer.hpp