casa
$Rev:20696$
|
describes a unit in basic SI unit dimensions More...
#include <UnitDim.h>
Public Types | |
enum | Dim { Dm, Dkg, Ds, DA, DK, Dcd, Dmol, Drad, Dsr, Dnon, Dnumber } |
Enumeration of the order and number of the defining SI units. More... | |
Public Member Functions | |
~UnitDim () | |
Destructor. | |
Protected Member Functions | |
void | init () |
void | init (Int pos) |
Private Member Functions | |
UnitDim () | |
Construct a unit with zero dimension in all SI units. | |
UnitDim (const UnitDim &other) | |
Copy constructor. | |
UnitDim (Int pos) | |
Construct a unit dimension with a one in the indicated position (as Dim enumerator) and zeroes in all other units. | |
UnitDim & | operator= (const UnitDim &other) |
Assignment (copy semantics) | |
UnitDim | pow (Int p) |
Raise all SI defining units to an integer power. | |
UnitDim & | operator*= (const UnitDim &other) |
Operators to combine unit dimensions. | |
UnitDim | operator* (const UnitDim &other) const |
UnitDim & | operator/= (const UnitDim &other) |
Division subtracts the unit dimensions of all SI units. | |
UnitDim | operator/ (const UnitDim &other) const |
Bool | operator== (const UnitDim &other) const |
Compare dimension of units. | |
Bool | operator!= (const UnitDim &other) const |
Compare for unequal dimensions. | |
Static Private Member Functions | |
static const String & | dimName (uInt which) |
Get the tag for specified dimension. | |
static const String & | dimFull (uInt which) |
Get the full name for the specified dimension. | |
Private Attributes | |
Long | unitLong [UNITDIM_DLNUMBER] |
1-byte vector to contain the dimensions of the defining SI units (using same storage as Long vector for speed reasons) | |
Char * | unitDim |
Friends | |
class | UnitVal |
class | UnitMap |
ostream & | operator<< (ostream &os, const UnitDim &du) |
Output the SI dimensions (e.g. |
describes a unit in basic SI unit dimensions
Internal
Based on Unit and the Dimension of a unit in SI defining units
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 for more details.
The UnitDim class is a private class for use by the Unit classes. It contains the dimensions in the 9 basic defining SI units of a unit.
The UnitDim class has been separated to keep the interface between a complex unit description string and the basic SI units clean.
enum casa::UnitDim::Dim |
Destructor.
casa::UnitDim::UnitDim | ( | ) | [inline, private] |
casa::UnitDim::UnitDim | ( | const UnitDim & | other | ) | [private] |
Copy constructor.
casa::UnitDim::UnitDim | ( | Int | pos | ) | [inline, private] |
static const String& casa::UnitDim::dimFull | ( | uInt | which | ) | [static, private] |
Get the full name for the specified dimension.
static const String& casa::UnitDim::dimName | ( | uInt | which | ) | [static, private] |
Get the tag for specified dimension.
void casa::UnitDim::init | ( | ) | [protected] |
Referenced by UnitDim().
void casa::UnitDim::init | ( | Int | pos | ) | [protected] |
Compare for unequal dimensions.
Division subtracts the unit dimensions of all SI units.
UnitDim casa::UnitDim::pow | ( | Int | p | ) | [private] |
Raise all SI defining units to an integer power.
ostream& operator<< | ( | ostream & | os, |
const UnitDim & | du | ||
) | [friend] |
Output the SI dimensions (e.g.
'km/s/g' as 'm kg-1 s-1')
Char* casa::UnitDim::unitDim [private] |
Long casa::UnitDim::unitLong[UNITDIM_DLNUMBER] [private] |