openMSX
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
openmsx::EmuDuration Class Reference

#include <EmuDuration.hh>

Public Types

using param = const EmuDuration &
 

Public Member Functions

constexpr EmuDuration ()=default
 
constexpr EmuDuration (uint64_t n)
 
constexpr EmuDuration (double duration)
 
constexpr double toDouble () const
 
constexpr uint64_t length () const
 
constexpr bool operator== (const EmuDuration &) const =default
 
constexpr auto operator<=> (const EmuDuration &) const =default
 
constexpr EmuDuration operator% (EmuDuration::param d) const
 
constexpr EmuDuration operator+ (EmuDuration::param d) const
 
constexpr EmuDuration operator* (uint64_t fact) const
 
constexpr EmuDuration operator/ (unsigned fact) const
 
constexpr EmuDuration divRoundUp (unsigned fact) const
 
constexpr unsigned operator/ (EmuDuration::param d) const
 
constexpr unsigned divUp (EmuDuration::param d) const
 
constexpr double div (EmuDuration::param d) const
 
constexpr EmuDurationoperator*= (unsigned fact)
 
constexpr EmuDurationoperator*= (double fact)
 
constexpr EmuDurationoperator/= (double fact)
 
constexpr unsigned getTicksAt (unsigned freq) const
 
template<typename Archive >
void serialize (Archive &ar, unsigned)
 

Static Public Member Functions

static constexpr EmuDuration sec (unsigned x)
 
static constexpr EmuDuration msec (unsigned x)
 
static constexpr EmuDuration usec (unsigned x)
 
static constexpr EmuDuration hz (unsigned x)
 
static constexpr EmuDuration zero ()
 
static constexpr EmuDuration infinity ()
 

Friends

class EmuTime
 

Detailed Description

Definition at line 19 of file EmuDuration.hh.

Member Typedef Documentation

◆ param

Definition at line 28 of file EmuDuration.hh.

Constructor & Destructor Documentation

◆ EmuDuration() [1/3]

constexpr openmsx::EmuDuration::EmuDuration ( )
constexprdefault

◆ EmuDuration() [2/3]

constexpr openmsx::EmuDuration::EmuDuration ( uint64_t  n)
inlineexplicitconstexpr

Definition at line 36 of file EmuDuration.hh.

◆ EmuDuration() [3/3]

constexpr openmsx::EmuDuration::EmuDuration ( double  duration)
inlineexplicitconstexpr

Definition at line 37 of file EmuDuration.hh.

Member Function Documentation

◆ div()

constexpr double openmsx::EmuDuration::div ( EmuDuration::param  d) const
inlineconstexpr

Definition at line 84 of file EmuDuration.hh.

◆ divRoundUp()

constexpr EmuDuration openmsx::EmuDuration::divRoundUp ( unsigned  fact) const
inlineconstexpr

Definition at line 66 of file EmuDuration.hh.

References EmuDuration().

◆ divUp()

constexpr unsigned openmsx::EmuDuration::divUp ( EmuDuration::param  d) const
inlineconstexpr

Definition at line 77 of file EmuDuration.hh.

◆ getTicksAt()

constexpr unsigned openmsx::EmuDuration::getTicksAt ( unsigned  freq) const
inlineconstexpr

◆ hz()

static constexpr EmuDuration openmsx::EmuDuration::hz ( unsigned  x)
inlinestaticconstexpr

◆ infinity()

static constexpr EmuDuration openmsx::EmuDuration::infinity ( )
inlinestaticconstexpr

Definition at line 111 of file EmuDuration.hh.

References EmuDuration(), and gl::max().

Referenced by openmsx::AviRecorder::addImage().

◆ length()

constexpr uint64_t openmsx::EmuDuration::length ( ) const
inlineconstexpr

◆ msec()

static constexpr EmuDuration openmsx::EmuDuration::msec ( unsigned  x)
inlinestaticconstexpr

Definition at line 42 of file EmuDuration.hh.

References EmuDuration(), openmsx::MAIN_FREQ, and openmsx::x.

Referenced by openmsx::MSXFDC::MSXFDC().

◆ operator%()

constexpr EmuDuration openmsx::EmuDuration::operator% ( EmuDuration::param  d) const
inlineconstexpr

Definition at line 58 of file EmuDuration.hh.

◆ operator*()

constexpr EmuDuration openmsx::EmuDuration::operator* ( uint64_t  fact) const
inlineconstexpr

Definition at line 62 of file EmuDuration.hh.

References EmuDuration().

◆ operator*=() [1/2]

constexpr EmuDuration& openmsx::EmuDuration::operator*= ( double  fact)
inlineconstexpr

Definition at line 89 of file EmuDuration.hh.

◆ operator*=() [2/2]

constexpr EmuDuration& openmsx::EmuDuration::operator*= ( unsigned  fact)
inlineconstexpr

Definition at line 87 of file EmuDuration.hh.

◆ operator+()

constexpr EmuDuration openmsx::EmuDuration::operator+ ( EmuDuration::param  d) const
inlineconstexpr

Definition at line 60 of file EmuDuration.hh.

◆ operator/() [1/2]

constexpr unsigned openmsx::EmuDuration::operator/ ( EmuDuration::param  d) const
inlineconstexpr

Definition at line 68 of file EmuDuration.hh.

◆ operator/() [2/2]

constexpr EmuDuration openmsx::EmuDuration::operator/ ( unsigned  fact) const
inlineconstexpr

Definition at line 64 of file EmuDuration.hh.

References EmuDuration().

◆ operator/=()

constexpr EmuDuration& openmsx::EmuDuration::operator/= ( double  fact)
inlineconstexpr

Definition at line 91 of file EmuDuration.hh.

◆ operator<=>()

constexpr auto openmsx::EmuDuration::operator<=> ( const EmuDuration ) const
constexprdefault

◆ operator==()

constexpr bool openmsx::EmuDuration::operator== ( const EmuDuration ) const
constexprdefault

◆ sec()

static constexpr EmuDuration openmsx::EmuDuration::sec ( unsigned  x)
inlinestaticconstexpr

◆ serialize()

template<typename Archive >
void openmsx::EmuDuration::serialize ( Archive &  ar,
unsigned   
)
inline

Definition at line 117 of file EmuDuration.hh.

◆ toDouble()

constexpr double openmsx::EmuDuration::toDouble ( ) const
inlineconstexpr

Definition at line 50 of file EmuDuration.hh.

References openmsx::MAIN_FREQ32.

Referenced by openmsx::AviRecorder::addImage().

◆ usec()

static constexpr EmuDuration openmsx::EmuDuration::usec ( unsigned  x)
inlinestaticconstexpr

Definition at line 44 of file EmuDuration.hh.

References EmuDuration(), openmsx::MAIN_FREQ, and openmsx::x.

◆ zero()

static constexpr EmuDuration openmsx::EmuDuration::zero ( )
inlinestaticconstexpr

Friends And Related Function Documentation

◆ EmuTime

friend class EmuTime
friend

Definition at line 32 of file EmuDuration.hh.


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