|
libdrmconf 0.13.3
A library to program DMR radios.
|
Helper type to encode frequencies without any rounding error. More...
#include <frequency.hh>


Classes | |
| class | MapNearest |
| Searches for the nearest frequency and returns an associated value. More... | |
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 |
| Frequency | operator+ (const FrequencyOffset &offset) const |
| Frequency arithmetic. | |
| Frequency & | operator+= (const FrequencyOffset &offset) |
| Frequency arithmetic. | |
| FrequencyOffset | operator- (const Frequency &other) const |
| Frequency arithmetic. | |
| quint64 | inHz () const |
| Unit conversion. | |
Public Member Functions inherited from FrequencyBase | |
| FrequencyBase (const FrequencyBase &other) | |
| Copy constructor. | |
| FrequencyBase & | operator= (const FrequencyBase &other) |
| Assignment. | |
| bool | isNegative () const |
Returns true of the frequency is negative. | |
| bool | isPositive () const |
Returns true of the frequency is positive. | |
| bool | isZero () const |
Returns true of the frequency is zero. | |
| QString | format (Unit unit=Unit::Auto) const |
| Format the frequency. | |
| bool | parse (const QString &value, Qt::CaseSensitivity caseSensitivity=Qt::CaseInsensitive) |
| Parses a frequency. | |
| long long | inHz () const |
| Unit conversion. | |
| double | inkHz () const |
| Unit conversion. | |
| double | inMHz () const |
| Unit conversion. | |
| double | inGHz () const |
| Unit conversion. | |
| Unit | unit () const |
| Returns the most appropriate unit for the frequency value. | |
| Unit | unitFromString (const QString &input) const |
| Returns unit as type base on string input. | |
| bool | isMultipleOf (Unit unit) const |
| Checks if frequency is a multiple of unit. | |
Static Public Member Functions | |
| static Frequency | fromString (const QString &freq) |
| Pareses a frequency. | |
| static Frequency | fromHz (quint64 Hz) |
| Unit conversion. | |
| static Frequency | fromkHz (double kHz) |
| Unit conversion. | |
| static Frequency | fromMHz (double MHz) |
| Unit conversion. | |
| static Frequency | fromGHz (double GHz) |
| Unit conversion. | |
Static Public Member Functions inherited from FrequencyBase | |
| static QString | unitName (Unit unit) |
| Helper for string conversion of unit. | |
Protected Member Functions | |
| Frequency (quint64 hz) | |
| Hidden constructor from frequency in Hz. | |
Protected Member Functions inherited from FrequencyBase | |
| FrequencyBase (qint64 hz) | |
| Hidden constructor from offset in Hz. | |
Additional Inherited Members | |
Public Types inherited from FrequencyBase | |
| enum class | Unit { Auto , Hz , kHz , MHz , GHz } |
| Frequency units. | |
Protected Attributes inherited from FrequencyBase | |
| qint64 | _frequency |
| The actual frequency in Hz. | |
Helper type to encode frequencies without any rounding error.
This is a specialization of FrequencyBase, enforcing a positive integer.
|
inline |
< Comparison.
| Frequency Frequency::operator+ | ( | const FrequencyOffset & | offset | ) | const |
Frequency arithmetic.
May result in an invalid frequency, if the negative offset is larger than the frequency.
| Frequency & Frequency::operator+= | ( | const FrequencyOffset & | offset | ) |
Frequency arithmetic.
May result in an invalid frequency, if the negative offset is larger than the frequency.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.
|
inline |
< Comparison.