CARMA C++
carma::services::Pressure Class Reference

The Pressure class can represent any pressure in any units. More...

#include <carma/services/Pressure.h>

Inheritance diagram for carma::services::Pressure:
carma::services::ConformableQuantity

Public Member Functions

double atmosphere () const
 Convenience method that returns the value of this pressure in atmospheres. More...
 
double millibar () const
 Convenience method that returns the value of this pressure in millibars. More...
 
const Pressure operator+ (const Pressure &pressure) const
 Add two Pressures. More...
 
Pressureoperator+= (const Pressure &pressure)
 Increment Pressure. More...
 
const Pressure operator- (const Pressure &pressure) const
 Subtract two Pressures. More...
 
Pressureoperator-= (const Pressure &pressure)
 Decrement Pressure. More...
 
bool operator< (const Pressure &pressure) const
 Compare two pressures. More...
 
bool operator> (const Pressure &pressure) const
 Compare two pressures. More...
 
 Pressure (double value, const std::string &units)
 Construct an Pressure given a value and units. More...
 
virtual ~Pressure ()
 Destructor. More...
 
- Public Member Functions inherited from carma::services::ConformableQuantity
 ConformableQuantity (double value, const std::string &units)
 Construct an ConformableQuantity given a value and units. More...
 
virtual double convert (const std::string &convertTo) const
 Converts this quantity to any conformable units. More...
 
virtual std::string getUnits () const
 
double getValue () const
 
virtual const ConformableQuantity operator+ (const ConformableQuantity &quantity) const
 Add two ConformableQuantities. More...
 
virtual ConformableQuantityoperator+= (const ConformableQuantity &quantity)
 Add ConformableQuantity to itself. More...
 
virtual const ConformableQuantity operator- (const ConformableQuantity &quantity) const
 Subtract two ConformableQuantities. More...
 
virtual ConformableQuantityoperator-= (const ConformableQuantity &quantity)
 Subtract ConformableQuantity from itself. More...
 
virtual void reset (double value, const std::string &units)
 Reset method to change value and/or units. More...
 
virtual ~ConformableQuantity ()
 Destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from carma::services::ConformableQuantity
Units u_
 Used for converting between units. More...
 

Detailed Description

The Pressure class can represent any pressure in any units.

It uses the Units class internally to handle conversion of any pressure unit to any other pressure unit. For example,
Pressure pressure1(100.0,"mbar")
Pressure pressure2(1.23,"atmospheres")
both pressure1 and pressure2 represent the same physical quantity. Binary operations + and - are supported, as is the stream operation <<.

See Also
carma::services::ConformableQuantity

Definition at line 38 of file Pressure.h.

Constructor & Destructor Documentation

carma::services::Pressure::Pressure ( double  value,
const std::string &  units 
)

Construct an Pressure given a value and units.

Parameters
valueThe value of this pressure
unitsThe units of the value.
virtual carma::services::Pressure::~Pressure ( )
virtual

Destructor.

Member Function Documentation

double carma::services::Pressure::atmosphere ( ) const

Convenience method that returns the value of this pressure in atmospheres.

Returns
pressure value in units of the standard atmosphere
double carma::services::Pressure::millibar ( ) const

Convenience method that returns the value of this pressure in millibars.

Returns
pressure value in millibar
const Pressure carma::services::Pressure::operator+ ( const Pressure pressure) const

Add two Pressures.

Returns
an Pressure with millibar units
Exceptions
ConformabilityException
Pressure& carma::services::Pressure::operator+= ( const Pressure pressure)

Increment Pressure.

Returns
incremented Pressure
const Pressure carma::services::Pressure::operator- ( const Pressure pressure) const

Subtract two Pressures.

Returns
an Pressure with millibar units
Exceptions
ConformabilityException
Pressure& carma::services::Pressure::operator-= ( const Pressure pressure)

Decrement Pressure.

Returns
decremented Pressure
bool carma::services::Pressure::operator< ( const Pressure pressure) const

Compare two pressures.

Returns
boolean saying whether lhs pressure is less than rhs pressure
Exceptions
ConformabilityException
bool carma::services::Pressure::operator> ( const Pressure pressure) const

Compare two pressures.

Returns
boolean saying whether lhs pressure is greater than rhs pressure
Exceptions
ConformabilityException

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