BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
IncompleteTimestamp.h
1 #pragma once
2 
3 #include <ostream>
4 
5 #include <Poco/Timespan.h>
6 #include <Poco/Timestamp.h>
7 
8 #include "util/Incomplete.h"
9 
10 namespace BeeeOn {
11 
13  // Thu Jan 1 01:00:00 CET 2015
14  static const unsigned long TOO_OLD = 1420070400UL;
15 
16  bool operator ()(const Poco::Timestamp &t) const
17  {
18  static const Poco::Timestamp tooOld(
19  Poco::Timestamp::fromEpochTime(TOO_OLD));
20 
21  return t > tooOld;
22  }
23 };
24 
26  Poco::Timestamp operator ()(const Poco::Timestamp &t) const
27  {
28  return m_now - m_uptime + t.epochMicroseconds();
29  }
30 
31  Poco::Timespan m_uptime;
32  Poco::Timestamp m_now;
33 };
34 
38 typedef Incomplete<
41 
42 }
Definition: IncompleteTimestamp.h:12
Definition: IncompleteTimestamp.h:25
Definition: Incomplete.h:11