Public Member Functions | List of all members
Clock Class Referenceabstract

Base interface of clocks. More...

#include <Clock.hpp>

Inheritance diagram for Clock:
[legend]

Public Member Functions

virtual std::chrono::centiseconds centitime () const =0
 Get the current time in centiseconds since the unix epoch. More...
 
virtual std::chrono::deciseconds decitime () const =0
 Get the current time in deciseconds since the unix epoch. More...
 
virtual std::chrono::milliseconds millitime () const =0
 Get the current time in milliseconds since the unix epoch. More...
 
virtual std::chrono::nanoseconds nanotime () const =0
 Get the current time in nanoseconds since the unix epoch. More...
 
virtual std::chrono::system_clock::time_point now () const =0
 Get the current time point. More...
 
virtual Date::year_month_day today () const =0
 Get the current date. More...
 

Detailed Description

Base interface of clocks.

This interface is both a convenient API for clock functions, but is more importantly a way to inject a test clock that can be manipulated from within test methods in order to simulate changes in time.

The clock API uses both std::chrono and the HH date library.

Todo:
Add more clock functionality.

Member Function Documentation

◆ centitime()

virtual std::chrono::centiseconds centitime ( ) const
pure virtual

Get the current time in centiseconds since the unix epoch.

◆ decitime()

virtual std::chrono::deciseconds decitime ( ) const
pure virtual

Get the current time in deciseconds since the unix epoch.

◆ millitime()

virtual std::chrono::milliseconds millitime ( ) const
pure virtual

Get the current time in milliseconds since the unix epoch.

◆ nanotime()

virtual std::chrono::nanoseconds nanotime ( ) const
pure virtual

Get the current time in nanoseconds since the unix epoch.

◆ now()

virtual std::chrono::system_clock::time_point now ( ) const
pure virtual

Get the current time point.

◆ today()

virtual Date::year_month_day today ( ) const
pure virtual

Get the current date.


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