OSVR-Core
Classes | Typedefs | Functions
TimeValueC.h File Reference

Header defining a dependency-free, cross-platform substitute for struct timeval. More...

#include <osvr/Util/APIBaseC.h>
#include <osvr/Util/AnnotationMacrosC.h>
#include <osvr/Util/BoolC.h>
#include <osvr/Util/Export.h>
#include <osvr/Util/PlatformConfig.h>
#include <osvr/Util/StdInt.h>

Go to the source code of this file.

Classes

struct  OSVR_TimeValue
 Standardized, portable parallel to struct timeval for representing both absolute times and time intervals. More...
 

Typedefs

typedef int64_t OSVR_TimeValue_Seconds
 The signed integer type storing the seconds in a struct OSVR_TimeValue.
 
typedef int32_t OSVR_TimeValue_Microseconds
 The signed integer type storing the microseconds in a struct OSVR_TimeValue.
 
typedef struct OSVR_TimeValue OSVR_TimeValue
 Standardized, portable parallel to struct timeval for representing both absolute times and time intervals. More...
 

Functions

OSVR_UTIL_EXPORT void osvrTimeValueNormalize (OSVR_INOUT_PTR OSVR_TimeValue *tv) OSVR_FUNC_NONNULL((1))
 "Normalizes" a time value so that the absolute number of microseconds is less than 1,000,000, and that the sign of both components is the same. More...
 
OSVR_UTIL_EXPORT void osvrTimeValueSum (OSVR_INOUT_PTR OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
 Sums two time values, replacing the first with the result. More...
 
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void osvrTimeValueDifference (OSVR_INOUT_PTR OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
 Computes the difference between two time values, replacing the first with the result. More...
 
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int osvrTimeValueCmp (OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
 Compares two time values (assumed to be normalized), returning the same values as strcmp. More...
 
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int OSVR_EXTERN_C_END OSVR_INLINE double osvrTimeValueDurationSeconds (OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
 Compute the difference between the two time values, returning the duration as a double-precision floating-point number of seconds. More...
 
OSVR_INLINE OSVR_CBool osvrTimeValueGreater (OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
 True if A is later than B.
 

Detailed Description

Header defining a dependency-free, cross-platform substitute for struct timeval.

Must be c-safe!

Date
2014
Author
Sensics, Inc. http://sensics.com/osvr