ome-xml  5.2.0-m5
UnitsPressure.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_ENUMS_UNITSPRESSURE_H
47 #define OME_XML_MODEL_ENUMS_UNITSPRESSURE_H
48 
49 #include <ostream>
50 #include <map>
51 #include <string>
52 
53 #include <ome/common/log.h>
54 
55 #include <ome/xml/model/enums/EnumerationException.h>
56 
57 #include <ome/xml/model/primitives/Quantity.h>
58 
59 #ifdef _MSC_VER
60 #pragma push_macro("PASCAL")
61 #undef PASCAL
62 #endif
63 
64 // All values in the UnitsPressure enumeration.
65 #define OME_XML_MODEL_ENUMS_UNITSPRESSURE_VALUES (YOTTAPASCAL)(ZETTAPASCAL)(EXAPASCAL)(PETAPASCAL)(TERAPASCAL)(GIGAPASCAL)(MEGAPASCAL)(KILOPASCAL)(HECTOPASCAL)(DECAPASCAL)(PASCAL)(DECIPASCAL)(CENTIPASCAL)(MILLIPASCAL)(MICROPASCAL)(NANOPASCAL)(PICOPASCAL)(FEMTOPASCAL)(ATTOPASCAL)(ZEPTOPASCAL)(YOCTOPASCAL)(BAR)(MEGABAR)(KILOBAR)(DECIBAR)(CENTIBAR)(MILLIBAR)(ATMOSPHERE)(PSI)(TORR)(MILLITORR)(MMHG)
66 
67 namespace ome
68 {
69  namespace xml
70  {
71  namespace model
72  {
73  namespace enums
74  {
75 
80  {
81  public:
84  {
213  };
214 
221 
236  UnitsPressure (const std::string& name, bool strict = true);
237 
243  UnitsPressure (const UnitsPressure& original);
244 
249  inline UnitsPressure&
251  {
252  this->value = rhs.value;
253  this->name = rhs.name;
254  return *this;
255  }
256 
262  inline
263  operator enum_value () const
264  {
265  return this->value;
266  }
267 
273  inline
274  operator const std::string& () const
275  {
276  return *this->name;
277  }
278 
280  typedef std::map<std::string, UnitsPressure::enum_value> string_map_type;
282  typedef std::map<UnitsPressure::enum_value, std::string> value_map_type;
283 
289  static const string_map_type&
290  strings();
291 
297  static const value_map_type&
298  values();
299 
300  private:
306  static const string_map_type&
308 
312  const std::string *name;
313  };
314 
322  inline bool
324  const UnitsPressure& rhs)
325  {
326  return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
327  }
328 
336  inline bool
338  const UnitsPressure::enum_value& rhs)
339  {
340  return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
341  }
342 
350  inline bool
352  const UnitsPressure& rhs)
353  {
354  return lhs == static_cast<UnitsPressure::enum_value>(rhs);
355  }
356 
364  inline bool
366  const std::string& rhs)
367  {
368  return static_cast<const std::string&>(lhs) == rhs;
369  }
370 
378  inline bool
379  operator== (const std::string& lhs,
380  const UnitsPressure& rhs)
381  {
382  return lhs == static_cast<const std::string&>(rhs);
383  }
384 
392  inline bool
394  const UnitsPressure& rhs)
395  {
396  return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
397  }
398 
406  inline bool
408  const UnitsPressure::enum_value& rhs)
409  {
410  return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
411  }
412 
420  inline bool
422  const UnitsPressure& rhs)
423  {
424  return lhs != static_cast<UnitsPressure::enum_value>(rhs);
425  }
426 
434  inline bool
436  const std::string& rhs)
437  {
438  return static_cast<const std::string&>(lhs) != rhs;
439  }
440 
448  inline bool
449  operator!= (const std::string& lhs,
450  const UnitsPressure& rhs)
451  {
452  return lhs != static_cast<const std::string&>(rhs);
453  }
454 
462  template<class charT, class traits>
463  inline std::basic_ostream<charT,traits>&
464  operator<< (std::basic_ostream<charT,traits>& os,
465  const UnitsPressure& enumeration)
466  {
467  return os << static_cast<const std::string&>(enumeration);
468  }
469 
477  template<class charT, class traits>
478  inline std::basic_istream<charT,traits>&
479  operator>> (std::basic_istream<charT,traits>& is,
480  UnitsPressure& enumeration)
481  {
482  std::string value;
483  is >> value;
484  if (is)
485  {
486  try
487  {
488  enumeration = UnitsPressure(value, false);
489  }
490  catch (const EnumerationException&)
491  {
492  is.setstate(std::ios::failbit);
493  }
494  }
495 
496  return is;
497  }
498 
499  }
500 
501  namespace primitives
502  {
503 
513  Quantity< ome::xml::model::enums::UnitsPressure>
514  convert(const Quantity< ome::xml::model::enums::UnitsPressure>& quantity,
515  Quantity< ome::xml::model::enums::UnitsPressure>::unit_type unit);
516 
517  }
518 
519  }
520  }
521 }
522 
523 #ifdef _MSC_VER
524 #pragma pop_macro("PASCAL")
525 #endif
526 
527 #endif // OME_XML_MODEL_ENUMS_UNITSPRESSURE_H
528 
529 /*
530  * Local Variables:
531  * mode:C++
532  * End:
533  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:384
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:298
nanopascal SI unit.
Definition: UnitsPressure.h:148
centibar SI-derived unit.
Definition: UnitsPressure.h:188
decapascal SI unit.
Definition: UnitsPressure.h:124
yottapascal SI unit.
Definition: UnitsPressure.h:88
UnitsPressure enumeration.
Definition: UnitsPressure.h:79
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
megabar SI-derived unit.
Definition: UnitsPressure.h:176
decipascal SI unit.
Definition: UnitsPressure.h:132
enum_value value
Enumeration value.
Definition: UnitsPressure.h:310
terapascal SI unit.
Definition: UnitsPressure.h:104
attopascal SI unit.
Definition: UnitsPressure.h:160
millitorr SI-derived unit.
Definition: UnitsPressure.h:208
decibar SI-derived unit.
Definition: UnitsPressure.h:184
hectopascal SI unit.
Definition: UnitsPressure.h:120
picopascal SI unit.
Definition: UnitsPressure.h:152
exapascal SI unit.
Definition: UnitsPressure.h:96
millimetre of mercury SI-derived unit
Definition: UnitsPressure.h:212
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: UnitsPressure.cpp:228
kilopascal SI unit.
Definition: UnitsPressure.h:116
yoctopascal SI unit.
Definition: UnitsPressure.h:168
kilobar SI-derived unit.
Definition: UnitsPressure.h:180
standard atmosphere SI-derived unit.
Definition: UnitsPressure.h:196
bar SI-derived unit.
Definition: UnitsPressure.h:172
UnitsPressure & operator=(const UnitsPressure &rhs)
Assignment operator.
Definition: UnitsPressure.h:250
millipascal SI unit.
Definition: UnitsPressure.h:140
Open Microscopy Environment C++ implementation.
pascal SI unit.
Definition: UnitsPressure.h:128
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: UnitsPressure.cpp:183
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:228
UnitsPressure(enum_value value)
Construct a UnitsPressure enumeration by an enumeration value.
Definition: UnitsPressure.cpp:75
gigapascal SI unit.
Definition: UnitsPressure.h:108
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: UnitsPressure.cpp:138
pound-force per square inch Imperial unit.
Definition: UnitsPressure.h:200
millibar SI-derived unit.
Definition: UnitsPressure.h:192
zeptopascal SI unit.
Definition: UnitsPressure.h:164
std::map< UnitsPressure::enum_value, std::string > value_map_type
Value map type.
Definition: UnitsPressure.h:282
centipascal SI unit.
Definition: UnitsPressure.h:136
std::map< std::string, UnitsPressure::enum_value > string_map_type
String map type.
Definition: UnitsPressure.h:280
femtopascal SI unit.
Definition: UnitsPressure.h:156
torr SI-derived unit.
Definition: UnitsPressure.h:204
zettapascal SI unit.
Definition: UnitsPressure.h:92
const std::string * name
Enumeration name.
Definition: UnitsPressure.h:312
megapascal SI unit.
Definition: UnitsPressure.h:112
micropascal SI unit.
Definition: UnitsPressure.h:144
petapascal SI unit.
Definition: UnitsPressure.h:100
enum_value
Enumeration values.
Definition: UnitsPressure.h:83