Loading...
Searching...
No Matches
GfTimeCode Class Reference

Value type that represents a time code. More...

#include <timeCode.h>

Public Member Functions

constexpr double operator/ (const GfTimeCode &rhs) const noexcept
 Ratio of two time codes is a unitless double scale factor.
 
constexpr GfDuration operator- (const GfTimeCode &rhs) const noexcept
 Compute a GfDuration offset between two time codes.
 
constexpr GfTimeCode operator- () const noexcept
 Negate a time code. Equivalent to scaling by -1.
 
constexpr operator double () const noexcept
 Explicit conversion to double.
 
constexpr operator GfDuration () const noexcept
 Explicit conversion to GfDuration.
 
size_t GetHash () const
 Hash function.
 
Constructors
constexpr GfTimeCode (double time=0.0) noexcept
 Construct a time code with the given time.
 
constexpr GfTimeCode (GfDuration duration) noexcept
 Explicitly construct a time code from a duration.
 
Accessors
constexpr double GetValue () const noexcept
 Return the time value.
 

Friends

constexpr GfTimeCode operator+ (const GfTimeCode &lhs, const GfTimeCode &rhs) noexcept
 Sum time codes.
 
constexpr GfTimeCode operator+ (const GfTimeCode &lhs, const GfDuration &rhs) noexcept
 Offset a time code value.
 
