24 #ifndef PXR_USD_USD_TIME_CODE_H
25 #define PXR_USD_USD_TIME_CODE_H
42 #define USD_TIME_CODE_TOKENS \
91 : _value(timeCode.GetValue()) {}
102 return UsdTimeCode(std::numeric_limits<double>::lowest());
113 return UsdTimeCode(std::numeric_limits<double>::quiet_NaN());
125 static constexpr
double
126 SafeStep(
double maxValue=1e6,
double maxCompression=10.0) {
127 return std::numeric_limits<double>::epsilon() *
128 maxValue * maxCompression * 2.0;
134 return IsNumeric() && (_value == std::numeric_limits<double>::lowest());
140 return std::isnan(_value);
153 _IssueGetValueOnDefaultError();
165 return !(lhs == rhs);
192 return !(lhs <= rhs);
197 return TfHash()(time._value);
202 void _IssueGetValueOnDefaultError()
const;
217 #endif // PXR_USD_USD_TIME_CODE_H
#define USD_TIME_CODE_TOKENS
friend bool operator==(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
Equality comparison.
static constexpr UsdTimeCode Default()
static constexpr UsdTimeCode EarliestTime()
GT_API const UT_StringHolder time
friend bool operator>=(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
friend bool operator<=(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
bool IsEarliestTime() const
USD_API std::istream & operator>>(std::istream &is, UsdTimeCode &time)
constexpr UsdTimeCode(double t=0.0) noexcept
Construct with optional time value. Impilicitly convert from double.
TF_DECLARE_PUBLIC_TOKENS(UsdTimeCodeTokens, USD_API, USD_TIME_CODE_TOKENS)
constexpr UsdTimeCode(const SdfTimeCode &timeCode) noexcept
Construct and implicitly cast from SdfTimeCode.
friend size_t hash_value(const UsdTimeCode &time)
Hash function.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
friend bool operator!=(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
Inequality comparison.
#define PXR_NAMESPACE_CLOSE_SCOPE
SDF_API std::ostream & operator<<(std::ostream &out, const SdfTimeCode &ap)
Stream insertion operator for the string representation of this time code.
friend bool operator<(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
friend bool operator>(const UsdTimeCode &lhs, const UsdTimeCode &rhs)
static constexpr double SafeStep(double maxValue=1e6, double maxCompression=10.0)