Loading...
Searching...
No Matches
GfDuration Class Reference

Value type that represents a duration measured in time codes. More...

#include <duration.h>

Public Member Functions

constexpr double operator/ (const GfDuration &rhs) const noexcept
 Ratio of two durations is a unitless double scale factor.
 
constexpr operator double () const noexcept
 Explicit conversion to double.
 
Constructors
constexpr GfDuration (double duration=0.0) noexcept
 Construct a duration with the given elapsed time.
 
Accessors
constexpr double GetValue () const noexcept
 Return the duration value.
 

Friends

void swap (GfDuration &lhs, GfDuration &rhs)
 
Operators
constexpr bool operator== (const GfDuration &lhs, const GfDuration &rhs) noexcept
 Comparison operators.
 
constexpr bool operator!= (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
constexpr bool operator< (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
constexpr bool operator> (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
constexpr bool operator<= (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
constexpr bool operator>= (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
constexpr GfDuration operator* (const GfDuration &d, const double amount) noexcept
 Scale duration values by doubles.
 
constexpr GfDuration operator* (const double amount, const GfDuration &d) noexcept
 
constexpr GfDuration operator/ (const GfDuration &d, const double amount) noexcept
 
constexpr GfDuration operator- () const noexcept
 
constexpr GfDuration operator+ (const GfDuration &lhs, const GfDuration &rhs) noexcept
 Sum, difference, and negation of durations are durations.
 
constexpr GfDuration operator- (const GfDuration &lhs, const GfDuration &rhs) noexcept
 
size_t GetHash () const
 Hash operations.
 
size_t hash_value (const GfDuration &ap)
 
template<class HashState >
void TfHashAppend (HashState &h, const GfDuration &d)
 Enable TfHash for GfDuration.
 

Detailed Description

Value type that represents a duration measured in time codes.

It is 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 26 of file duration.h.

Constructor & Destructor Documentation

◆ GfDuration()

GfDuration ( double duration = 0.0)
inlineconstexprnoexcept

Construct a duration with the given elapsed time.

A default constructed GfDuration has a duration of 0.0. A double value can implicitly cast to GfDuration.

Definition at line 36 of file duration.h.

Member Function Documentation

◆ GetHash()

size_t GetHash ( ) const
inline

Hash operations.

Definition at line 102 of file duration.h.

◆ GetValue()

double GetValue ( ) const
inlineconstexprnoexcept

Return the duration value.

Definition at line 131 of file duration.h.

◆ operator double()

operator double ( ) const
inlineexplicitconstexprnoexcept

Explicit conversion to double.

Definition at line 98 of file duration.h.

◆ operator-()

GfDuration operator- ( ) const
inlineconstexprnoexcept

Definition at line 93 of file duration.h.

◆ operator/()

double operator/ ( const GfDuration & rhs) const
inlineconstexprnoexcept

Ratio of two durations is a unitless double scale factor.

Definition at line 80 of file duration.h.

Friends And Related Symbol Documentation

◆ hash_value

size_t hash_value ( const GfDuration & ap)
friend

Definition at line 114 of file duration.h.

◆ operator!=

bool operator!= ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Definition at line 47 of file duration.h.

◆ operator* [1/2]

GfDuration operator* ( const double amount,
const GfDuration & d )
friend

Definition at line 70 of file duration.h.

◆ operator* [2/2]

GfDuration operator* ( const GfDuration & d,
const double amount )
friend

Scale duration values by doubles.

Definition at line 66 of file duration.h.

◆ operator+

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

Sum, difference, and negation of durations are durations.

Definition at line 86 of file duration.h.

◆ operator-

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

Definition at line 90 of file duration.h.

◆ operator/

GfDuration operator/ ( const GfDuration & d,
const double amount )
friend

Definition at line 74 of file duration.h.

◆ operator<

bool operator< ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Definition at line 50 of file duration.h.

◆ operator<=

bool operator<= ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Definition at line 56 of file duration.h.

◆ operator==

bool operator== ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Comparison operators.

Definition at line 44 of file duration.h.

◆ operator>

bool operator> ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Definition at line 53 of file duration.h.

◆ operator>=

bool operator>= ( const GfDuration & lhs,
const GfDuration & rhs )
friend

Definition at line 59 of file duration.h.

◆ swap

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

Definition at line 138 of file duration.h.

◆ TfHashAppend

template<class HashState >
void TfHashAppend ( HashState & h,
const GfDuration & d )
friend

Enable TfHash for GfDuration.

Definition at line 118 of file duration.h.


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