ome-xml  5.5.1
PressureQuantity.h
1 /*
2  * #%L
3  * OME-XML C++ library for working with OME-XML metadata structures.
4  * %%
5  * Copyright © 2006 - 2016 Open Microscopy Environment:
6  * - Massachusetts Institute of Technology
7  * - National Institutes of Health
8  * - University of Dundee
9  * - Board of Regents of the University of Wisconsin-Madison
10  * - Glencoe Software, Inc.
11  * %%
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * The views and conclusions contained in the software and documentation are
34  * those of the authors and should not be interpreted as representing official
35  * policies, either expressed or implied, of any organization.
36  * #L%
37  */
38 
39 /*─────────────────────────────────────────────────────────────────────────────
40  *
41  * THIS IS AUTOMATICALLY GENERATED CODE. DO NOT MODIFY.
42  *
43  *─────────────────────────────────────────────────────────────────────────────
44  */
45 
46 #ifndef OME_XML_MODEL_PRIMITIVES_PRESSUREQUANTITY_H
47 #define OME_XML_MODEL_PRIMITIVES_PRESSUREQUANTITY_H
48 
49 #include <ostream>
50 #include <string>
51 
52 #include <ome/common/log.h>
53 
54 #include <ome/xml/model/primitives/Quantity.h>
55 
56 namespace ome
57 {
58  namespace xml
59  {
60  namespace model
61  {
62  namespace primitives
63  {
64 
69  {
70  public:
73  {
138  };
139 
146 
161  UnitsPressure (const std::string& name, bool strict = true);
162 
168  UnitsPressure (const UnitsPressure& original);
169 
174  inline UnitsPressure&
176  {
177  this->value = rhs.value;
178  this->name = rhs.name;
179  return *this;
180  }
181 
187  inline
188  operator enum_value () const
189  {
190  return this->value;
191  }
192 
198  inline
199  operator const std::string& () const
200  {
201  return *this->name;
202  }
203 
205  typedef std::map<std::string, UnitsPressure::enum_value> string_map_type;
207  typedef std::map<UnitsPressure::enum_value, std::string> value_map_type;
208 
214  static const string_map_type&
215  strings();
216 
222  static const value_map_type&
223  values();
224 
225  private:
231  static const string_map_type&
233 
237  const std::string *name;
238  };
239 
247  inline bool
249  const UnitsPressure& rhs)
250  {
251  return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
252  }
253 
261  inline bool
263  const UnitsPressure::enum_value& rhs)
264  {
265  return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
266  }
267 
275  inline bool
277  const UnitsPressure& rhs)
278  {
279  return lhs == static_cast<UnitsPressure::enum_value>(rhs);
280  }
281 
289  inline bool
291  const std::string& rhs)
292  {
293  return static_cast<const std::string&>(lhs) == rhs;
294  }
295 
303  inline bool
304  operator== (const std::string& lhs,
305  const UnitsPressure& rhs)
306  {
307  return lhs == static_cast<const std::string&>(rhs);
308  }
309 
317  inline bool
319  const UnitsPressure& rhs)
320  {
321  return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
322  }
323 
331  inline bool
333  const UnitsPressure::enum_value& rhs)
334  {
335  return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
336  }
337 
345  inline bool
347  const UnitsPressure& rhs)
348  {
349  return lhs != static_cast<UnitsPressure::enum_value>(rhs);
350  }
351 
359  inline bool
361  const std::string& rhs)
362  {
363  return static_cast<const std::string&>(lhs) != rhs;
364  }
365 
373  inline bool
374  operator!= (const std::string& lhs,
375  const UnitsPressure& rhs)
376  {
377  return lhs != static_cast<const std::string&>(rhs);
378  }
379 
387  template<class charT, class traits>
388  inline std::basic_ostream<charT,traits>&
389  operator<< (std::basic_ostream<charT,traits>& os,
390  const UnitsPressure& enumeration)
391  {
392  return os << static_cast<const std::string&>(enumeration);
393  }
394 
402  template<class charT, class traits>
403  inline std::basic_istream<charT,traits>&
404  operator>> (std::basic_istream<charT,traits>& is,
405  UnitsPressure& enumeration)
406  {
407  std::string value;
408  is >> value;
409  if (is)
410  {
411  try
412  {
413  enumeration = UnitsPressure(value, false);
414  }
415  catch (const EnumerationException&)
416  {
417  is.setstate(std::ios::failbit);
418  }
419  }
420 
421  return is;
422  }
423 
424  }
425  }
426  }
427 }
428 
429 #endif // OME_XML_MODEL_PRIMITIVES_PRESSUREQUANTITY_H
430 
431 /*
432  * Local Variables:
433  * mode:C++
434  * End:
435  */
pound-force per square inch Imperial unit.
Definition: PressureQuantity.h:131
enum_value value
Enumeration value.
Definition: PressureQuantity.h:235
torr SI-derived unit.
Definition: PressureQuantity.h:133
decipascal SI unit.
Definition: PressureQuantity.h:97
attopascal SI unit.
Definition: PressureQuantity.h:111
zeptopascal SI unit.
Definition: PressureQuantity.h:113
millitorr SI-derived unit.
Definition: PressureQuantity.h:135
megabar SI-derived unit.
Definition: PressureQuantity.h:119
bool operator!=(const Color &lhs, const Color &rhs)
Compare two Color objects for non-equality.
Definition: Color.h:392
bar SI-derived unit.
Definition: PressureQuantity.h:117
megapascal SI unit.
Definition: PressureQuantity.h:87
static const string_map_type & strings()
Get a map of valid string names and enum values.
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
femtopascal SI unit.
Definition: PressureQuantity.h:109
std::map< std::string, UnitsPressure::enum_value > string_map_type
String map type.
Definition: PressureQuantity.h:205
millipascal SI unit.
Definition: PressureQuantity.h:101
const std::string * name
Enumeration name.
Definition: PressureQuantity.h:237
decapascal SI unit.
Definition: PressureQuantity.h:93
yoctopascal SI unit.
Definition: PressureQuantity.h:115
static const value_map_type & values()
Get a map of valid enum values and string names.
Open Microscopy Environment C++ implementation.
centipascal SI unit.
Definition: PressureQuantity.h:99
bool operator==(const Color &lhs, const Color &rhs)
Compare two Color objects for equality.
Definition: Color.h:322
centibar SI-derived unit.
Definition: PressureQuantity.h:125
yottapascal SI unit.
Definition: PressureQuantity.h:75
micropascal SI unit.
Definition: PressureQuantity.h:103
hectopascal SI unit.
Definition: PressureQuantity.h:91
petapascal SI unit.
Definition: PressureQuantity.h:81
standard atmosphere SI-derived unit.
Definition: PressureQuantity.h:129
UnitsPressure(enum_value value)
Construct a UnitsPressure quantity by an enumeration value.
millibar SI-derived unit.
Definition: PressureQuantity.h:127
UnitsPressure enumeration.
Definition: PressureQuantity.h:68
millimetre of mercury SI-derived unit
Definition: PressureQuantity.h:137
std::map< UnitsPressure::enum_value, std::string > value_map_type
Value map type.
Definition: PressureQuantity.h:207
exapascal SI unit.
Definition: PressureQuantity.h:79
UnitsPressure & operator=(const UnitsPressure &rhs)
Assignment operator.
Definition: PressureQuantity.h:175
pascal SI unit. Note the C++ enum is mixed case due to PASCAL being a macro used by the Microsoft C a...
Definition: PressureQuantity.h:95
decibar SI-derived unit.
Definition: PressureQuantity.h:123
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, Color &color)
Set Color from input stream.
Definition: Color.h:478
picopascal SI unit.
Definition: PressureQuantity.h:107
terapascal SI unit.
Definition: PressureQuantity.h:83
enum_value
Enumeration values.
Definition: PressureQuantity.h:72
kilobar SI-derived unit.
Definition: PressureQuantity.h:121
gigapascal SI unit.
Definition: PressureQuantity.h:85
kilopascal SI unit.
Definition: PressureQuantity.h:89
zettapascal SI unit.
Definition: PressureQuantity.h:77
nanopascal SI unit.
Definition: PressureQuantity.h:105