libdrmconf
0.12.0
A library to program DMR radios.
|
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. | |
Frequency & | operator= (const Frequency &other) |
Assignment. | |
bool | operator< (const Frequency &other) const |
bool | operator<= (const Frequency &other) const |
bool | operator== (const Frequency &other) const |
bool | operator!= (const Frequency &other) const |
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. | |
Helper type to encode frequencies without any rounding error.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.