Wrapper around ut_unit from udunits.
More...
#include <GyotoConverters.h>
|
| | Unit (const std::string &unit) |
| | Build Unit described by string.
|
| | Unit (char const *const unit) |
| | Build Unit described by C string.
|
| | ~Unit () |
| | Destructor.
|
| double | To (double val, const Unit &from_unit) |
| | Convert to Unit.
|
| double | From (double val, const Unit &to_unit) |
| | Convert from Unit.
|
| | operator std::string () const |
| | Cast to string.
|
| | operator ut_unit * () const |
| | Cast to ut_unit*.
|
|
void | incRefCount () |
| | Increment the reference counter. Warning: Don't mess with the counter.
|
|
int | decRefCount () |
| | Decrement the reference counter and return current value. Warning: Don't mess with the counter.
|
|
int | getRefCount () |
| | Get the current number of references.
|
|
|
ut_unit * | unit_ |
| | the underlying ut_unit (from udunits)
|
|
std::string | kind_ |
| | the string used to instantiate this unit
|
|
int | refCount |
| | Reference counter.
|
| pthread_mutex_t | mutex_ |
| | A mutex.
|
|
|
class | Gyoto::SmartPointer< Gyoto::Units::Unit > |
|
class | Gyoto::Units::Converter |
Wrapper around ut_unit from udunits.
Gyoto::Units::Unit objects usually cast seamlessly to and from udunits2 ut_unit* and std::string.
◆ Subcontractor_t
◆ Unit() [1/2]
| Gyoto::Units::Unit::Unit |
( |
const std::string & | unit | ) |
|
Build Unit described by string.
Throws a Gyoto::Error if anything goes wrong.
- Parameters
-
| unit | string description of the unit, e.g. "mJy/sr2" or "sunmass". |
◆ Unit() [2/2]
| Gyoto::Units::Unit::Unit |
( |
char const *const | unit | ) |
|
Build Unit described by C string.
Throws a Gyoto::Error if anything goes wrong.
- Parameters
-
| unit | char const * const description of the unit, e.g. "mJy/sr2" or "sunmass". |
◆ ~Unit()
| Gyoto::Units::Unit::~Unit |
( |
| ) |
|
◆ From()
| double Gyoto::Units::Unit::From |
( |
double | val, |
|
|
const Unit & | to_unit ) |
Convert from Unit.
- Parameters
-
| val | double to convert |
| to_unit | Unit to which to convert |
- Returns
- value converted to "to_unit".
◆ operator std::string()
| Gyoto::Units::Unit::operator std::string |
( |
| ) |
const |
Cast to string.
- Returns
- kind_
◆ operator ut_unit *()
| Gyoto::Units::Unit::operator ut_unit * |
( |
| ) |
const |
Cast to ut_unit*.
- Returns
- unit_
◆ To()
| double Gyoto::Units::Unit::To |
( |
double | val, |
|
|
const Unit & | from_unit ) |
Convert to Unit.
- Parameters
-
| val | double to convert |
| from_unit | Unit from which to convert |
- Returns
- value converted to unit_.
◆ mutex_
| pthread_mutex_t Gyoto::SmartPointee::mutex_ |
|
privateinherited |
A mutex.
When compiled with libpthread
The documentation for this class was generated from the following file: