| 1 | /*************************************************************************** |
| 2 | quantity.h |
| 3 | ------------------- |
| 4 | Generic quantity class |
| 5 | ------------------- |
| 6 | Copyright 2001-2008, David Johnson |
| 7 | All rights reserved. |
| 8 | |
| 9 | Redistribution and use in source and binary forms, with or without |
| 10 | modification, are permitted provided that the following conditions |
| 11 | are met: |
| 12 | |
| 13 | 1. Redistributions of source code must retain the above copyright |
| 14 | notice, this list of conditions and the following disclaimer. |
| 15 | |
| 16 | 2. Redistributions in binary form must reproduce the above copyright |
| 17 | notice, this list of conditions and the following disclaimer in the |
| 18 | documentation and/or other materials provided with the distribution. |
| 19 | |
| 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | ***************************************************************************/ |
| 32 | |
| 33 | #ifndef QUANTITY_H |
| 34 | #define QUANTITY_Hcxx . . $ `src/quantity.h:34:9`! |
| 35 | |
| 36 | #include <QMap> |
| 37 | #include <QString> |
| 38 | |
| 39 | typedef double (*Conversioncxx . . $ Conversion#)(double); |
| 40 | |
| 41 | /** |
| 42 | * A class to encapsulate the idea of a unit of measure. |
| 43 | * This is a slight variation of the Unit from Fowler's |
| 44 | * Quantity analysis pattern. |
| 45 | */ |
| 46 | class Unitcxx . . $ Unit# { |
| 47 | public: |
| 48 | // Constructor |
| 49 | Unitcxx . . $ Unit#Unit(c1427772cd1877b0).(const QStringcxx . . $ QString# &name, const QStringcxx . . $ QString# &symbol); |
| 50 | // Destructor |
| 51 | ~cxx . . $ Unit#`~Unit`(49f6e7a06ebc5aa8).Unitcxx . . $ Unit#(); |
| 52 | |
| 53 | // Return the full name of Unit |
| 54 | QStringcxx . . $ QString# namecxx . . $ Unit#name(6ef7b6c27b00b43d).() const; |
| 55 | // Return the symbol of Unit |
| 56 | QStringcxx . . $ QString# symbolcxx . . $ Unit#symbol(6ef7b6c27b00b43d).() const; |
| 57 | |
| 58 | // Add a conversion function for this Unit |
| 59 | void addConversioncxx . . $ Unit#addConversion(801a9fda5541d397).(const Unitcxx . . $ Unit# &to, const Conversioncxx . . $ Conversion# c); |
| 60 | // Can we convert to Unit? |
| 61 | bool convertablecxx . . $ Unit#convertable(98df4da96071e2dd).(const Unitcxx . . $ Unit# &u) const; |
| 62 | // Convert amount to Unit |
| 63 | double convertcxx . . $ Unit#convert(b6d5d998ccd8748b).(double amount, const Unitcxx . . $ Unit# &u) const; |
| 64 | |
| 65 | // Return pointer to Unit if it exists |
| 66 | static Unitcxx . . $ Unit#* unitcxx . . $ Unit#unit(1339fe18869d2daa).(const QStringcxx . . $ QString# &symbol); |
| 67 | |
| 68 | // equivalence operator |
| 69 | bool operatorcxx . . $ Unit#`operator==`(98df4da96071e2dd).==(const Unitcxx . . $ Unit# &u) const; |
| 70 | |
| 71 | private: |
| 72 | Unitcxx . . $ Unit#Unit(7d797d468467b63d).(const Unitcxx . . $ Unit#&); |
| 73 | Unitcxx . . $ Unit# operatorcxx . . $ Unit#`operator=`(26930dd132092a15).=(const Unitcxx . . $ Unit#&); |
| 74 | |
| 75 | private: |
| 76 | QStringcxx . . $ QString# name_cxx . . $ Unit#name_.; |
| 77 | QStringcxx . . $ QString# symbol_cxx . . $ Unit#symbol_.; |
| 78 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#,Conversioncxx . . $ Conversion#> conversions_cxx . . $ Unit#conversions_.; |
| 79 | static QMapcxx . . $ QMap#<QStringcxx . . $ QString#,Unitcxx . . $ Unit#*> units_cxx . . $ Unit#units_.; |
| 80 | }; |
| 81 | |
| 82 | /** |
| 83 | * A class to encapsulate the idea of a measurable quantity. |
| 84 | * This is a slight variation of Fowler's Quantity analysis pattern. |
| 85 | */ |
| 86 | class Quantitycxx . . $ Quantity# { |
| 87 | public: |
| 88 | // Constructor |
| 89 | Quantitycxx . . $ Quantity#Quantity(2884c06fcedbb8a7).(double amount, const Unitcxx . . $ Unit# &unit); |
| 90 | // Default constructor |
| 91 | Quantitycxx . . $ Quantity#Quantity(49f6e7a06ebc5aa8).(); |
| 92 | // Construct from string |
| 93 | Quantitycxx . . $ Quantity#Quantity(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit = genericcxx . . $ Quantity#generic.); |
| 94 | // Copy constructor |
| 95 | Quantitycxx . . $ Quantity#Quantity(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &q); |
| 96 | // Destructor |
| 97 | virtual ~cxx . . $ Quantity#`~Quantity`(ced63f7c635d850d).Quantitycxx . . $ Quantity#(); |
| 98 | |
| 99 | // Return quantity amount |
| 100 | double amountcxx . . $ Quantity#amount(21b6c25e127938e2).() const; |
| 101 | // Return converted amount |
| 102 | double amountcxx . . $ Quantity#amount(4f9526ff0a26ae42).(const Unitcxx . . $ Unit# &u) const; |
| 103 | // Return quantity unit |
| 104 | const Unitcxx . . $ Unit#& unitcxx . . $ Quantity#unit(1a4d46a500733df5).() const; |
| 105 | // Convert quantity to unit |
| 106 | void convertcxx . . $ Quantity#convert(7d797d468467b63d).(const Unitcxx . . $ Unit# &u); |
| 107 | // output quantity as a string |
| 108 | QStringcxx . . $ QString# toStringcxx . . $ Quantity#toString(3f3c3d0e9c0eb37f).(int prec=2) const; |
| 109 | // set quantity from string |
| 110 | void fromQStringcxx . . $ Quantity#fromQString(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit = genericcxx . . $ Quantity#generic.); |
| 111 | |
| 112 | // equivalence operator |
| 113 | bool operatorcxx . . $ Quantity#`operator==`(bc25df371a14fcfa).==(const Quantitycxx . . $ Quantity# &q) const; |
| 114 | |
| 115 | // assignment operators |
| 116 | Quantitycxx . . $ Quantity# &operatorcxx . . $ Quantity#`operator=`(3ef0f3c5d324c832).=(const Quantitycxx . . $ Quantity# &q); |
| 117 | Quantitycxx . . $ Quantity# &operatorcxx . . $ Quantity#`operator+=`(3ef0f3c5d324c832).+=(const Quantitycxx . . $ Quantity# &q); |
| 118 | Quantitycxx . . $ Quantity# &operatorcxx . . $ Quantity#`operator+=`(8b1a7c09b817248c).+=(const double d); |
| 119 | Quantitycxx . . $ Quantity# &operatorcxx . . $ Quantity#`operator-=`(3ef0f3c5d324c832).-=(const Quantitycxx . . $ Quantity# &q); |
| 120 | Quantitycxx . . $ Quantity# &operatorcxx . . $ Quantity#`operator-=`(8b1a7c09b817248c).-=(const double d); |
| 121 | |
| 122 | // arithmetic operators |
| 123 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator+(da6f4194d6fdede9).+(const Quantitycxx . . $ Quantity# &q1, const Quantitycxx . . $ Quantity# &q2); |
| 124 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator+(7ce341cf6c6d671f).+(const Quantitycxx . . $ Quantity# &q, const double d); |
| 125 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator+(2da6786b2108443a).+(const double d, const Quantitycxx . . $ Quantity# &q); |
| 126 | |
| 127 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator-(da6f4194d6fdede9).-(const Quantitycxx . . $ Quantity# &q1, const Quantitycxx . . $ Quantity# &q2); |
| 128 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator-(7ce341cf6c6d671f).-(const Quantitycxx . . $ Quantity# &q, const double d); |
| 129 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator-(2da6786b2108443a).-(const double d, const Quantitycxx . . $ Quantity# &q); |
| 130 | |
| 131 | friend Quantitycxx . . $ Quantity# operatorcxx . . $ operator-(8f3ce63407738f8).-(const Quantitycxx . . $ Quantity# &q); |
| 132 | |
| 133 | public: |
| 134 | static Unitcxx . . $ Unit# genericcxx . . $ Quantity#generic.; |
| 135 | |
| 136 | protected: |
| 137 | double amount_cxx . . $ Quantity#amount_.; |
| 138 | Unitcxx . . $ Unit# const* unit_cxx . . $ Quantity#unit_.; |
| 139 | }; |
| 140 | |
| 141 | class Weightcxx . . $ Weight# : public Quantitycxx . . $ Quantity# |
| 142 | { |
| 143 | public: |
| 144 | // Constructor |
| 145 | Weightcxx . . $ Weight#Weight(2884c06fcedbb8a7).(double amount, const Unitcxx . . $ Unit# &unit); |
| 146 | /// Default constructor |
| 147 | Weightcxx . . $ Weight#Weight(49f6e7a06ebc5aa8).(); |
| 148 | /// Construct from string |
| 149 | Weightcxx . . $ Weight#Weight(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit = poundcxx . . $ Weight#pound.); |
| 150 | // Copy constructor |
| 151 | Weightcxx . . $ Weight#Weight(fcd19e49ee58ab66).(const Weightcxx . . $ Weight# &w); |
| 152 | // Conversion constructor |
| 153 | Weightcxx . . $ Weight#Weight(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &q); |
| 154 | // Destructor |
| 155 | ~cxx . . $ Weight#`~Weight`(ced63f7c635d850d).Weightcxx . . $ Weight#(); |
| 156 | |
| 157 | public: |
| 158 | static Unitcxx . . $ Unit# gramcxx . . $ Weight#gram.; |
| 159 | static Unitcxx . . $ Unit# kilogramcxx . . $ Weight#kilogram.; |
| 160 | static Unitcxx . . $ Unit# ouncecxx . . $ Weight#ounce.; |
| 161 | static Unitcxx . . $ Unit# poundcxx . . $ Weight#pound.; |
| 162 | |
| 163 | private: |
| 164 | // initialize the weight units |
| 165 | static void initializecxx . . $ Weight#initialize(49f6e7a06ebc5aa8).(); |
| 166 | |
| 167 | private: |
| 168 | static bool initialized_cxx . . $ Weight#initialized_.; |
| 169 | }; |
| 170 | |
| 171 | class Volumecxx . . $ Volume# : public Quantitycxx . . $ Quantity# |
| 172 | { |
| 173 | public: |
| 174 | // Constructor |
| 175 | Volumecxx . . $ Volume#Volume(2884c06fcedbb8a7).(double amount, const Unitcxx . . $ Unit# &unit); |
| 176 | /// Default constructor |
| 177 | Volumecxx . . $ Volume#Volume(49f6e7a06ebc5aa8).(); |
| 178 | /// Construct from string |
| 179 | Volumecxx . . $ Volume#Volume(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit = galloncxx . . $ Volume#gallon.); |
| 180 | // Copy constructor |
| 181 | Volumecxx . . $ Volume#Volume(c63af3d33c27c499).(const Volumecxx . . $ Volume# &v); |
| 182 | // Conversion constructor |
| 183 | Volumecxx . . $ Volume#Volume(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &q); |
| 184 | // destructor |
| 185 | ~cxx . . $ Volume#`~Volume`(ced63f7c635d850d).Volumecxx . . $ Volume#(); |
| 186 | |
| 187 | public: |
| 188 | static Unitcxx . . $ Unit# barrelcxx . . $ Volume#barrel.; |
| 189 | static Unitcxx . . $ Unit# fluidouncecxx . . $ Volume#fluidounce.; |
| 190 | static Unitcxx . . $ Unit# galloncxx . . $ Volume#gallon.; |
| 191 | static Unitcxx . . $ Unit# hectolitercxx . . $ Volume#hectoliter.; |
| 192 | static Unitcxx . . $ Unit# litercxx . . $ Volume#liter.; |
| 193 | static Unitcxx . . $ Unit# millilitercxx . . $ Volume#milliliter.; |
| 194 | |
| 195 | private: |
| 196 | // initialize the weight units |
| 197 | static void initializecxx . . $ Volume#initialize(49f6e7a06ebc5aa8).(); |
| 198 | |
| 199 | private: |
| 200 | static bool initialized_cxx . . $ Volume#initialized_.; |
| 201 | }; |
| 202 | |
| 203 | class Temperaturecxx . . $ Temperature# : public Quantitycxx . . $ Quantity# |
| 204 | { |
| 205 | public: |
| 206 | // Constructor |
| 207 | Temperaturecxx . . $ Temperature#Temperature(2884c06fcedbb8a7).(double amount, const Unitcxx . . $ Unit# &unit); |
| 208 | /// Default constructor |
| 209 | Temperaturecxx . . $ Temperature#Temperature(49f6e7a06ebc5aa8).(); |
| 210 | /// Construct from string |
| 211 | Temperaturecxx . . $ Temperature#Temperature(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit = fahrenheitcxx . . $ Temperature#fahrenheit.); |
| 212 | // Copy constructor |
| 213 | Temperaturecxx . . $ Temperature#Temperature(b07d3720609be14a).(const Temperaturecxx . . $ Temperature# &t); |
| 214 | // Conversion constructor |
| 215 | Temperaturecxx . . $ Temperature#Temperature(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &q); |
| 216 | // destructor |
| 217 | ~cxx . . $ Temperature#`~Temperature`(ced63f7c635d850d).Temperaturecxx . . $ Temperature#(); |
| 218 | |
| 219 | public: |
| 220 | static Unitcxx . . $ Unit# fahrenheitcxx . . $ Temperature#fahrenheit.; |
| 221 | static Unitcxx . . $ Unit# celsiuscxx . . $ Temperature#celsius.; |
| 222 | |
| 223 | private: |
| 224 | // initialize the temperature units |
| 225 | static void initializecxx . . $ Temperature#initialize(49f6e7a06ebc5aa8).(); |
| 226 | |
| 227 | private: |
| 228 | static bool initialized_cxx . . $ Temperature#initialized_.; |
| 229 | }; |
| 230 | |
| 231 | // Conversion Prototypes //////////////////////////////////////////////////// |
| 232 | |
| 233 | double gram2kilogramcxx . . $ gram2kilogram(447c67c6676f75c3).(double value); |
| 234 | double gram2ouncecxx . . $ gram2ounce(447c67c6676f75c3).(double value); |
| 235 | double gram2poundcxx . . $ gram2pound(447c67c6676f75c3).(double value); |
| 236 | double kilogram2gramcxx . . $ kilogram2gram(447c67c6676f75c3).(double value); |
| 237 | double kilogram2ouncecxx . . $ kilogram2ounce(447c67c6676f75c3).(double value); |
| 238 | double kilogram2poundcxx . . $ kilogram2pound(447c67c6676f75c3).(double value); |
| 239 | double ounce2gramcxx . . $ ounce2gram(447c67c6676f75c3).(double value); |
| 240 | double ounce2kilogramcxx . . $ ounce2kilogram(447c67c6676f75c3).(double value); |
| 241 | double ounce2poundcxx . . $ ounce2pound(447c67c6676f75c3).(double value); |
| 242 | double pound2gramcxx . . $ pound2gram(447c67c6676f75c3).(double value); |
| 243 | double pound2kilogramcxx . . $ pound2kilogram(447c67c6676f75c3).(double value); |
| 244 | double pound2ouncecxx . . $ pound2ounce(447c67c6676f75c3).(double value); |
| 245 | |
| 246 | double barrel2fluidouncecxx . . $ barrel2fluidounce(447c67c6676f75c3).(double value); |
| 247 | double barrel2galloncxx . . $ barrel2gallon(447c67c6676f75c3).(double value); |
| 248 | double barrel2hectolitercxx . . $ barrel2hectoliter(447c67c6676f75c3).(double value); |
| 249 | double barrel2litercxx . . $ barrel2liter(447c67c6676f75c3).(double value); |
| 250 | double barrel2millilitercxx . . $ barrel2milliliter(447c67c6676f75c3).(double value); |
| 251 | double fluidounce2barrelcxx . . $ fluidounce2barrel(447c67c6676f75c3).(double value); |
| 252 | double fluidounce2galloncxx . . $ fluidounce2gallon(447c67c6676f75c3).(double value); |
| 253 | double fluidounce2hectolitercxx . . $ fluidounce2hectoliter(447c67c6676f75c3).(double value); |
| 254 | double fluidounce2litercxx . . $ fluidounce2liter(447c67c6676f75c3).(double value); |
| 255 | double fluidounce2millilitercxx . . $ fluidounce2milliliter(447c67c6676f75c3).(double value); |
| 256 | double gallon2barrelcxx . . $ gallon2barrel(447c67c6676f75c3).(double value); |
| 257 | double gallon2fluidouncecxx . . $ gallon2fluidounce(447c67c6676f75c3).(double value); |
| 258 | double gallon2hectolitercxx . . $ gallon2hectoliter(447c67c6676f75c3).(double value); |
| 259 | double gallon2litercxx . . $ gallon2liter(447c67c6676f75c3).(double value); |
| 260 | double gallon2millilitercxx . . $ gallon2milliliter(447c67c6676f75c3).(double value); |
| 261 | double hectoliter2barrelcxx . . $ hectoliter2barrel(447c67c6676f75c3).(double value); |
| 262 | double hectoliter2fluidouncecxx . . $ hectoliter2fluidounce(447c67c6676f75c3).(double value); |
| 263 | double hectoliter2galloncxx . . $ hectoliter2gallon(447c67c6676f75c3).(double value); |
| 264 | double hectoliter2litercxx . . $ hectoliter2liter(447c67c6676f75c3).(double value); |
| 265 | double hectoliter2millilitercxx . . $ hectoliter2milliliter(447c67c6676f75c3).(double value); |
| 266 | double liter2barrelcxx . . $ liter2barrel(447c67c6676f75c3).(double value); |
| 267 | double liter2fluidouncecxx . . $ liter2fluidounce(447c67c6676f75c3).(double value); |
| 268 | double liter2galloncxx . . $ liter2gallon(447c67c6676f75c3).(double value); |
| 269 | double liter2hectolitercxx . . $ liter2hectoliter(447c67c6676f75c3).(double value); |
| 270 | double liter2millilitercxx . . $ liter2milliliter(447c67c6676f75c3).(double value); |
| 271 | double milliliter2barrelcxx . . $ milliliter2barrel(447c67c6676f75c3).(double value); |
| 272 | double milliliter2fluidouncecxx . . $ milliliter2fluidounce(447c67c6676f75c3).(double value); |
| 273 | double milliliter2galloncxx . . $ milliliter2gallon(447c67c6676f75c3).(double value); |
| 274 | double milliliter2hectolitercxx . . $ milliliter2hectoliter(447c67c6676f75c3).(double value); |
| 275 | double milliliter2litercxx . . $ milliliter2liter(447c67c6676f75c3).(double value); |
| 276 | |
| 277 | double fahrenheit2celsiuscxx . . $ fahrenheit2celsius(447c67c6676f75c3).(double value); |
| 278 | double celsius2fahrenheitcxx . . $ celsius2fahrenheit(447c67c6676f75c3).(double value); |
| 279 | |
| 280 | // Inlined Methods ////////////////////////////////////////////////////////// |
| 281 | |
| 282 | inline QStringcxx . . $ QString# Unitcxx . . $ Unit#::namecxx . . $ Unit#name(6ef7b6c27b00b43d).() const |
| 283 | { return name_cxx . . $ QString#QString(132dd6869045752b).; } |
| 284 | |
| 285 | inline QStringcxx . . $ QString# Unitcxx . . $ Unit#::symbolcxx . . $ Unit#symbol(6ef7b6c27b00b43d).() const |
| 286 | { return symbol_cxx . . $ Unit#symbol_.; } |
| 287 | |
| 288 | inline bool Unitcxx . . $ Unit#::convertablecxx . . $ Unit#convertable(98df4da96071e2dd).(const Unitcxx . . $ Unit# &u) const |
| 289 | { return (conversions_cxx . . $ Unit#conversions_..containscxx . . $ QMap#contains(8877ebe272b9620d).(u.namecxx . . $ Unit#name(6ef7b6c27b00b43d).())); } |
| 290 | |
| 291 | inline Quantitycxx . . $ Quantity#::Quantitycxx . . $ Quantity#Quantity(2884c06fcedbb8a7).(double amount, const Unitcxx . . $ Unit# &unit) |
| 292 | : amount_cxx . . $ Quantity#amount_.(amount), unit_cxx . . $ Quantity#unit_.(&unit) { ; } |
| 293 | |
| 294 | inline Quantitycxx . . $ Quantity#::Quantitycxx . . $ Quantity#Quantity(49f6e7a06ebc5aa8).() |
| 295 | : amount_cxx . . $ Quantity#amount_.(0.0), unit_cxx . . $ Quantity#unit_.(&genericcxx . . $ Quantity#generic.) { ; } |
| 296 | |
| 297 | inline Quantitycxx . . $ Quantity#::Quantitycxx . . $ Quantity#Quantity(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit) |
| 298 | : amount_cxx . . $ Quantity#amount_.(0.0), unit_cxx . . $ Quantity#unit_.(&defaultunit) { fromQStringcxx . . $ Quantity#fromQString(ff9d45e2e9bdc1d9).(from, defaultunit); } |
| 299 | |
| 300 | inline Quantitycxx . . $ Quantity#::Quantitycxx . . $ Quantity#Quantity(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &q) |
| 301 | : amount_cxx . . $ Quantity#amount_.(q.amount_cxx . . $ Quantity#amount_.), unit_cxx . . $ Quantity#unit_.(q.unit_cxx . . $ Quantity#unit_.) { ; } |
| 302 | |
| 303 | inline Quantitycxx . . $ Quantity#::~cxx . . $ Quantity#`~Quantity`(ced63f7c635d850d).Quantitycxx . . $ Quantity#() |
| 304 | { ; } |
| 305 | |
| 306 | inline Quantitycxx . . $ Quantity# &Quantitycxx . . $ Quantity#::operatorcxx . . $ Quantity#`operator+=`(8b1a7c09b817248c).+=(const double d) |
| 307 | { amount_cxx . . $ Quantity#amount_. += d; return *this; } |
| 308 | |
| 309 | inline Quantitycxx . . $ Quantity# operatorcxx . . $ operator+(2da6786b2108443a).+(const double d, const Quantitycxx . . $ Quantity# &q) |
| 310 | { return (q +cxx . . $ operator+(7ce341cf6c6d671f). d); } |
| 311 | |
| 312 | inline Quantitycxx . . $ Quantity# &Quantitycxx . . $ Quantity#::operatorcxx . . $ Quantity#`operator-=`(8b1a7c09b817248c).-=(const double d) |
| 313 | { amount_cxx . . $ Quantity#amount_. -= d; return *this; } |
| 314 | |
| 315 | inline double Quantitycxx . . $ Quantity#::amountcxx . . $ Quantity#amount(21b6c25e127938e2).() const |
| 316 | { return amount_cxx . . $ Quantity#amount_.; } |
| 317 | |
| 318 | inline double Quantitycxx . . $ Quantity#::amountcxx . . $ Quantity#amount(4f9526ff0a26ae42).(const Unitcxx . . $ Unit# &u) const |
| 319 | { return (unit_cxx . . $ Quantity#unit_.->convertcxx . . $ Unit#convert(b6d5d998ccd8748b).(amount_cxx . . $ Quantity#amount_., u)); } |
| 320 | |
| 321 | inline const Unitcxx . . $ Unit#& Quantitycxx . . $ Quantity#::unitcxx . . $ Quantity#unit(1a4d46a500733df5).() const |
| 322 | { return *unit_cxx . . $ Quantity#unit_.; } |
| 323 | |
| 324 | inline Weightcxx . . $ Weight#::Weightcxx . . $ Weight#Weight(fcd19e49ee58ab66).(const Weightcxx . . $ Weight# &w) |
| 325 | : Quantitycxx . . $ Quantity#Quantity(41e9971a986bf65f).(w) { ; } |
| 326 | |
| 327 | inline Weightcxx . . $ Weight#::Weightcxx . . $ Weight#Weight(49f6e7a06ebc5aa8).() |
| 328 | : Quantitycxx . . $ Quantity#Quantity(2884c06fcedbb8a7).(0.0, poundcxx . . $ Weight#pound.) { ; } |
| 329 | |
| 330 | inline Weightcxx . . $ Weight#::Weightcxx . . $ Weight#Weight(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit) |
| 331 | : Quantitycxx . . $ Quantity#(from, defaultunit) { ; } |
| 332 | |
| 333 | inline Weightcxx . . $ Weight#::~cxx . . $ Weight#`~Weight`(ced63f7c635d850d).Weightcxx . . $ Weight#() |
| 334 | { ; } |
| 335 | |
| 336 | inline Volumecxx . . $ Volume#::Volumecxx . . $ Volume#Volume(c63af3d33c27c499).(const Volumecxx . . $ Volume# &v) |
| 337 | : Quantitycxx . . $ Quantity#(v) { ; } |
| 338 | |
| 339 | inline Volumecxx . . $ Volume#::Volumecxx . . $ Volume#Volume(49f6e7a06ebc5aa8).() |
| 340 | : Quantitycxx . . $ Quantity#Quantity(2884c06fcedbb8a7).(0.0, galloncxx . . $ Volume#gallon.) { ; } |
| 341 | |
| 342 | inline Volumecxx . . $ Volume#::Volumecxx . . $ Volume#Volume(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit) |
| 343 | : Quantitycxx . . $ Quantity#Quantity(ff9d45e2e9bdc1d9).(from, defaultunit) { ; } |
| 344 | |
| 345 | inline Volumecxx . . $ Volume#::~cxx . . $ Volume#`~Volume`(ced63f7c635d850d).Volumecxx . . $ Volume#() |
| 346 | { ; } |
| 347 | |
| 348 | inline Temperaturecxx . . $ Temperature#::Temperaturecxx . . $ Temperature#Temperature(b07d3720609be14a).(const Temperaturecxx . . $ Temperature# &t) |
| 349 | : Quantitycxx . . $ Quantity#(t) { ; } |
| 350 | |
| 351 | inline Temperaturecxx . . $ Temperature#::Temperaturecxx . . $ Temperature#Temperature(49f6e7a06ebc5aa8).() |
| 352 | : Quantitycxx . . $ Quantity#(0.0, fahrenheitcxx . . $ Temperature#fahrenheit.) { ; } |
| 353 | |
| 354 | inline Temperaturecxx . . $ Temperature#::Temperaturecxx . . $ Temperature#Temperature(ff9d45e2e9bdc1d9).(const QStringcxx . . $ QString# &from, const Unitcxx . . $ Unit# &defaultunit) |
| 355 | : Quantitycxx . . $ Quantity#Quantity(ff9d45e2e9bdc1d9).(from, defaultunit) { ; } |
| 356 | |
| 357 | inline Temperaturecxx . . $ Temperature#::~cxx . . $ Temperature#`~Temperature`(ced63f7c635d850d).Temperaturecxx . . $ Temperature#() |
| 358 | { ; } |
| 359 | |
| 360 | #endif // QUANTITY_H |