17 #ifndef COM_BORA_SOFTWARE__BALAU_SYSTEM__SYSTEM_CLOCK 18 #define COM_BORA_SOFTWARE__BALAU_SYSTEM__SYSTEM_CLOCK 33 public: std::chrono::system_clock::time_point
now()
const override {
34 return std::chrono::system_clock::now();
37 public: Date::year_month_day
today()
const override {
38 return Date::year_month_day {
39 Date::floor<Date::days>(std::chrono::system_clock::now())
43 public: std::chrono::nanoseconds
nanotime()
const override {
44 return std::chrono::duration_cast<std::chrono::nanoseconds>(
45 std::chrono::system_clock::now().time_since_epoch()
49 public: std::chrono::milliseconds
millitime()
const override {
50 return std::chrono::duration_cast<std::chrono::milliseconds>(
51 std::chrono::system_clock::now().time_since_epoch()
55 public: std::chrono::centiseconds
centitime()
const override {
56 return std::chrono::duration_cast<std::chrono::centiseconds>(
57 std::chrono::system_clock::now().time_since_epoch()
61 public: std::chrono::deciseconds
decitime()
const override {
62 return std::chrono::duration_cast<std::chrono::deciseconds>(
63 std::chrono::system_clock::now().time_since_epoch()
70 #endif // COM_BORA_SOFTWARE__BALAU_SYSTEM__SYSTEM_CLOCK virtual std::chrono::system_clock::time_point now() const =0
Get the current time point.
The default implementation of the clock API.
Definition: SystemClock.hpp:30
Base interface of clocks.
Definition: Clock.hpp:47
Injection macros used in injectable classes.
virtual std::chrono::deciseconds decitime() const =0
Get the current time in deciseconds since the unix epoch.
virtual std::chrono::milliseconds millitime() const =0
Get the current time in milliseconds since the unix epoch.
#define BalauInject(...)
Annotate an injectable class by specifying the class name and its direct or indirect dependency field...
Definition: Injectable.hpp:26
virtual std::chrono::centiseconds centitime() const =0
Get the current time in centiseconds since the unix epoch.
virtual std::chrono::nanoseconds nanotime() const =0
Get the current time in nanoseconds since the unix epoch.
virtual Date::year_month_day today() const =0
Get the current date.
Base interface of clocks.
System utilities and wrappers.
Definition: HttpServerConfiguration.hpp:30