7#ifndef PXR_BASE_GF_TIME_CODE_H
8#define PXR_BASE_GF_TIME_CODE_H
13#include "pxr/base/gf/api.h"
19PXR_NAMESPACE_OPEN_SCOPE
37 constexpr GfTimeCode(
double time = 0.0) noexcept : _time(time) {};
44 constexpr bool operator==(
const GfTimeCode &rhs)
const noexcept
45 {
return _time == rhs._time; }
46 constexpr bool operator!=(
const GfTimeCode &rhs)
const noexcept
47 {
return _time != rhs._time; }
48 constexpr bool operator<(
const GfTimeCode &rhs)
const noexcept
49 {
return _time < rhs._time; }
50 constexpr bool operator>(
const GfTimeCode &rhs)
const noexcept
51 {
return _time > rhs._time; }
52 constexpr bool operator<=(
const GfTimeCode &rhs)
const noexcept
53 {
return _time <= rhs._time; }
54 constexpr bool operator>=(
const GfTimeCode &rhs)
const noexcept
55 {
return _time >= rhs._time; }
65 constexpr GfTimeCode operator-() const noexcept
69 explicit constexpr operator double() const noexcept {
return _time;}
73 return std::hash<double>()(_time);
79 size_t operator()(
const GfTimeCode &ap)
const {
100 std::swap(lhs._time, rhs._time);
128bool operator==(
double time,
const GfTimeCode &timeCode)
noexcept
132bool operator!=(
double time,
const GfTimeCode &timeCode)
noexcept
136bool operator<(
double time,
const GfTimeCode &timeCode)
noexcept
140bool operator>(
double time,
const GfTimeCode &timeCode)
noexcept
144bool operator<=(
double time,
const GfTimeCode &timeCode)
noexcept
148bool operator>=(
double time,
const GfTimeCode &timeCode)
noexcept
157PXR_NAMESPACE_CLOSE_SCOPE
GF_API std::ostream & operator<<(std::ostream &out, const GfTimeCode &ap)
Stream insertion operator for the string representation of this time code.
Value type that represents a time code.
constexpr double GetValue() const noexcept
Return the time value.
size_t GetHash() const
Hash function.
constexpr GfTimeCode(double time=0.0) noexcept
Construct a time code with the given time.