constexpr GfTimeCode operator+ (const GfDuration &lhs, const GfTimeCode &rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr GfTimeCode operator+ (const GfTimeCode &lhs, const double rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr GfTimeCode operator+ (const double lhs, const GfTimeCode &rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr GfTimeCode operator- (const GfTimeCode &lhs, const GfDuration &rhs) noexcept
 Offset a time code value.
 
constexpr GfTimeCode operator- (const GfDuration &lhs, const GfTimeCode &rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr GfTimeCode operator- (const GfTimeCode &lhs, const double rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr GfTimeCode operator- (const double lhs, const GfTimeCode &rhs) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
size_t hash_value (const GfTimeCode &ap)
 
template<class HashState >
void TfHashAppend (HashState &h, const GfTimeCode &t)
 Enable TfHash for GfTimeCode.
 
void swap (GfTimeCode &lhs, GfTimeCode &rhs)
 

Operators

constexpr bool operator== (const GfTimeCode &rhs) const noexcept
 
constexpr bool operator!= (const GfTimeCode &rhs) const noexcept
 
constexpr bool operator< (const GfTimeCode &rhs) const noexcept
 
constexpr bool operator> (const GfTimeCode &rhs) const noexcept
 
constexpr bool operator<= (const GfTimeCode &rhs) const noexcept
 
constexpr bool operator>= (const GfTimeCode &rhs) const noexcept
 
constexpr GfTimeCode operator* (const GfTimeCode &t, const double amount) noexcept
 Scale time code values by doubles.
 
constexpr GfTimeCode operator* (const double amount, const GfTimeCode &t) noexcept
 
constexpr GfTimeCode operator/ (const GfTimeCode &t, const double amount) noexcept
 

Detailed Description

Value type that represents a time code.

It's equivalent to a double type value but is used to indicate that this value should be resolved by any time based value resolution.

Definition at line 28 of file timeCode.h.

Constructor & Destructor Documentation

◆ GfTimeCode() [1/2]

GfTimeCode ( double time = 0.0)
inlineconstexprnoexcept

Construct a time code with the given time.

A default constructed GfTimeCode has a time of 0.0. A double value can implicitly cast to GfTimeCode.

Definition at line 39 of file timeCode.h.

◆ GfTimeCode() [2/2]

GfTimeCode ( GfDuration duration)
inlineexplicitconstexprnoexcept

Explicitly construct a time code from a duration.

This is equivalent to (GfTimeCode(0) + duration).

Definition at line 46 of file timeCode.h.

Member Function Documentation

◆ GetHash()

size_t GetHash ( ) const
inline

Hash function.

Definition at line 160 of file timeCode.h.

◆ GetValue()

double GetValue ( ) const
inlineconstexprnoexcept

Return the time value.

Definition at line 188 of file timeCode.h.

◆ operator double()

operator double ( ) const
inlineexplicitconstexprnoexcept

Explicit conversion to double.

Definition at line 149 of file timeCode.h.

◆ operator GfDuration()

operator GfDuration ( ) const
inlineexplicitconstexprnoexcept

Explicit conversion to GfDuration.

This is equivalent to *this - GfTimeCode(0)

Definition at line 154 of file timeCode.h.

◆ operator!=()

bool operator!= ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 57 of file timeCode.h.

◆ operator-() [1/2]

GfTimeCode operator- ( ) const
inlineconstexprnoexcept

Negate a time code. Equivalent to scaling by -1.

Definition at line 145 of file timeCode.h.

◆ operator-() [2/2]

GfDuration operator- ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Compute a GfDuration offset between two time codes.

Definition at line 99 of file timeCode.h.

◆ operator/()

double operator/ ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Ratio of two time codes is a unitless double scale factor.

Definition at line 86 of file timeCode.h.

◆ operator<()

bool operator< ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 59 of file timeCode.h.

◆ operator<=()

bool operator<= ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 63 of file timeCode.h.

◆ operator==()

bool operator== ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 55 of file timeCode.h.

◆ operator>()

bool operator> ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 61 of file timeCode.h.

◆ operator>=()

bool operator>= ( const GfTimeCode & rhs) const
inlineconstexprnoexcept

Definition at line 65 of file timeCode.h.

Friends And Related Symbol Documentation

◆ hash_value

size_t hash_value ( const GfTimeCode & ap)
friend

Definition at line 172 of file timeCode.h.

◆ operator* [1/2]

GfTimeCode operator* ( const double amount,
const GfTimeCode & t )
friend

Definition at line 75 of file timeCode.h.

◆ operator* [2/2]

GfTimeCode operator* ( const GfTimeCode & t,
const double amount )
friend

Scale time code values by doubles.

Definition at line 71 of file timeCode.h.

◆ operator+ [1/5]

GfTimeCode operator+ ( const double lhs,
const GfTimeCode & rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 119 of file timeCode.h.

◆ operator+ [2/5]

GfTimeCode operator+ ( const GfDuration & lhs,
const GfTimeCode & rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 109 of file timeCode.h.

◆ operator+ [3/5]

GfTimeCode operator+ ( const GfTimeCode & lhs,
const double rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 114 of file timeCode.h.

◆ operator+ [4/5]

GfTimeCode operator+ ( const GfTimeCode & lhs,
const GfDuration & rhs )
friend

Offset a time code value.

Definition at line 104 of file timeCode.h.

◆ operator+ [5/5]

GfTimeCode operator+ ( const GfTimeCode & lhs,
const GfTimeCode & rhs )
friend

Sum time codes.

This is questionable mathematically but it is needed to conveniently compute an average time code, like say a midpoint time.

Definition at line 94 of file timeCode.h.

◆ operator- [1/4]

GfTimeCode operator- ( const double lhs,
const GfTimeCode & rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 140 of file timeCode.h.

◆ operator- [2/4]

GfTimeCode operator- ( const GfDuration & lhs,
const GfTimeCode & rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 130 of file timeCode.h.

◆ operator- [3/4]

GfTimeCode operator- ( const GfTimeCode & lhs,
const double rhs )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 135 of file timeCode.h.

◆ operator- [4/4]

GfTimeCode operator- ( const GfTimeCode & lhs,
const GfDuration & rhs )
friend

Offset a time code value.

Definition at line 125 of file timeCode.h.

◆ operator/

GfTimeCode operator/ ( const GfTimeCode & t,
const double amount )
friend

Definition at line 79 of file timeCode.h.

◆ swap

void swap ( GfTimeCode & lhs,
GfTimeCode & rhs )
friend

Definition at line 195 of file timeCode.h.

◆ TfHashAppend

template<class HashState >
void TfHashAppend ( HashState & h,
const GfTimeCode & t )
friend

Enable TfHash for GfTimeCode.

Definition at line 176 of file timeCode.h.


The documentation for this class was generated from the following file: