Kagome
Polkadot Runtime Engine in C++17
kagome::clock::Clock< ClockType > Class Template Referenceabstract

#include <clock.hpp>

Inheritance diagram for kagome::clock::Clock< ClockType >:
Collaboration diagram for kagome::clock::Clock< ClockType >:

Public Types

using Duration = typename ClockType::duration
 
using TimePoint = typename ClockType::time_point
 

Public Member Functions

virtual ~Clock ()=default
 
virtual TimePoint now () const =0
 
virtual uint64_t nowUint64 () const =0
 

Static Public Member Functions

static TimePoint zero ()
 

Detailed Description

template<typename ClockType>
class kagome::clock::Clock< ClockType >

An interface for a clock

Template Parameters
clocktype is an underlying clock type, such as std::steady_clock

Definition at line 18 of file clock.hpp.

Member Typedef Documentation

template<typename ClockType>
using kagome::clock::Clock< ClockType >::Duration = typename ClockType::duration

Difference between two time points

Definition at line 23 of file clock.hpp.

template<typename ClockType>
using kagome::clock::Clock< ClockType >::TimePoint = typename ClockType::time_point

A moment in time, stored in milliseconds since Unix epoch start

Definition at line 27 of file clock.hpp.

Constructor & Destructor Documentation

template<typename ClockType>
virtual kagome::clock::Clock< ClockType >::~Clock ( )
virtualdefault

Member Function Documentation

template<typename ClockType>
virtual TimePoint kagome::clock::Clock< ClockType >::now ( ) const
pure virtual
Returns
a time point representing the current time

Implemented in kagome::clock::ClockImpl< ClockType >.

template<typename ClockType>
virtual uint64_t kagome::clock::Clock< ClockType >::nowUint64 ( ) const
pure virtual
Returns
uint64_t representing number of seconds since the beginning of epoch (Jan 1, 1970)

Implemented in kagome::clock::ClockImpl< ClockType >.

template<typename ClockType>
static TimePoint kagome::clock::Clock< ClockType >::zero ( )
inlinestatic

Definition at line 42 of file clock.hpp.


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