ome-xml 5.2.3

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
68 class UnitsPressure
69 {
70 public:
72 enum enum_value
73 {
75 YOTTAPASCAL,
77 ZETTAPASCAL,
79 EXAPASCAL,
81 PETAPASCAL,
83 TERAPASCAL,
85 GIGAPASCAL,
87 MEGAPASCAL,
89 KILOPASCAL,
91 HECTOPASCAL,
93 DECAPASCAL,
95 PASCAL,
97 DECIPASCAL,
99 CENTIPASCAL,
101 MILLIPASCAL,
103 MICROPASCAL,
105 NANOPASCAL,
107 PICOPASCAL,
109 FEMTOPASCAL,
111 ATTOPASCAL,
113 ZEPTOPASCAL,
115 YOCTOPASCAL,
117 BAR,
119 MEGABAR,
121 KILOBAR,
123 DECIBAR,
125 CENTIBAR,
127 MILLIBAR,
129 ATMOSPHERE,
131 PSI,
133 TORR,
135 MILLITORR,
137 MMHG
138 };
139
145 UnitsPressure (enum_value value);
146
161 UnitsPressure (const std::string& name, bool strict = true);
162
168 UnitsPressure (const UnitsPressure& original);
169
174 inline UnitsPressure&
175 operator= (const UnitsPressure& rhs)
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&
232 lowercase_strings();
233
235 enum_value value;
237 const std::string *name;
238 };
239
247 inline bool
248 operator== (const UnitsPressure& lhs,
249 const UnitsPressure& rhs)
250 {
251 return static_cast<UnitsPressure::enum_value>(lhs) == static_cast<UnitsPressure::enum_value>(rhs);
252 }
253
261 inline bool
262 operator== (const UnitsPressure& lhs,
263 const UnitsPressure::enum_value& rhs)
264 {
265 return static_cast<UnitsPressure::enum_value>(lhs) == rhs;
266 }
267
275 inline bool
276 operator== (const UnitsPressure::enum_value& lhs,
277 const UnitsPressure& rhs)
278 {
279 return lhs == static_cast<UnitsPressure::enum_value>(rhs);
280 }
281
289 inline bool
290 operator== (const UnitsPressure& lhs,
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
318 operator!= (const UnitsPressure& lhs,
319 const UnitsPressure& rhs)
320 {
321 return static_cast<UnitsPressure::enum_value>(lhs) != static_cast<UnitsPressure::enum_value>(rhs);
322 }
323
331 inline bool
332 operator!= (const UnitsPressure& lhs,
333 const UnitsPressure::enum_value& rhs)
334 {
335 return static_cast<UnitsPressure::enum_value>(lhs) != rhs;
336 }
337
345 inline bool
346 operator!= (const UnitsPressure::enum_value& lhs,
347 const UnitsPressure& rhs)
348 {
349 return lhs != static_cast<UnitsPressure::enum_value>(rhs);
350 }
351
359 inline bool
360 operator!= (const UnitsPressure& lhs,
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 */
ome::xml::model::primitives::UnitsPressure::PSI
pound-force per square inch Imperial unit.
Definition: PressureQuantity.h:131
ome::xml::model::primitives::UnitsPressure::value
enum_value value
Enumeration value.
Definition: PressureQuantity.h:235
ome::xml::model::primitives::UnitsPressure::TORR
torr SI-derived unit.
Definition: PressureQuantity.h:133
ome::xml::model::primitives::UnitsPressure::DECIPASCAL
decipascal SI unit.
Definition: PressureQuantity.h:97
ome::xml::model::primitives::UnitsPressure::ATTOPASCAL
attopascal SI unit.
Definition: PressureQuantity.h:111
ome::xml::model::primitives::UnitsPressure::ZEPTOPASCAL
zeptopascal SI unit.
Definition: PressureQuantity.h:113
ome::xml::model::primitives::UnitsPressure::MILLITORR
millitorr SI-derived unit.
Definition: PressureQuantity.h:135
ome::xml::model::primitives::UnitsPressure::MEGABAR
megabar SI-derived unit.
Definition: PressureQuantity.h:119
ome::xml::model::primitives::operator!=
bool operator!=(const Color &lhs, const Color &rhs)
Compare two Color objects for non-equality.
Definition: Color.h:393
ome::xml::model::primitives::UnitsPressure::BAR
bar SI-derived unit.
Definition: PressureQuantity.h:117
ome::xml::model::primitives::UnitsPressure::MEGAPASCAL
megapascal SI unit.
Definition: PressureQuantity.h:87
ome::xml::model::primitives::UnitsPressure::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
ome::xml::model::primitives::UnitsPressure::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
ome::xml::model::primitives::UnitsPressure::FEMTOPASCAL
femtopascal SI unit.
Definition: PressureQuantity.h:109
ome::xml::model::primitives::UnitsPressure::string_map_type
std::map< std::string, UnitsPressure::enum_value > string_map_type
String map type.
Definition: PressureQuantity.h:205
ome::xml::model::primitives::UnitsPressure::MILLIPASCAL
millipascal SI unit.
Definition: PressureQuantity.h:101
ome::xml::model::primitives::UnitsPressure::name
const std::string * name
Enumeration name.
Definition: PressureQuantity.h:237
ome::xml::model::primitives::UnitsPressure::DECAPASCAL
decapascal SI unit.
Definition: PressureQuantity.h:93
ome::xml::model::primitives::UnitsPressure::YOCTOPASCAL
yoctopascal SI unit.
Definition: PressureQuantity.h:115
ome::xml::model::primitives::UnitsPressure::values
static const value_map_type & values()
Get a map of valid enum values and string names.
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::primitives::UnitsPressure::CENTIPASCAL
centipascal SI unit.
Definition: PressureQuantity.h:99
ome::xml::model::primitives::operator==
bool operator==(const Color &lhs, const Color &rhs)
Compare two Color objects for equality.
Definition: Color.h:323
ome::xml::model::primitives::UnitsPressure::CENTIBAR
centibar SI-derived unit.
Definition: PressureQuantity.h:125
ome::xml::model::primitives::UnitsPressure::YOTTAPASCAL
yottapascal SI unit.
Definition: PressureQuantity.h:75
ome::xml::model::primitives::UnitsPressure::MICROPASCAL
micropascal SI unit.
Definition: PressureQuantity.h:103
ome::xml::model::primitives::UnitsPressure::HECTOPASCAL
hectopascal SI unit.
Definition: PressureQuantity.h:91
ome::xml::model::primitives::UnitsPressure::PETAPASCAL
petapascal SI unit.
Definition: PressureQuantity.h:81
ome::xml::model::primitives::UnitsPressure::ATMOSPHERE
standard atmosphere SI-derived unit.
Definition: PressureQuantity.h:129
ome::xml::model::primitives::UnitsPressure::UnitsPressure
UnitsPressure(enum_value value)
Construct a UnitsPressure quantity by an enumeration value.
ome::xml::model::primitives::UnitsPressure::MILLIBAR
millibar SI-derived unit.
Definition: PressureQuantity.h:127
ome::xml::model::primitives::UnitsPressure
UnitsPressure enumeration.
Definition: PressureQuantity.h:68
ome::xml::model::primitives::UnitsPressure::MMHG
millimetre of mercury SI-derived unit
Definition: PressureQuantity.h:137
ome::xml::model::primitives::UnitsPressure::value_map_type
std::map< UnitsPressure::enum_value, std::string > value_map_type
Value map type.
Definition: PressureQuantity.h:207
ome::xml::model::primitives::UnitsPressure::EXAPASCAL
exapascal SI unit.
Definition: PressureQuantity.h:79
ome::xml::model::primitives::UnitsPressure::operator=
UnitsPressure & operator=(const UnitsPressure &rhs)
Assignment operator.
Definition: PressureQuantity.h:175
ome::xml::model::primitives::UnitsPressure::PASCAL
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
ome::xml::model::primitives::UnitsPressure::DECIBAR
decibar SI-derived unit.
Definition: PressureQuantity.h:123
ome::xml::model::primitives::operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, Color &color)
Set Color from input stream.
Definition: Color.h:479
ome::xml::model::primitives::UnitsPressure::PICOPASCAL
picopascal SI unit.
Definition: PressureQuantity.h:107
ome::xml::model::primitives::UnitsPressure::TERAPASCAL
terapascal SI unit.
Definition: PressureQuantity.h:83
ome::xml::model::primitives::UnitsPressure::enum_value
enum_value
Enumeration values.
Definition: PressureQuantity.h:72
ome::xml::model::primitives::UnitsPressure::KILOBAR
kilobar SI-derived unit.
Definition: PressureQuantity.h:121
ome::xml::model::primitives::UnitsPressure::GIGAPASCAL
gigapascal SI unit.
Definition: PressureQuantity.h:85
ome::xml::model::primitives::UnitsPressure::KILOPASCAL
kilopascal SI unit.
Definition: PressureQuantity.h:89
log.h
ome::xml::model::primitives::UnitsPressure::ZETTAPASCAL
zettapascal SI unit.
Definition: PressureQuantity.h:77
ome::xml::model::primitives::UnitsPressure::NANOPASCAL
nanopascal SI unit.
Definition: PressureQuantity.h:105