1#ifndef DRIFTINGDATETIME_H
2#define DRIFTINGDATETIME_H
4#include "TwoPhaseSignal.h"
50 DriftingDateTimeSingleton();
54 static QPointer<DriftingDateTimeSingleton> singleton;
60 void setDriftInner(qint64 ms);
78 return QDateTime::currentDateTimeUtc().addMSecs(
drift());
83 return QDateTime::currentDateTime().addMSecs(
drift());
88 return QDateTime::currentMSecsSinceEpoch() +
drift();
122inline qint64 drift() {
136inline QDateTime currentDateTimeUtc() {
140inline QDateTime currentDateTimeLocal() {
144inline qint64 currentMSecsSinceEpoch() {
148inline qint64 currentSecsSinceEpoch() {
QDateTime currentDateTimeLocal() const
Definition DriftingDateTime.h:82
void driftChanged(qint64 new_drift) const
void onPlumbingCompleted() const
Emits to the driftChanged signal (as per TwoPhaseSignal contract).
Definition DriftingDateTime.cpp:79
void setDrift(qint64 ms)
Set the drift.
Definition DriftingDateTime.cpp:61
QDateTime currentDateTimeUtc() const
Definition DriftingDateTime.h:77
qint64 drift() const
Retrieve drift, in milliseconds.
Definition DriftingDateTime.cpp:41
static DriftingDateTimeSingleton & getSingleton()
Get the singleton instance.
Definition DriftingDateTime.cpp:19
qint64 currentSecsSinceEpoch() const
Definition DriftingDateTime.h:99
qint64 currentMSecsSinceEpoch() const
Definition DriftingDateTime.h:87
TwoPhaseSignal()
This is a humble helper class for Qt signals and slots when this mechanism is also used to initialize...
Definition TwoPhaseSignal.cpp:11
Definition DriftingDateTime.h:121
void setDrift(qint64 ms)
Definition DriftingDateTime.h:132