CARMA C++
|
The Frequency class can represent any frequency in any units. More...
#include <carma/services/Frequency.h>
Public Member Functions | |
Frequency (double value, const std::string &units) | |
Construct an Frequency given a value and units. More... | |
double | gigahertz () const |
Convenience method that returns the value of this frequency in GHz. More... | |
double | hertz () const |
Convenience method that returns the value of this frequency in Hertz. More... | |
double | megahertz () const |
Convenience method that returns the value of this frequency in millihertz. More... | |
double | millihertz () const |
Convenience method that returns the value of this frequency in millihertz. More... | |
const Frequency | operator+ (const Frequency &frequency) const |
Add two Frequencys. More... | |
Frequency & | operator+= (const Frequency &frequency) |
Increment Frequency. More... | |
const Frequency | operator- (const Frequency &frequency) const |
Subtract two Frequencys. More... | |
Frequency & | operator-= (const Frequency &frequency) |
Decrement Frequency. More... | |
bool | operator< (const Frequency &frequency) const |
Compare two frequencies. More... | |
bool | operator> (const Frequency &frequency) const |
Compare two frequencies. More... | |
double | wavelength (const std::string &units) const |
Convenience method that returns the value of this the wavelength equivalent of this frequency. More... | |
virtual | ~Frequency () |
Destructor. More... | |
![]() | |
ConformableQuantity (double value, const std::string &units) | |
Construct an ConformableQuantity given a value and units. More... | |
virtual double | convert (const std::string &convertTo) const |
Converts this quantity to any conformable units. More... | |
virtual std::string | getUnits () const |
double | getValue () const |
virtual const ConformableQuantity | operator+ (const ConformableQuantity &quantity) const |
Add two ConformableQuantities. More... | |
virtual ConformableQuantity & | operator+= (const ConformableQuantity &quantity) |
Add ConformableQuantity to itself. More... | |
virtual const ConformableQuantity | operator- (const ConformableQuantity &quantity) const |
Subtract two ConformableQuantities. More... | |
virtual ConformableQuantity & | operator-= (const ConformableQuantity &quantity) |
Subtract ConformableQuantity from itself. More... | |
virtual void | reset (double value, const std::string &units) |
Reset method to change value and/or units. More... | |
virtual | ~ConformableQuantity () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
Units | u_ |
Used for converting between units. More... | |
The Frequency class can represent any frequency in any units.
It uses the Units class internally to handle conversion of any frequency unit to any other frequency unit. For example,
Frequency frequency1(100.0,"GHz")
both
Frequency frequency2(1E9,"Hz")
frequency1
and frequency2
represent the same physical quantity. Binary operations + and - are supported, as is the stream operation <<.
Definition at line 39 of file Frequency.h.
carma::services::Frequency::Frequency | ( | double | value, |
const std::string & | units | ||
) |
Construct an Frequency given a value and units.
value | The value of this frequency |
units | The units of the value. |
|
virtual |
Destructor.
double carma::services::Frequency::gigahertz | ( | ) | const |
Convenience method that returns the value of this frequency in GHz.
double carma::services::Frequency::hertz | ( | ) | const |
Convenience method that returns the value of this frequency in Hertz.
double carma::services::Frequency::megahertz | ( | ) | const |
Convenience method that returns the value of this frequency in millihertz.
This method may be of use to the loberotator, which passes phase rate to the XAC in Megahertz
double carma::services::Frequency::millihertz | ( | ) | const |
Convenience method that returns the value of this frequency in millihertz.
This method may be of use to the loberotator, which passes phase rate to the XAC in Millihertz
bool carma::services::Frequency::operator< | ( | const Frequency & | frequency | ) | const |
Compare two frequencies.
ConformabilityException |
bool carma::services::Frequency::operator> | ( | const Frequency & | frequency | ) | const |
Compare two frequencies.
ConformabilityException |
double carma::services::Frequency::wavelength | ( | const std::string & | units | ) | const |
Convenience method that returns the value of this the wavelength equivalent of this frequency.
units | the desired wavelength units |