libdrmconf  0.11.3
A library to program DMR radios.
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Frequency Struct Reference

Helper type to encode frequencies without any rounding error. More...

#include <frequency.hh>

Public Types

enum class  Format {
  Automatic , Hz , kHz , MHz ,
  GHz
}
 Possible formatting hints.
 

Public Member Functions

 Frequency ()
 Default constructor.
 
 Frequency (const Frequency &other)
 Copy constructor.
 
Frequencyoperator= (const Frequency &other)
 Assignment.
 
bool operator== (const Frequency &other) const
 
bool operator< (const Frequency &other) const
 
QString format (Format f=Format::Automatic) const
 Format the frequency.
 
bool parse (const QString &value)
 Parses a frequency.
 
unsigned long long inHz () const
 Unit conversion.
 
double inkHz () const
 Unit conversion.
 
double inMHz () const
 Unit conversion.
 
double inGHz () const
 Unit conversion.
 

Static Public Member Functions

static Frequency fromString (const QString &freq)
 Pareses a frequency.
 
static Frequency fromHz (unsigned long long Hz)
 Unit conversion.
 
static Frequency fromkHz (double kHz)
 Unit conversion.
 
static Frequency fromMHz (double MHz)
 Unit conversion.
 
static Frequency fromGHz (double GHz)
 Unit conversion.
 

Protected Member Functions

 Frequency (unsigned long long hz)
 Hidden constructor from frequency in Hz.
 

Protected Attributes

unsigned long long _frequency
 The actual frequency in Hz.
 

Detailed Description

Helper type to encode frequencies without any rounding error.

Member Function Documentation

◆ operator<()

bool Frequency::operator< ( const Frequency other) const
inline

< Comparison.

◆ operator==()

bool Frequency::operator== ( const Frequency other) const
inline

< Comparison.


The documentation for this struct was generated from the following files: