Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
real-clock.hpp
Go to the documentation of this file.
1/*
2 REAL-CLOCK.hpp - convenience front-end to access the system clock
3
4 Copyright (C)
5 2012, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
28#ifndef VAULT_REAL_CLOCK_H
29#define VAULT_REAL_CLOCK_H
30
31
32#include "lib/error.hpp"
34
35namespace vault {
36
37 using lib::time::Time;
40
41
46 {
47
48
49 public:
50
51 static Time
53 {
54 return Time{_readSystemTime()};
55 }
56
57 static bool
59 {
60 Offset past{event, now()};
61 return Time::ZERO <= past
62 and past < CONSIDERED_RECENT;
63 }
64
65
66 private:
69 };
70
71
72
73} // namespace vault
74#endif
Offset measures a distance in time.
basic constant internal time value.
Lumiera's internal time value datatype.
static const Time ZERO
Convenience frontend to access the current raw system time.
static TimeValue _readSystemTime()
static Time now()
static bool wasRecently(Time event)
static const Offset CONSIDERED_RECENT
events during the last ms are considered "recent" for the purpose of testing
Lumiera error handling (C++ interface).
Vault-Layer implementation namespace root.
a family of time value like entities and their relationships.