casa
5.7.0-16
|
handles physical units More...
#include <UnitName.h>
Public Member Functions | |
UnitName () | |
Default constructor. More... | |
UnitName (const UnitName &other) | |
Copy constructor. More... | |
UnitName (const String &nameTag, const UnitVal &kind, const String &fullName=String()) | |
Construct from different parts. More... | |
UnitName (const Unit &unit, const String &fullName=String()) | |
~UnitName () | |
Destructor. More... | |
UnitName & | operator= (const UnitName &other) |
Assigment (copy semantics) More... | |
const UnitVal & | getVal () const |
Get definition value of the unit. More... | |
const String & | getName () const |
Get the name tag of the defined unit. More... | |
const String & | getFullName () const |
Get the full name of the defined unit. More... | |
Private Attributes | |
UnitVal | basicKind |
Value of defined unit. More... | |
String | basicTag |
Name tag of unit. More... | |
String | basicName |
Full name and description of unit. More... | |
Friends | |
ostream & | operator<< (ostream &os, const UnitName &name) |
Output the unit tag, description and its definition. More... | |
handles physical units
Public interface
The class name derives from the basic Unit and the Name giving possibilities of this class to a newly defined unit tag.
Physical units are strings consisting of one or more names of known basic units, separated by '.' or ' ' (for multiplication) or '/' (for division). Each name can optionally be preceded by a standard decimal prefix, and/or followed by an (optionally signed) exponent.
Example: km/s/(Mpc.s)2 is identical to km.s-1.Mpc-2.s-2
See the Unit class for more details.
The UnitName class defines new basic, tagged units. If, e.g., for one reason or another you want, in addition to the standard defined SI and customary units, to define a unit with a name 'KPH' to stand for the composite SI unit 'km/hr', it can be done by creating a UnitName, and mapping it to the UnitMap lists.
Tip: The UnitMap::putUser can also be used without creating a UnitName first
The following constructors are available:
An assignment (copy semantics) is available.
The following information can be obatined from a UnitName:
To obtain the definition of a Jy, you could:
Definition at line 117 of file UnitName.h.
casacore::UnitName::UnitName | ( | ) |
Default constructor.
casacore::UnitName::UnitName | ( | const UnitName & | other | ) |
Copy constructor.
casacore::UnitName::UnitName | ( | const String & | nameTag, |
const UnitVal & | kind, | ||
const String & | fullName = String() |
||
) |
Construct from different parts.
casacore::UnitName::~UnitName | ( | ) |
Destructor.
|
inline |
Get the full name of the defined unit.
Definition at line 155 of file UnitName.h.
References basicName.
|
inline |
Get the name tag of the defined unit.
Definition at line 151 of file UnitName.h.
References basicTag.
|
inline |
|
friend |
Output the unit tag, description and its definition.
|
private |
|
private |
Full name and description of unit.
Definition at line 167 of file UnitName.h.
Referenced by getFullName().
|
private |