Units Class Reference

Provides unit and range information for data objects. More...

#include <Units.h>

Inheritance diagram for Units:

Inheritance graph

List of all members.

Public Member Functions

virtual const std::string & getUnitName () const =0
virtual void setUnitName (const std::string &unitName)=0
virtual UnitType getUnitType () const =0
virtual void setUnitType (UnitType myType)=0
virtual double getRangeMin () const =0
virtual void setRangeMin (double myRangeMin)=0
virtual double getRangeMax () const =0
virtual void setRangeMax (double myRangeMax)=0
virtual double getScaleFromStandard () const =0
virtual void setScaleFromStandard (double myScaleFromStandard)=0
virtual void setUnits (const Units *pUnits)=0
virtual bool compare (const Units *pUnits) const =0

Static Public Member Functions

static const std::string & signalRenamed ()
static const std::string & signalTypeChanged ()
static const std::string & signalRangeChanged ()
static const std::string & signalScaleChanged ()

Protected Member Functions

virtual ~Units ()


Detailed Description

Provides unit and range information for data objects.

The units interface serves as a common mechanism for maintaining unit and range information about other data structures.

This subclass of Subject will notify upon the following conditions:

Definition at line 30 of file Units.h.


Constructor & Destructor Documentation

virtual Units::~Units (  )  [protected, virtual]

This should be destroyed by calling ObjectFactory::destroyObject.

Definition at line 198 of file Units.h.


Member Function Documentation

static const std::string& Units::signalRenamed (  )  [static]

Emitted when the unit name changes with boost::any<std::string> containing the new name.

See also:
setUnitName()

Definition at line 39 of file Units.h.

static const std::string& Units::signalTypeChanged (  )  [static]

Emitted when the unit type changes with boost::any<UnitType> containing the new type.

See also:
setUnitType()

Definition at line 47 of file Units.h.

static const std::string& Units::signalRangeChanged (  )  [static]

Emitted when the minimum or maximum range value changes.

No value is associated with this signal.

See also:
setRangeMin(), setRangeMax()

Definition at line 56 of file Units.h.

static const std::string& Units::signalScaleChanged (  )  [static]

Emitted when the scale value changes with boost::any<double> containing the new scale value.

See also:
setScaleFromStandard()

Definition at line 64 of file Units.h.

virtual const std::string& Units::getUnitName (  )  const [pure virtual]

Get the name of the current unit.

Returns:
The name of the unit.
See also:
Units::setUnitName

virtual void Units::setUnitName ( const std::string &  unitName  )  [pure virtual]

Sets the name for the current unit.

Parameters:
unitName The new name for the current unit.
Subject Notifications:
This method notifies signalRenamed() if the given unit name is different than the current unit name.
See also:
Units::getUnitName

virtual UnitType Units::getUnitType (  )  const [pure virtual]

Get the type of the units.

Returns:
An enumeration code indicating the type of the units.

virtual void Units::setUnitType ( UnitType  myType  )  [pure virtual]

Set the type of the units.

Parameters:
myType An enumeration code indicating the type of the units.
Subject Notifications:
This method notifies signalTypeChanged() if the given unit type is different than the current unit type.

virtual double Units::getRangeMin (  )  const [pure virtual]

Get the minimum range of the units.

Returns:
The minimum range of the units.

virtual void Units::setRangeMin ( double  myRangeMin  )  [pure virtual]

Set the minimum range of the units.

Parameters:
myRangeMin The minimum range of the units.
Subject Notifications:
This method notifies signalRangeChanged() if the given range minimum is different than the current range minimum.

virtual double Units::getRangeMax (  )  const [pure virtual]

Get the maximum range of the units.

Returns:
The maximum range of the units.

virtual void Units::setRangeMax ( double  myRangeMax  )  [pure virtual]

Set the maximum range of the units.

Parameters:
myRangeMax The maximum range of the units.
Subject Notifications:
This method notifies signalRangeChanged() if the given range maximum is different than the current range maximum.

virtual double Units::getScaleFromStandard (  )  const [pure virtual]

Get the quantity scaled from the standard units.

Returns:
The quantity scaled from the standard units.

virtual void Units::setScaleFromStandard ( double  myScaleFromStandard  )  [pure virtual]

Set the quantity scaled from the standard units.

Example: For distance, the standard units will be meters. To convert distance values of meter to kilometer, call setScaleFromStandard(1e-3);

Parameters:
myScaleFromStandard The quantity scaled from the standard units.
Subject Notifications:
This method notifies signalScaleChanged() if the given scale value is different than the current scale value.

virtual void Units::setUnits ( const Units pUnits  )  [pure virtual]

Sets all values in this Units object to those of another Units object.

Parameters:
pUnits The Units object from which to set all data values in this Units object. This method does nothing if NULL is passed in.
Subject Notifications:
This method notifies the following signals if the respective values in this Units object change:

virtual bool Units::compare ( const Units pUnits  )  const [pure virtual]

Compares all values in this Units object with those of another Units object.

Parameters:
pUnits The Units object with which to compare values in this Units object. This method does nothing and returns false if NULL is passed in.
Returns:
Returns true if all values in pUnits are the same as the values in this Units object; otherwise returns false.


Software Development Kit - Opticks 4.9.0 Build 16218