ome-xml  5.6.0
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 
251  inline UnitsPressure&
253  {
254  this->value = rhs.value;
255  this->name = rhs.name;
256  return *this;
257  }
258 
264  inline
265  operator enum_value () const
266  {
267  return this->value;
268  }
269 
275  inline
276  operator const std::string& () const
277  {
278  return *this->name;
279  }
280 
282  typedef std::map<std::string, UnitsPressure::enum_value> string_map_type;
284  typedef std::map<UnitsPressure::enum_value, std::string> value_map_type;
285 
291  static const string_map_type&
292  strings();
293 
299  static const value_map_type&
300  values();
301 
302  private:
308  static const string_map_type&
310 
314  const std::string *name;
315  };
316 
324  inline bool
326  const UnitsPressure& rhs)
327  {
328  return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
329  }
330 
338  inline bool
340  const UnitsPressure::enum_value& rhs)
341  {
342  return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
343  }
344 
352  inline bool
354  const UnitsPressure& rhs)
355  {
356  return lhs == static_cast<UnitsPressure::enum_value>(rhs);
357  }
358 
366  inline bool
368  const std::string& rhs)
369  {
370  return static_cast<const std::string&>(lhs) == rhs;
371  }
372 
380  inline bool
381  operator== (const std::string& lhs,
382  const UnitsPressure& rhs)
383  {
384  return lhs == static_cast<const std::string&>(rhs);
385  }
386 
394  inline bool
396  const UnitsPressure& rhs)
397  {
398  return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
399  }
400 
408  inline bool
410  const UnitsPressure::enum_value& rhs)
411  {
412  return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
413  }
414 
422  inline bool
424  const UnitsPressure& rhs)
425  {
426  return lhs != static_cast<UnitsPressure::enum_value>(rhs);
427  }
428 
436  inline bool
438  const std::string& rhs)
439  {
440  return static_cast<const std::string&>(lhs) != rhs;
441  }
442 
450  inline bool
451  operator!= (const std::string& lhs,
452  const UnitsPressure& rhs)
453  {
454  return lhs != static_cast<const std::string&>(rhs);
455  }
456 
464  template<class charT, class traits>
465  inline std::basic_ostream<charT,traits>&
466  operator<< (std::basic_ostream<charT,traits>& os,
467  const UnitsPressure& enumeration)
468  {
469  return os << static_cast<const std::string&>(enumeration);
470  }
471 
479  template<class charT, class traits>
480  inline std::basic_istream<charT,traits>&
481  operator>> (std::basic_istream<charT,traits>& is,
482  UnitsPressure& enumeration)
483  {
484  std::string value;
485  is >> value;
486  if (is)
487  {
488  try
489  {
490  enumeration = UnitsPressure(value, false);
491  }
492  catch (const EnumerationException&)
493  {
494  is.setstate(std::ios::failbit);
495  }
496  }
497 
498  return is;
499  }
500 
501  }
502  }
503  }
504 }
505 
506 #ifdef _MSC_VER
507 #pragma pop_macro("PASCAL")
508 #endif
509 
510 #include <ome/xml/model/enums/UnitsPressureConvert.h>
511 
512 #endif // OME_XML_MODEL_ENUMS_UNITSPRESSURE_H
513 
514 /*
515  * Local Variables:
516  * mode:C++
517  * End:
518  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:392
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:306
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:312
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:214
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:252
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:172
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:236
UnitsPressure(enum_value value)
Construct a UnitsPressure enumeration by an enumeration value.
Definition: UnitsPressure.cpp:67
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:130
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:284
centipascal SI unit.
Definition: UnitsPressure.h:136
std::map< std::string, UnitsPressure::enum_value > string_map_type
String map type.
Definition: UnitsPressure.h:282
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:314
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