Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1UnitName.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:08:57 2011 Кодировка: Поисковые слова: vallis |
handles physical units More...
#include <UnitName.h>
Public Member Functions | |
UnitName () | |
Default constructor. | |
UnitName (const UnitName &other) | |
Copy constructor. | |
UnitName (const String &tag, const UnitVal &kind, const String &name=EmptyString) | |
Construct from different parts. | |
UnitName (const Unit &tag, const String &name=EmptyString) | |
~UnitName () | |
Destructor. | |
UnitName & | operator= (const UnitName &other) |
Assigment (copy semantics). | |
const UnitVal & | getVal () const |
Get definition value of the unit. | |
const String & | getName () const |
Get the name tag of the defined unit. | |
Private Attributes | |
UnitVal | basicKind |
Value of defined unit. | |
String | basicTag |
Name tag of unit. | |
String | basicName |
Full name and description of unit. | |
Friends | |
ostream & | operator<< (ostream &os, const UnitName &name) |
Output the unit tag, description and its definition. |
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/s', 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
UnitName myKPH( "KPH", UnitVal(3.6,"km/ks")); UnitMap::putUser(myKPH);
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:
// Define a UnitVal unit definition UnitVal mydef; // And fill it with the appropiate definition mydef = (UnitMap::getUnit("Jy"))->getVal();
Definition at line 129 of file UnitName.h.
casa::UnitName::UnitName | ( | ) |
Default constructor.
casa::UnitName::UnitName | ( | const UnitName & | other | ) |
Copy constructor.
casa::UnitName::UnitName | ( | const String & | tag, | |
const UnitVal & | kind, | |||
const String & | name = EmptyString | |||
) |
Construct from different parts.
casa::UnitName::UnitName | ( | const Unit & | tag, | |
const String & | name = EmptyString | |||
) |
casa::UnitName::~UnitName | ( | ) |
Destructor.
const String& casa::UnitName::getName | ( | ) | const |
Get the name tag of the defined unit.
const UnitVal& casa::UnitName::getVal | ( | ) | const |
Get definition value of the unit.
ostream& operator<< | ( | ostream & | os, | |
const UnitName & | name | |||
) | [friend] |
Output the unit tag, description and its definition.
UnitVal casa::UnitName::basicKind [private] |
Value of defined unit.
Definition at line 167 of file UnitName.h.
String casa::UnitName::basicName [private] |
Full name and description of unit.
Definition at line 173 of file UnitName.h.
String casa::UnitName::basicTag [private] |
Name tag of unit.
Definition at line 170 of file UnitName.h.