30 #ifndef INCLUDED_TimeValueC_h_GUID_A02C6917_124D_4CB3_E63E_07F2DA7144E9
31 #define INCLUDED_TimeValueC_h_GUID_A02C6917_124D_4CB3_E63E_07F2DA7144E9
37 #include <osvr/Util/Export.h>
38 #include <osvr/Util/PlatformConfig.h>
88 #ifdef OSVR_HAVE_STRUCT_TIMEVAL
91 OSVR_FUNC_NONNULL((1));
103 OSVR_UTIL_EXPORT
void
106 OSVR_FUNC_NONNULL((1, 2));
117 OSVR_UTIL_EXPORT
void
119 OSVR_IN_PTR
const struct timeval *src)
120 OSVR_FUNC_NONNULL((1, 2));
131 OSVR_FUNC_NONNULL((1));
144 OSVR_FUNC_NONNULL((1, 2));
158 OSVR_UTIL_EXPORT
void
161 OSVR_FUNC_NONNULL((1, 2));
171 OSVR_FUNC_NONNULL((1, 2));
200 return ((tvA->seconds > tvB->seconds) ||
201 ((tvA->seconds == tvB->seconds) &&
202 (tvA->microseconds > tvB->microseconds)))
214 #ifdef _LIBCPP_VERSION
232 "First timevalue argument to comparison was not normalized!");
234 "Second timevalue argument to comparison was not normalized!");
254 "First timevalue argument to equality comparison was not normalized!");
257 "Second timevalue argument to equality comparison was not normalized!");
264 "inequality comparison was not "
267 "inequality comparison was not "
OSVR_EXTERN_C_END double osvrTimeValueDurationSeconds(const OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
Compute the difference between the two time values, returning the duration as a double-precision floa...
bool operator!=(Surface const &lhs, Surface const &rhs)
Inequality operator for clientkit::Surface.
uint8_t OSVR_CBool
A pre-C99-safe bool type. Canonical values for true and false are provided. Interpretation of other v...
bool operator==(Surface const &lhs, Surface const &rhs)
Equality operator for clientkit::Surface.
#define OSVR_FALSE
Canonical "false" value for OSVR_CBool.
OSVR_CBool osvrTimeValueGreater(const OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
True if A is later than B.
bool operator>(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB)
Operator > overload for time values.
Header providing a C-safe "bool" type, because we can't depend on Visual Studio providing proper C99 ...
Header wrapping the C99 standard stdint header.
bool osvrTimeValueIsNormalized(const OSVR_TimeValue &tv)
Returns true if the time value is normalized. Typically used in assertions.
void osvrTimeValueGetNow(OSVR_TimeValue *dest)
Gets the current time in the TimeValue. Parallel to gettimeofday.
int32_t OSVR_TimeValue_Microseconds
The signed integer type storing the microseconds in a struct OSVR_TimeValue.
#define OSVR_TRUE
Canonical "true" value for OSVR_CBool.
void osvrTimeValueToStructTimeval(struct timeval *dest, const OSVR_TimeValue *src)
Converts from a TimeValue struct to your system's struct timeval.
int64_t OSVR_TimeValue_Seconds
The signed integer type storing the seconds in a struct OSVR_TimeValue.
void osvrTimeValueDifference(OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
Computes the difference between two time values, replacing the first with the result.
Header providing basic C macros for defining API headers.
void osvrStructTimevalToTimeValue(OSVR_TimeValue *dest, const struct timeval *src)
Converts from a TimeValue struct to your system's struct timeval.
OSVR_TimeValue_Microseconds microseconds
Microseconds portion of the time value.
Header containing macros for source-level annotation.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
void osvrTimeValueSum(OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
Sums two time values, replacing the first with the result.
int osvrTimeValueCmp(const OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
Compares two time values (assumed to be normalized), returning the same values as strcmp...
struct OSVR_TimeValue OSVR_TimeValue
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
void osvrTimeValueNormalize(OSVR_TimeValue *tv)
"Normalizes" a time value so that the absolute number of microseconds is less than 1...
bool operator<(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB)
Operator < overload for time values.
OSVR_TimeValue_Seconds seconds
Seconds portion of the time value.