ome-xml 5.2.3

UnitsElectricPotential.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_UNITSELECTRICPOTENTIAL_H
47 #define OME_XML_MODEL_ENUMS_UNITSELECTRICPOTENTIAL_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 UnitsElectricPotential enumeration.
60 #define OME_XML_MODEL_ENUMS_UNITSELECTRICPOTENTIAL_VALUES (YOTTAVOLT)(ZETTAVOLT)(EXAVOLT)(PETAVOLT)(TERAVOLT)(GIGAVOLT)(MEGAVOLT)(KILOVOLT)(HECTOVOLT)(DECAVOLT)(VOLT)(DECIVOLT)(CENTIVOLT)(MILLIVOLT)(MICROVOLT)(NANOVOLT)(PICOVOLT)(FEMTOVOLT)(ATTOVOLT)(ZEPTOVOLT)(YOCTOVOLT)
61
62 namespace ome
63 {
64 namespace xml
65 {
66 namespace model
67 {
68 namespace enums
69 {
70
74 class UnitsElectricPotential
75 {
76 public:
78 enum enum_value
79 {
83 YOTTAVOLT,
87 ZETTAVOLT,
91 EXAVOLT,
95 PETAVOLT,
99 TERAVOLT,
103 GIGAVOLT,
107 MEGAVOLT,
111 KILOVOLT,
115 HECTOVOLT,
119 DECAVOLT,
123 VOLT,
127 DECIVOLT,
131 CENTIVOLT,
135 MILLIVOLT,
139 MICROVOLT,
143 NANOVOLT,
147 PICOVOLT,
151 FEMTOVOLT,
155 ATTOVOLT,
159 ZEPTOVOLT,
163 YOCTOVOLT
164 };
165
171 UnitsElectricPotential (enum_value value);
172
187 UnitsElectricPotential (const std::string& name, bool strict = true);
188
194 UnitsElectricPotential (const UnitsElectricPotential& original);
195
200 inline UnitsElectricPotential&
201 operator= (const UnitsElectricPotential& rhs)
202 {
203 this->value = rhs.value;
204 this->name = rhs.name;
205 return *this;
206 }
207
213 inline
214 operator enum_value () const
215 {
216 return this->value;
217 }
218
224 inline
225 operator const std::string& () const
226 {
227 return *this->name;
228 }
229
231 typedef std::map<std::string, UnitsElectricPotential::enum_value> string_map_type;
233 typedef std::map<UnitsElectricPotential::enum_value, std::string> value_map_type;
234
240 static const string_map_type&
241 strings();
242
248 static const value_map_type&
249 values();
250
251 private:
257 static const string_map_type&
258 lowercase_strings();
259
261 enum_value value;
263 const std::string *name;
264 };
265
273 inline bool
274 operator== (const UnitsElectricPotential& lhs,
275 const UnitsElectricPotential& rhs)
276 {
277 return static_cast<UnitsElectricPotential::enum_value>(lhs) == static_cast<UnitsElectricPotential::enum_value>(rhs);
278 }
279
287 inline bool
288 operator== (const UnitsElectricPotential& lhs,
289 const UnitsElectricPotential::enum_value& rhs)
290 {
291 return static_cast<UnitsElectricPotential::enum_value>(lhs) == rhs;
292 }
293
301 inline bool
302 operator== (const UnitsElectricPotential::enum_value& lhs,
303 const UnitsElectricPotential& rhs)
304 {
305 return lhs == static_cast<UnitsElectricPotential::enum_value>(rhs);
306 }
307
315 inline bool
316 operator== (const UnitsElectricPotential& lhs,
317 const std::string& rhs)
318 {
319 return static_cast<const std::string&>(lhs) == rhs;
320 }
321
329 inline bool
330 operator== (const std::string& lhs,
331 const UnitsElectricPotential& rhs)
332 {
333 return lhs == static_cast<const std::string&>(rhs);
334 }
335
343 inline bool
344 operator!= (const UnitsElectricPotential& lhs,
345 const UnitsElectricPotential& rhs)
346 {
347 return static_cast<UnitsElectricPotential::enum_value>(lhs) != static_cast<UnitsElectricPotential::enum_value>(rhs);
348 }
349
357 inline bool
358 operator!= (const UnitsElectricPotential& lhs,
359 const UnitsElectricPotential::enum_value& rhs)
360 {
361 return static_cast<UnitsElectricPotential::enum_value>(lhs) != rhs;
362 }
363
371 inline bool
372 operator!= (const UnitsElectricPotential::enum_value& lhs,
373 const UnitsElectricPotential& rhs)
374 {
375 return lhs != static_cast<UnitsElectricPotential::enum_value>(rhs);
376 }
377
385 inline bool
386 operator!= (const UnitsElectricPotential& lhs,
387 const std::string& rhs)
388 {
389 return static_cast<const std::string&>(lhs) != rhs;
390 }
391
399 inline bool
400 operator!= (const std::string& lhs,
401 const UnitsElectricPotential& rhs)
402 {
403 return lhs != static_cast<const std::string&>(rhs);
404 }
405
413 template<class charT, class traits>
414 inline std::basic_ostream<charT,traits>&
415 operator<< (std::basic_ostream<charT,traits>& os,
416 const UnitsElectricPotential& enumeration)
417 {
418 return os << static_cast<const std::string&>(enumeration);
419 }
420
428 template<class charT, class traits>
429 inline std::basic_istream<charT,traits>&
430 operator>> (std::basic_istream<charT,traits>& is,
431 UnitsElectricPotential& enumeration)
432 {
433 std::string value;
434 is >> value;
435 if (is)
436 {
437 try
438 {
439 enumeration = UnitsElectricPotential(value, false);
440 }
441 catch (const EnumerationException&)
442 {
443 is.setstate(std::ios::failbit);
444 }
445 }
446
447 return is;
448 }
449
450 }
451 }
452 }
453 }
454
455 #include <ome/xml/model/enums/UnitsElectricPotentialConvert.h>
456
457 #endif // OME_XML_MODEL_ENUMS_UNITSELECTRICPOTENTIAL_H
458
459 /*
460 * Local Variables:
461 * mode:C++
462 * End:
463 */
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::UnitsElectricPotential::YOCTOVOLT
yoctovolt unit.
Definition: UnitsElectricPotential.h:163
ome::xml::model::enums::UnitsElectricPotential::value_map_type
std::map< UnitsElectricPotential::enum_value, std::string > value_map_type
Value map type.
Definition: UnitsElectricPotential.h:233
ome::xml::model::enums::UnitsElectricPotential::CENTIVOLT
centivolt unit.
Definition: UnitsElectricPotential.h:131
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::UnitsElectricPotential::string_map_type
std::map< std::string, UnitsElectricPotential::enum_value > string_map_type
String map type.
Definition: UnitsElectricPotential.h:231
ome::xml::model::enums::UnitsElectricPotential
UnitsElectricPotential enumeration.
Definition: UnitsElectricPotential.h:74
ome::xml::model::enums::UnitsElectricPotential::UnitsElectricPotential
UnitsElectricPotential(enum_value value)
Construct a UnitsElectricPotential enumeration by an enumeration value.
Definition: UnitsElectricPotential.cpp:75
ome::xml::model::enums::UnitsElectricPotential::KILOVOLT
kilovolt unit.
Definition: UnitsElectricPotential.h:111
ome::xml::model::enums::UnitsElectricPotential::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: UnitsElectricPotential.cpp:172
ome::xml::model::enums::UnitsElectricPotential::name
const std::string * name
Enumeration name.
Definition: UnitsElectricPotential.h:263
ome::xml::model::enums::UnitsElectricPotential::ZEPTOVOLT
zeptovolt unit.
Definition: UnitsElectricPotential.h:159
ome::xml::model::enums::UnitsElectricPotential::PETAVOLT
petavolt unit.
Definition: UnitsElectricPotential.h:95
ome::xml::model::enums::UnitsElectricPotential::MILLIVOLT
millivolt unit.
Definition: UnitsElectricPotential.h:135
ome::xml::model::enums::UnitsElectricPotential::ATTOVOLT
attovolt unit.
Definition: UnitsElectricPotential.h:155
ome::xml::model::enums::UnitsElectricPotential::MEGAVOLT
megavolt unit.
Definition: UnitsElectricPotential.h:107
ome::xml::model::enums::UnitsElectricPotential::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: UnitsElectricPotential.cpp:138
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::UnitsElectricPotential::DECAVOLT
decavolt unit.
Definition: UnitsElectricPotential.h:119
ome::xml::model::enums::UnitsElectricPotential::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: UnitsElectricPotential.cpp:206
ome::xml::model::enums::UnitsElectricPotential::NANOVOLT
nanovolt unit.
Definition: UnitsElectricPotential.h:143
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::UnitsElectricPotential::MICROVOLT
microvolt unit.
Definition: UnitsElectricPotential.h:139
ome::xml::model::enums::UnitsElectricPotential::EXAVOLT
exavolt unit.
Definition: UnitsElectricPotential.h:91
ome::xml::model::enums::UnitsElectricPotential::YOTTAVOLT
yottavolt unit.
Definition: UnitsElectricPotential.h:83
ome::xml::model::enums::UnitsElectricPotential::VOLT
volt unit.
Definition: UnitsElectricPotential.h:123
ome::xml::model::enums::UnitsElectricPotential::ZETTAVOLT
zettavolt unit.
Definition: UnitsElectricPotential.h:87
ome::xml::model::enums::UnitsElectricPotential::enum_value
enum_value
Enumeration values.
Definition: UnitsElectricPotential.h:78
ome::xml::model::enums::UnitsElectricPotential::operator=
UnitsElectricPotential & operator=(const UnitsElectricPotential &rhs)
Assignment operator.
Definition: UnitsElectricPotential.h:201
ome::xml::model::enums::UnitsElectricPotential::HECTOVOLT
hectovolt unit.
Definition: UnitsElectricPotential.h:115
ome::xml::model::enums::UnitsElectricPotential::value
enum_value value
Enumeration value.
Definition: UnitsElectricPotential.h:261
ome::xml::model::enums::UnitsElectricPotential::FEMTOVOLT
femtovolt unit.
Definition: UnitsElectricPotential.h:151
log.h
ome::xml::model::enums::UnitsElectricPotential::PICOVOLT
picovolt unit.
Definition: UnitsElectricPotential.h:147
ome::xml::model::enums::UnitsElectricPotential::DECIVOLT
decivolt unit.
Definition: UnitsElectricPotential.h:127
ome::xml::model::enums::UnitsElectricPotential::GIGAVOLT
gigavolt unit.
Definition: UnitsElectricPotential.h:103
ome::xml::model::enums::UnitsElectricPotential::TERAVOLT
teravolt unit.
Definition: UnitsElectricPotential.h:99