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 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 epsilon ()
 
static constexpr EmuDuration zero ()
 
static constexpr EmuDuration infinity ()
 

Friends

class EmuTime
 

Detailed Description

Definition at line 21 of file EmuDuration.hh.

Member Typedef Documentation

◆ param

Definition at line 30 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 38 of file EmuDuration.hh.

◆ EmuDuration() [3/3]

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

Definition at line 39 of file EmuDuration.hh.

Member Function Documentation

◆ div()

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

Definition at line 85 of file EmuDuration.hh.

◆ divRoundUp()

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

Definition at line 67 of file EmuDuration.hh.

References EmuDuration().

◆ divUp()

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

Definition at line 78 of file EmuDuration.hh.

◆ epsilon()

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

Definition at line 96 of file EmuDuration.hh.

References EmuDuration().

◆ 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 117 of file EmuDuration.hh.

References EmuDuration().

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 44 of file EmuDuration.hh.

References EmuDuration(), and openmsx::MAIN_FREQ.

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

◆ operator%()

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

Definition at line 59 of file EmuDuration.hh.

References EmuDuration().

◆ operator*()

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

Definition at line 63 of file EmuDuration.hh.

References EmuDuration().

◆ operator*=() [1/2]

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

Definition at line 90 of file EmuDuration.hh.

◆ operator*=() [2/2]

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

Definition at line 88 of file EmuDuration.hh.

◆ operator+()

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

Definition at line 61 of file EmuDuration.hh.

References EmuDuration().

◆ operator/() [1/2]

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

Definition at line 69 of file EmuDuration.hh.

◆ operator/() [2/2]

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

Definition at line 65 of file EmuDuration.hh.

References EmuDuration().

◆ operator/=()

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

Definition at line 92 of file EmuDuration.hh.

◆ operator<=>()

constexpr auto 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 123 of file EmuDuration.hh.

Referenced by openmsx::V9990CmdEngine::serialize().

◆ toDouble()

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

Definition at line 52 of file EmuDuration.hh.

References openmsx::RECIP_MAIN_FREQ.

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

◆ usec()

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

Definition at line 46 of file EmuDuration.hh.

References EmuDuration(), and openmsx::MAIN_FREQ.

◆ zero()

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

Friends And Related Symbol Documentation

◆ EmuTime

friend class EmuTime
friend

Definition at line 34 of file EmuDuration.hh.


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