ome-xml  5.6.0
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 
176  inline UnitsPressure&
178  {
179  this->value = rhs.value;
180  this->name = rhs.name;
181  return *this;
182  }
183 
189  inline
190  operator enum_value () const
191  {
192  return this->value;
193  }
194 
200  inline
201  operator const std::string& () const
202  {
203  return *this->name;
204  }
205 
207  typedef std::map<std::string, UnitsPressure::enum_value> string_map_type;
209  typedef std::map<UnitsPressure::enum_value, std::string> value_map_type;
210 
216  static const string_map_type&
217  strings();
218 
224  static const value_map_type&
225  values();
226 
227  private:
233  static const string_map_type&
235 
239  const std::string *name;
240  };
241 
249  inline bool
251  const UnitsPressure& rhs)
252  {
253  return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
254  }
255 
263  inline bool
265  const UnitsPressure::enum_value& rhs)
266  {
267  return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
268  }
269 
277  inline bool
279  const UnitsPressure& rhs)
280  {
281  return lhs == static_cast<UnitsPressure::enum_value>(rhs);
282  }
283 
291  inline bool
293  const std::string& rhs)
294  {
295  return static_cast<const std::string&>(lhs) == rhs;
296  }
297 
305  inline bool
306  operator== (const std::string& lhs,
307  const UnitsPressure& rhs)
308  {
309  return lhs == static_cast<const std::string&>(rhs);
310  }
311 
319  inline bool
321  const UnitsPressure& rhs)
322  {
323  return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
324  }
325 
333  inline bool
335  const UnitsPressure::enum_value& rhs)
336  {
337  return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
338  }
339 
347  inline bool
349  const UnitsPressure& rhs)
350  {
351  return lhs != static_cast<UnitsPressure::enum_value>(rhs);
352  }
353 
361  inline bool
363  const std::string& rhs)
364  {
365  return static_cast<const std::string&>(lhs) != rhs;
366  }
367 
375  inline bool
376  operator!= (const std::string& lhs,
377  const UnitsPressure& rhs)
378  {
379  return lhs != static_cast<const std::string&>(rhs);
380  }
381 
389  template<class charT, class traits>
390  inline std::basic_ostream<charT,traits>&
391  operator<< (std::basic_ostream<charT,traits>& os,
392  const UnitsPressure& enumeration)
393  {
394  return os << static_cast<const std::string&>(enumeration);
395  }
396 
404  template<class charT, class traits>
405  inline std::basic_istream<charT,traits>&
406  operator>> (std::basic_istream<charT,traits>& is,
407  UnitsPressure& enumeration)
408  {
409  std::string value;
410  is >> value;
411  if (is)
412  {
413  try
414  {
415  enumeration = UnitsPressure(value, false);
416  }
417  catch (const EnumerationException&)
418  {
419  is.setstate(std::ios::failbit);
420  }
421  }
422 
423  return is;
424  }
425 
426  }
427  }
428  }
429 }
430 
431 #endif // OME_XML_MODEL_PRIMITIVES_PRESSUREQUANTITY_H
432 
433 /*
434  * Local Variables:
435  * mode:C++
436  * End:
437  */
pound-force per square inch Imperial unit.
Definition: PressureQuantity.h:131
enum_value value
Enumeration value.
Definition: PressureQuantity.h:237
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:207
millipascal SI unit.
Definition: PressureQuantity.h:101
const std::string * name
Enumeration name.
Definition: PressureQuantity.h:239
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:209
exapascal SI unit.
Definition: PressureQuantity.h:79
UnitsPressure & operator=(const UnitsPressure &rhs)
Assignment operator.
Definition: PressureQuantity.h:177
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