CARMA C++
Pressure.h
Go to the documentation of this file.
1 // $Id: Pressure.h,v 1.2 2014/04/02 23:11:12 iws Exp $
2 
13 #ifndef CARMA_SERVICES_PRESSURE_H
14 #define CARMA_SERVICES_PRESSURE_H
15 
17 #include "carma/services/Units.h"
18 #include <string>
19 
20 namespace carma {
21  namespace services {
38  class Pressure : public ConformableQuantity {
39  public:
40 
46  Pressure(double value, const std::string& units);
47 
49  virtual ~Pressure();
50 
56  double millibar() const;
57 
63  double atmosphere() const;
64 
70  const Pressure operator+(const Pressure& pressure) const;
71 
77  const Pressure operator-(const Pressure& pressure) const;
78 
85  bool operator<(const Pressure &pressure) const;
86 
93  bool operator>(const Pressure &pressure) const;
94 
99  Pressure &operator+=(const Pressure &pressure);
100 
105  Pressure &operator-=(const Pressure &pressure);
106 
107  };
111 std::ostream& operator<<(std::ostream& os,
112  const carma::services::Pressure& pressure);
113 
114  }
115 }
116 
117 #endif //CARMA_SERVICES_PRESSURE_H
The ConformableQuantity class can represent any quantity that can be expressed in many units...
double atmosphere() const
Convenience method that returns the value of this pressure in atmospheres.
bool operator<(const Pressure &pressure) const
Compare two pressures.
virtual ~Pressure()
Destructor.
const Pressure operator-(const Pressure &pressure) const
Subtract two Pressures.
Pressure & operator-=(const Pressure &pressure)
Decrement Pressure.
const Pressure operator+(const Pressure &pressure) const
Add two Pressures.
The Pressure class can represent any pressure in any units.
Definition: Pressure.h:38
double millibar() const
Convenience method that returns the value of this pressure in millibars.
bool operator>(const Pressure &pressure) const
Compare two pressures.
Pressure & operator+=(const Pressure &pressure)
Increment Pressure.
Parent class for representations of quantities that can have conformable units, e.g.
std::ostream & operator<<(std::ostream &os, const carma::services::Angle &angle)
Define the &lt;&lt; operator to allow, e.g.
Pressure(double value, const std::string &units)
Construct an Pressure given a value and units.