42 explicit TimeSpec(
const timespec& ts);
63 TimeSpec& operator=(
const timespec& ts);
73 explicit operator bool()
const;
83 bool operator>=(
const timespec& ts)
const;
88 bool operator>(
const timespec& ts)
const;
93 bool operator<(
const timespec& ts)
const;
98 bool operator<=(
const timespec& ts)
const;
108 bool operator!=(
const timespec& ts)
const;
273 : timespec{sec, nsec}
283 return tv_sec || tv_nsec;
286inline TimeSpec::operator bool()
const
288 return tv_sec || tv_nsec;
339 return add(0, -nsec);
sf::TimeSpec operator+(const timespec &lhs, const timespec &rhs)
Addition operator for std::timespec types which also work for sf::TimeSpec.
Definition TimeSpec.h:370
std::ostream & operator<<(std::ostream &os, const sf::TimeSpec &ts)
Operator for writing the sf::TimeSpec to an output-stream.
Definition TimeSpec.h:393
sf::TimeSpec operator-(const timespec &lhs, const timespec &rhs)
Subtraction operator for std::timespec types which also work for sf::TimeSpec.
Definition TimeSpec.h:381
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
_MISC_FUNC int timespecCompare(const timespec &ts1, const timespec &ts2)
Compares the 2 'timespec' time structures. Helper function.
_MISC_FUNC bool operator==(const Md5Hash::hash_type &h1, const Md5Hash::hash_type &h2)
Compare operator for storing an MD5 hash.
bool isZero(T value, T epsilon=std::numeric_limits< T >::epsilon())
Check if the passed value is zero or near zero according the given epsilon.
Definition misc/gen/math.h:245
QRect operator+=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:66
QRect operator-=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:83
Class wrapper for timespec structure to modify.
Definition TimeSpec.h:12
TimeSpec operator-(const timespec &t) const
Operator to add another timespec.
Definition TimeSpec.h:357
TimeSpec & assign(const timespec &ts)
Assigns a timespec base type.
TimeSpec & add(time_t sec, nsec_type nsec)
Adds seconds and nanoseconds to the current value.
void clear()
clear this instance.
Definition TimeSpec.h:291
bool operator>=(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:297
TimeSpec()
Default constructor.
Definition TimeSpec.h:252
TimeSpec & operator=(TimeSpec &&)=default
Move assignment operator is default.
TimeSpec operator+(const timespec &t) const
Operator to add another timespec.
Definition TimeSpec.h:352
bool operator==(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:317
std::string toString() const
Returns the time as toDouble() result converted to a string.
TimeSpec & randomize(double factor=0.1)
Modifies the current value using the passed factor where 0.1 is + or - 10%.
bool operator<(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:307
TimeSpec & setTimeOfDay()
assign the current time.
double toDouble() const
Gets the time value as a double.
bool isZero() const
Test if it has been set and thus not-zero.
Definition TimeSpec.h:281
bool operator>(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:302
TimeSpec & operator-=(nsec_type nsec)
Operator to add nanoseconds.
Definition TimeSpec.h:337
bool operator!=(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:322
long nsec_type
Integer type to indicate nanoseconds.
Definition TimeSpec.h:17
TimeSpec & assign(time_t sec, nsec_type nsec)
Assigns seconds and nanoseconds to the current value.
time_t toMilliSecs() const
Gets the time value as a double.
bool operator<=(const timespec &ts) const
Compare operator.
Definition TimeSpec.h:312
TimeSpec & add(const timespec &ts)
Adds a timespec base type to the current value.
TimeSpec & assign(double sec)
Assigns a double as seconds.
TimeSpec(TimeSpec &&ts)=default
Move constructor.
TimeSpec & sub(const timespec &ts)
Subtracts a timespec base type from the current value.
TimeSpec & operator+=(nsec_type nsec)
Operator to add nanoseconds.
Definition TimeSpec.h:332