ome-xml 5.2.3

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
79 class UnitsPressure
80 {
81 public:
83 enum enum_value
84 {
88 YOTTAPASCAL,
92 ZETTAPASCAL,
96 EXAPASCAL,
100 PETAPASCAL,
104 TERAPASCAL,
108 GIGAPASCAL,
112 MEGAPASCAL,
116 KILOPASCAL,
120 HECTOPASCAL,
124 DECAPASCAL,
128 PASCAL,
132 DECIPASCAL,
136 CENTIPASCAL,
140 MILLIPASCAL,
144 MICROPASCAL,
148 NANOPASCAL,
152 PICOPASCAL,
156 FEMTOPASCAL,
160 ATTOPASCAL,
164 ZEPTOPASCAL,
168 YOCTOPASCAL,
172 BAR,
176 MEGABAR,
180 KILOBAR,
184 DECIBAR,
188 CENTIBAR,
192 MILLIBAR,
196 ATMOSPHERE,
200 PSI,
204 TORR,
208 MILLITORR,
212 MMHG
213 };
214
220 UnitsPressure (enum_value value);
221
236 UnitsPressure (const std::string& name, bool strict = true);
237
243 UnitsPressure (const UnitsPressure& original);
244
249 inline UnitsPressure&
250 operator= (const UnitsPressure& rhs)
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&
307 lowercase_strings();
308
310 enum_value value;
312 const std::string *name;
313 };
314
322 inline bool
323 operator== (const UnitsPressure& lhs,
324 const UnitsPressure& rhs)
325 {
326 return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
327 }
328
336 inline bool
337 operator== (const UnitsPressure& lhs,
338 const UnitsPressure::enum_value& rhs)
339 {
340 return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
341 }
342
350 inline bool
351 operator== (const UnitsPressure::enum_value& lhs,
352 const UnitsPressure& rhs)
353 {
354 return lhs == static_cast<UnitsPressure::enum_value>(rhs);
355 }
356
364 inline bool
365 operator== (const UnitsPressure& lhs,
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
393 operator!= (const UnitsPressure& lhs,
394 const UnitsPressure& rhs)
395 {
396 return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
397 }
398
406 inline bool
407 operator!= (const UnitsPressure& lhs,
408 const UnitsPressure::enum_value& rhs)
409 {
410 return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
411 }
412
420 inline bool
421 operator!= (const UnitsPressure::enum_value& lhs,
422 const UnitsPressure& rhs)
423 {
424 return lhs != static_cast<UnitsPressure::enum_value>(rhs);
425 }
426
434 inline bool
435 operator!= (const UnitsPressure& lhs,
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 }
502 }
503
504 #ifdef _MSC_VER
505 #pragma pop_macro("PASCAL")
506 #endif
507
508 #include <ome/xml/model/enums/UnitsPressureConvert.h>
509
510 #endif // OME_XML_MODEL_ENUMS_UNITSPRESSURE_H
511
512 /*
513 * Local Variables:
514 * mode:C++
515 * End:
516 */
ome::xml::model::enums::operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:390
ome::xml::model::enums::operator!=
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:304
ome::xml::model::enums::UnitsPressure::NANOPASCAL
nanopascal SI unit.
Definition: UnitsPressure.h:148
ome::xml::model::enums::UnitsPressure::CENTIBAR
centibar SI-derived unit.
Definition: UnitsPressure.h:188
ome::xml::model::enums::UnitsPressure::DECAPASCAL
decapascal SI unit.
Definition: UnitsPressure.h:124
ome::xml::model::enums::UnitsPressure::YOTTAPASCAL
yottapascal SI unit.
Definition: UnitsPressure.h:88
ome::xml::model::enums::UnitsPressure
UnitsPressure enumeration.
Definition: UnitsPressure.h:79
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::UnitsPressure::MEGABAR
megabar SI-derived unit.
Definition: UnitsPressure.h:176
ome::xml::model::enums::UnitsPressure::DECIPASCAL
decipascal SI unit.
Definition: UnitsPressure.h:132
ome::xml::model::enums::UnitsPressure::value
enum_value value
Enumeration value.
Definition: UnitsPressure.h:310
ome::xml::model::enums::UnitsPressure::TERAPASCAL
terapascal SI unit.
Definition: UnitsPressure.h:104
ome::xml::model::enums::UnitsPressure::ATTOPASCAL
attopascal SI unit.
Definition: UnitsPressure.h:160
ome::xml::model::enums::UnitsPressure::MILLITORR
millitorr SI-derived unit.
Definition: UnitsPressure.h:208
ome::xml::model::enums::UnitsPressure::DECIBAR
decibar SI-derived unit.
Definition: UnitsPressure.h:184
ome::xml::model::enums::UnitsPressure::HECTOPASCAL
hectopascal SI unit.
Definition: UnitsPressure.h:120
ome::xml::model::enums::UnitsPressure::PICOPASCAL
picopascal SI unit.
Definition: UnitsPressure.h:152
ome::xml::model::enums::UnitsPressure::EXAPASCAL
exapascal SI unit.
Definition: UnitsPressure.h:96
ome::xml::model::enums::UnitsPressure::MMHG
millimetre of mercury SI-derived unit
Definition: UnitsPressure.h:212
ome::xml::model::enums::UnitsPressure::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: UnitsPressure.cpp:228
ome::xml::model::enums::UnitsPressure::KILOPASCAL
kilopascal SI unit.
Definition: UnitsPressure.h:116
ome::xml::model::enums::UnitsPressure::YOCTOPASCAL
yoctopascal SI unit.
Definition: UnitsPressure.h:168
ome::xml::model::enums::UnitsPressure::KILOBAR
kilobar SI-derived unit.
Definition: UnitsPressure.h:180
ome::xml::model::enums::UnitsPressure::ATMOSPHERE
standard atmosphere SI-derived unit.
Definition: UnitsPressure.h:196
ome::xml::model::enums::UnitsPressure::BAR
bar SI-derived unit.
Definition: UnitsPressure.h:172
ome::xml::model::enums::UnitsPressure::operator=
UnitsPressure & operator=(const UnitsPressure &rhs)
Assignment operator.
Definition: UnitsPressure.h:250
ome::xml::model::enums::UnitsPressure::MILLIPASCAL
millipascal SI unit.
Definition: UnitsPressure.h:140
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::UnitsPressure::PASCAL
pascal SI unit.
Definition: UnitsPressure.h:128
ome::xml::model::enums::UnitsPressure::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: UnitsPressure.cpp:183
ome::xml::model::enums::operator==
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:234
ome::xml::model::enums::UnitsPressure::UnitsPressure
UnitsPressure(enum_value value)
Construct a UnitsPressure enumeration by an enumeration value.
Definition: UnitsPressure.cpp:75
ome::xml::model::enums::UnitsPressure::GIGAPASCAL
gigapascal SI unit.
Definition: UnitsPressure.h:108
ome::xml::model::enums::UnitsPressure::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: UnitsPressure.cpp:138
ome::xml::model::enums::UnitsPressure::PSI
pound-force per square inch Imperial unit.
Definition: UnitsPressure.h:200
ome::xml::model::enums::UnitsPressure::MILLIBAR
millibar SI-derived unit.
Definition: UnitsPressure.h:192
ome::xml::model::enums::UnitsPressure::ZEPTOPASCAL
zeptopascal SI unit.
Definition: UnitsPressure.h:164
ome::xml::model::enums::UnitsPressure::value_map_type
std::map< UnitsPressure::enum_value, std::string > value_map_type
Value map type.
Definition: UnitsPressure.h:282
ome::xml::model::enums::UnitsPressure::CENTIPASCAL
centipascal SI unit.
Definition: UnitsPressure.h:136
ome::xml::model::enums::UnitsPressure::string_map_type
std::map< std::string, UnitsPressure::enum_value > string_map_type
String map type.
Definition: UnitsPressure.h:280
ome::xml::model::enums::UnitsPressure::FEMTOPASCAL
femtopascal SI unit.
Definition: UnitsPressure.h:156
ome::xml::model::enums::UnitsPressure::TORR
torr SI-derived unit.
Definition: UnitsPressure.h:204
ome::xml::model::enums::UnitsPressure::ZETTAPASCAL
zettapascal SI unit.
Definition: UnitsPressure.h:92
ome::xml::model::enums::UnitsPressure::name
const std::string * name
Enumeration name.
Definition: UnitsPressure.h:312
ome::xml::model::enums::UnitsPressure::MEGAPASCAL
megapascal SI unit.
Definition: UnitsPressure.h:112
log.h
ome::xml::model::enums::UnitsPressure::MICROPASCAL
micropascal SI unit.
Definition: UnitsPressure.h:144
ome::xml::model::enums::UnitsPressure::PETAPASCAL
petapascal SI unit.
Definition: UnitsPressure.h:100
ome::xml::model::enums::UnitsPressure::enum_value
enum_value
Enumeration values.
Definition: UnitsPressure.h:83