Документ взят из кэша поисковой машины. Адрес оригинального документа : 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
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п
casacore: casa::UnitName Class Reference
Public Member Functions | Private Attributes | Friends

casa::UnitName Class Reference
[Quanta_module]

handles physical units More...

#include <UnitName.h>

List of all members.

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.
UnitNameoperator= (const UnitName &other)
 Assigment (copy semantics).
const UnitValgetVal () const
 Get definition value of the unit.
const StringgetName () 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.

Detailed Description

handles physical units

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tUnit

Prerequisite

Etymology

The class name derives from the basic Unit and the Name giving possibilities of this class to a newly defined unit tag.

Synopsis

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);

Constructing a tagged unit definition

The following constructors are available:

  1. UnitName() create unnamed value 1.
  2. UnitName(const UnitName&) copy constructor
  3. UnitName("tag", UnitVal, "full name")

An assignment (copy semantics) is available.

Obtaining information about tagged unit

The following information can be obatined from a UnitName:

  1. UnitVal getVal() const will return the unit definition value
  2. String getName() const will return the unit name

Example

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();

To Do

Definition at line 129 of file UnitName.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

UnitName& casa::UnitName::operator= ( const UnitName other  ) 

Assigment (copy semantics).


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const UnitName name 
) [friend]

Output the unit tag, description and its definition.


Member Data Documentation

Value of defined unit.

Definition at line 167 of file UnitName.h.

Full name and description of unit.

Definition at line 173 of file UnitName.h.

Name tag of unit.

Definition at line 170 of file UnitName.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines