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

#include <stopwatch.hpp>

Inheritance diagram for bst::IStopwatch:
Collaboration diagram for bst::IStopwatch:

Public Member Functions

virtual ~IStopwatch ()=default
 
virtual int64_t elapsedMicroseconds () const =0
 
virtual double elapsedMicrosecondsF () const =0
 
virtual int64_t elapsedMilliseconds () const =0
 
virtual double elapsedMillisecondsF () const =0
 
virtual int64_t elapsedSeconds () const =0
 
virtual double elapsedSecondsF () const =0
 
virtual bool isRunning () const =0
 
virtual void pause ()=0
 
virtual void reset (bool stop=true)=0
 
virtual void resume ()=0
 
virtual void start ()=0
 
virtual void stop ()=0
 

Protected Types

enum class  State { RUNNING , STOPPED }
 The state of the stopwatch. More...
 

Protected Attributes

State state_ = State::STOPPED
 The state of the stopwatch. More...
 

Member Enumeration Documentation

◆ State

enum bst::IStopwatch::State
strongprotected

The state of the stopwatch.

Enumerator
RUNNING 
STOPPED 

Constructor & Destructor Documentation

◆ ~IStopwatch()

virtual bst::IStopwatch::~IStopwatch ( )
virtualdefault

Member Function Documentation

◆ start()

virtual void bst::IStopwatch::start ( )
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

Referenced by TEST().

Here is the caller graph for this function:

◆ stop()

virtual void bst::IStopwatch::stop ( )
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

Referenced by TEST().

Here is the caller graph for this function:

◆ reset()

virtual void bst::IStopwatch::reset ( bool  stop = true)
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ isRunning()

virtual bool bst::IStopwatch::isRunning ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ elapsedMicroseconds()

virtual int64_t bst::IStopwatch::elapsedMicroseconds ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ elapsedMicrosecondsF()

virtual double bst::IStopwatch::elapsedMicrosecondsF ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ elapsedMilliseconds()

virtual int64_t bst::IStopwatch::elapsedMilliseconds ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

Referenced by TEST().

Here is the caller graph for this function:

◆ elapsedMillisecondsF()

virtual double bst::IStopwatch::elapsedMillisecondsF ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ elapsedSeconds()

virtual int64_t bst::IStopwatch::elapsedSeconds ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ elapsedSecondsF()

virtual double bst::IStopwatch::elapsedSecondsF ( ) const
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ pause()

virtual void bst::IStopwatch::pause ( )
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

◆ resume()

virtual void bst::IStopwatch::resume ( )
pure virtual

Implemented in bst::SoftwareStopwatch, and bst::Stopwatch.

Member Data Documentation

◆ state_

State bst::IStopwatch::state_ = State::STOPPED
protected

The state of the stopwatch.