The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcu::DimensionalValue Class Reference

#include <gcu/value.h>

Inheritance diagram for gcu::DimensionalValue:
gcu::Value

Public Member Functions

 DimensionalValue ()
virtual ~DimensionalValue ()
char const * GetAsString () const
double GetAsDouble () const
DimensionalValue operator+ (DimensionalValue const &value) const throw (std::invalid_argument)
DimensionalValue operator* (int n) const
GcuDimensionalValue const GetValue () const
- Public Member Functions inherited from gcu::Value
 Value ()
virtual ~Value ()

Detailed Description

Used for data with a dimension e.g. a time interval expressed in days.

Definition at line 120 of file value.h.

Constructor & Destructor Documentation

gcu::DimensionalValue::DimensionalValue ( )

Default constructor

virtual gcu::DimensionalValue::~DimensionalValue ( )
virtual

Default destructor

Member Function Documentation

double gcu::DimensionalValue::GetAsDouble ( ) const
virtual
Returns
the embedded value. Note that the unit is lost.

Reimplemented from gcu::Value.

char const* gcu::DimensionalValue::GetAsString ( ) const
virtual
Returns
the literal representation of the embedded dimensional data

Reimplemented from gcu::Value.

GcuDimensionalValue const gcu::DimensionalValue::GetValue ( ) const
inline
Returns
the embedded GcuDimensionalValue structure.

Definition at line 160 of file value.h.

DimensionalValue gcu::DimensionalValue::operator* ( int  n) const
Parameters
nthe number used to multiply.

Multiplies this by n.

Returns
the result of the multiplication.
DimensionalValue gcu::DimensionalValue::operator+ ( DimensionalValue const &  value) const throw (std::invalid_argument)
Parameters
valuethe value to add.

Adds two values. They need to have the same dimension, otherwise an exception will be thrown.

Returns
the result of the addition.

The documentation for this class was generated from the following file: