ome-xml 5.2.3

UnitsTemperature.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_UNITSTEMPERATURE_H
47 #define OME_XML_MODEL_ENUMS_UNITSTEMPERATURE_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 // All values in the UnitsTemperature enumeration.
60 #define OME_XML_MODEL_ENUMS_UNITSTEMPERATURE_VALUES (CELSIUS)(FAHRENHEIT)(KELVIN)(RANKINE)
61
62 namespace ome
63 {
64 namespace xml
65 {
66 namespace model
67 {
68 namespace enums
69 {
70
74 class UnitsTemperature
75 {
76 public:
78 enum enum_value
79 {
83 CELSIUS,
87 FAHRENHEIT,
91 KELVIN,
95 RANKINE
96 };
97
103 UnitsTemperature (enum_value value);
104
119 UnitsTemperature (const std::string& name, bool strict = true);
120
126 UnitsTemperature (const UnitsTemperature& original);
127
132 inline UnitsTemperature&
133 operator= (const UnitsTemperature& rhs)
134 {
135 this->value = rhs.value;
136 this->name = rhs.name;
137 return *this;
138 }
139
145 inline
146 operator enum_value () const
147 {
148 return this->value;
149 }
150
156 inline
157 operator const std::string& () const
158 {
159 return *this->name;
160 }
161
163 typedef std::map<std::string, UnitsTemperature::enum_value> string_map_type;
165 typedef std::map<UnitsTemperature::enum_value, std::string> value_map_type;
166
172 static const string_map_type&
173 strings();
174
180 static const value_map_type&
181 values();
182
183 private:
189 static const string_map_type&
190 lowercase_strings();
191
193 enum_value value;
195 const std::string *name;
196 };
197
205 inline bool
206 operator== (const UnitsTemperature& lhs,
207 const UnitsTemperature& rhs)
208 {
209 return static_cast<UnitsTemperature::enum_value>(lhs) == static_cast<UnitsTemperature::enum_value>(rhs);
210 }
211
219 inline bool
220 operator== (const UnitsTemperature& lhs,
221 const UnitsTemperature::enum_value& rhs)
222 {
223 return static_cast<UnitsTemperature::enum_value>(lhs) == rhs;
224 }
225
233 inline bool
234 operator== (const UnitsTemperature::enum_value& lhs,
235 const UnitsTemperature& rhs)
236 {
237 return lhs == static_cast<UnitsTemperature::enum_value>(rhs);
238 }
239
247 inline bool
248 operator== (const UnitsTemperature& lhs,
249 const std::string& rhs)
250 {
251 return static_cast<const std::string&>(lhs) == rhs;
252 }
253
261 inline bool
262 operator== (const std::string& lhs,
263 const UnitsTemperature& rhs)
264 {
265 return lhs == static_cast<const std::string&>(rhs);
266 }
267
275 inline bool
276 operator!= (const UnitsTemperature& lhs,
277 const UnitsTemperature& rhs)
278 {
279 return static_cast<UnitsTemperature::enum_value>(lhs) != static_cast<UnitsTemperature::enum_value>(rhs);
280 }
281
289 inline bool
290 operator!= (const UnitsTemperature& lhs,
291 const UnitsTemperature::enum_value& rhs)
292 {
293 return static_cast<UnitsTemperature::enum_value>(lhs) != rhs;
294 }
295
303 inline bool
304 operator!= (const UnitsTemperature::enum_value& lhs,
305 const UnitsTemperature& rhs)
306 {
307 return lhs != static_cast<UnitsTemperature::enum_value>(rhs);
308 }
309
317 inline bool
318 operator!= (const UnitsTemperature& lhs,
319 const std::string& rhs)
320 {
321 return static_cast<const std::string&>(lhs) != rhs;
322 }
323
331 inline bool
332 operator!= (const std::string& lhs,
333 const UnitsTemperature& rhs)
334 {
335 return lhs != static_cast<const std::string&>(rhs);
336 }
337
345 template<class charT, class traits>
346 inline std::basic_ostream<charT,traits>&
347 operator<< (std::basic_ostream<charT,traits>& os,
348 const UnitsTemperature& enumeration)
349 {
350 return os << static_cast<const std::string&>(enumeration);
351 }
352
360 template<class charT, class traits>
361 inline std::basic_istream<charT,traits>&
362 operator>> (std::basic_istream<charT,traits>& is,
363 UnitsTemperature& enumeration)
364 {
365 std::string value;
366 is >> value;
367 if (is)
368 {
369 try
370 {
371 enumeration = UnitsTemperature(value, false);
372 }
373 catch (const EnumerationException&)
374 {
375 is.setstate(std::ios::failbit);
376 }
377 }
378
379 return is;
380 }
381
382 }
383 }
384 }
385 }
386
387 #include <ome/xml/model/enums/UnitsTemperatureConvert.h>
388
389 #endif // OME_XML_MODEL_ENUMS_UNITSTEMPERATURE_H
390
391 /*
392 * Local Variables:
393 * mode:C++
394 * End:
395 */
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::UnitsTemperature::enum_value
enum_value
Enumeration values.
Definition: UnitsTemperature.h:78
ome::xml::model::enums::UnitsTemperature::CELSIUS
degree Celsius unit.
Definition: UnitsTemperature.h:83
ome::xml::model::enums::UnitsTemperature::value_map_type
std::map< UnitsTemperature::enum_value, std::string > value_map_type
Value map type.
Definition: UnitsTemperature.h:165
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::UnitsTemperature
UnitsTemperature enumeration.
Definition: UnitsTemperature.h:74
ome::xml::model::enums::UnitsTemperature::UnitsTemperature
UnitsTemperature(enum_value value)
Construct a UnitsTemperature enumeration by an enumeration value.
Definition: UnitsTemperature.cpp:75
ome::xml::model::enums::UnitsTemperature::FAHRENHEIT
degree Fahrenheit unit.
Definition: UnitsTemperature.h:87
ome::xml::model::enums::UnitsTemperature::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: UnitsTemperature.cpp:155
ome::xml::model::enums::UnitsTemperature::string_map_type
std::map< std::string, UnitsTemperature::enum_value > string_map_type
String map type.
Definition: UnitsTemperature.h:163
ome::xml::model::enums::UnitsTemperature::operator=
UnitsTemperature & operator=(const UnitsTemperature &rhs)
Assignment operator.
Definition: UnitsTemperature.h:133
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::UnitsTemperature::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: UnitsTemperature.cpp:138
ome::xml::model::enums::UnitsTemperature::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: UnitsTemperature.cpp:172
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::UnitsTemperature::name
const std::string * name
Enumeration name.
Definition: UnitsTemperature.h:195
ome::xml::model::enums::UnitsTemperature::value
enum_value value
Enumeration value.
Definition: UnitsTemperature.h:193
ome::xml::model::enums::UnitsTemperature::RANKINE
degree Rankine unit.
Definition: UnitsTemperature.h:95
ome::xml::model::enums::UnitsTemperature::KELVIN
Kelvin unit.
Definition: UnitsTemperature.h:91
log.h