23#if defined(__linux__) || defined(__APPLE__)
29#include "OnixS/Eurex/Trading/Export.h"
38typedef unsigned __int64 AbsoluteHighResolutionTimeImpl;
40typedef __int64 RelativeHighResolutionTimeImpl;
42#elif defined(__linux__) || defined(__APPLE__)
44typedef timeval AbsoluteHighResolutionTimeImpl;
47typedef timeval RelativeHighResolutionTimeImpl;
50# error High resolution time services are not defined for a given platform.
138#if defined(__linux__) || defined(__APPLE__)
153 AbsoluteHighResolutionTimeImpl asAbsolute;
154 RelativeHighResolutionTimeImpl asRelative;
160 HighResolutionTime(ValueKind kind);
165 return !(Invalid == kind_);
Miscellaneous time traits.
bool operator==(const HighResolutionTime &) const
Compares two timestamps for equality.
static HighResolutionTime parse(const std::string &time)
Returns time from its string presentation.
std::string toString() const
Returns canonical presentation of time.
void setToNow()
Updates to current time.
HighResolutionTimeSpan operator-(const HighResolutionTime &) const
Returns difference between two times in microseconds.
bool isValid() const
Indicates whether the instance is valid time.
friend struct TimestampHelpers
static HighResolutionTime createFromRelative(RelativeHighResolutionTimeImpl value)
Returns time created from relative value.
HighResolutionTime & operator=(const HighResolutionTime &)
Reinitializes from the other instance.
HighResolutionTime(const HighResolutionTimeFields &)
Initializes from the given set of time attributes.
HighResolutionTime(const HighResolutionTime &)
Initializes from the other instance.
HighResolutionTime(UInt64)
Initializes from given number of milliseconds since Jan 1st, 1970, 00:00:00 GMT.
static HighResolutionTime now()
Returns current time.
void getFields(HighResolutionTimeFields *fields) const
Extracts details like year, month, seconds, etc.
bool operator!=(const HighResolutionTime &) const
Compares two timestamps for inequality.
HighResolutionTime()
Initializes as not valid.
std::ostream & operator<<(std::ostream &, const ConnectionStateChange &)
Make it printable to formatted C++ I/O streams.
long long HighResolutionTimeSpan
AbsoluteHighResolutionTimeImpl Timestamp
Alias for raw timestamps.
unsigned long long UInt64
Fields of HighResolutionTime.
void fromAbsolute(const AbsoluteHighResolutionTimeImpl &)
From absolute.
void fromString(const std::string &)
Parse from string.
std::string toString() const
Returns string representation.
void toAbsolute(AbsoluteHighResolutionTimeImpl *) const
To absolute.
HighResolutionTimeFields()
Default constructor.
unsigned int microseconds