ome-xml 5.2.3

ElectricPotentialQuantity.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_ELECTRICPOTENTIALQUANTITY_H
47 #define OME_XML_MODEL_PRIMITIVES_ELECTRICPOTENTIALQUANTITY_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 UnitsElectricPotential
69 {
70 public:
72 enum enum_value
73 {
75 YOTTAVOLT,
77 ZETTAVOLT,
79 EXAVOLT,
81 PETAVOLT,
83 TERAVOLT,
85 GIGAVOLT,
87 MEGAVOLT,
89 KILOVOLT,
91 HECTOVOLT,
93 DECAVOLT,
95 VOLT,
97 DECIVOLT,
99 CENTIVOLT,
101 MILLIVOLT,
103 MICROVOLT,
105 NANOVOLT,
107 PICOVOLT,
109 FEMTOVOLT,
111 ATTOVOLT,
113 ZEPTOVOLT,
115 YOCTOVOLT
116 };
117
123 UnitsElectricPotential (enum_value value);
124
139 UnitsElectricPotential (const std::string& name, bool strict = true);
140
146 UnitsElectricPotential (const UnitsElectricPotential& original);
147
152 inline UnitsElectricPotential&
153 operator= (const UnitsElectricPotential& rhs)
154 {
155 this->value = rhs.value;
156 this->name = rhs.name;
157 return *this;
158 }
159
165 inline
166 operator enum_value () const
167 {
168 return this->value;
169 }
170
176 inline
177 operator const std::string& () const
178 {
179 return *this->name;
180 }
181
183 typedef std::map<std::string, UnitsElectricPotential::enum_value> string_map_type;
185 typedef std::map<UnitsElectricPotential::enum_value, std::string> value_map_type;
186
192 static const string_map_type&
193 strings();
194
200 static const value_map_type&
201 values();
202
203 private:
209 static const string_map_type&
210 lowercase_strings();
211
213 enum_value value;
215 const std::string *name;
216 };
217
225 inline bool
226 operator== (const UnitsElectricPotential& lhs,
227 const UnitsElectricPotential& rhs)
228 {
229 return static_cast<UnitsElectricPotential::enum_value>(lhs) == static_cast<UnitsElectricPotential::enum_value>(rhs);
230 }
231
239 inline bool
240 operator== (const UnitsElectricPotential& lhs,
241 const UnitsElectricPotential::enum_value& rhs)
242 {
243 return static_cast<UnitsElectricPotential::enum_value>(lhs) == rhs;
244 }
245
253 inline bool
254 operator== (const UnitsElectricPotential::enum_value& lhs,
255 const UnitsElectricPotential& rhs)
256 {
257 return lhs == static_cast<UnitsElectricPotential::enum_value>(rhs);
258 }
259
267 inline bool
268 operator== (const UnitsElectricPotential& lhs,
269 const std::string& rhs)
270 {
271 return static_cast<const std::string&>(lhs) == rhs;
272 }
273
281 inline bool
282 operator== (const std::string& lhs,
283 const UnitsElectricPotential& rhs)
284 {
285 return lhs == static_cast<const std::string&>(rhs);
286 }
287
295 inline bool
296 operator!= (const UnitsElectricPotential& lhs,
297 const UnitsElectricPotential& rhs)
298 {
299 return static_cast<UnitsElectricPotential::enum_value>(lhs) != static_cast<UnitsElectricPotential::enum_value>(rhs);
300 }
301
309 inline bool
310 operator!= (const UnitsElectricPotential& lhs,
311 const UnitsElectricPotential::enum_value& rhs)
312 {
313 return static_cast<UnitsElectricPotential::enum_value>(lhs) != rhs;
314 }
315
323 inline bool
324 operator!= (const UnitsElectricPotential::enum_value& lhs,
325 const UnitsElectricPotential& rhs)
326 {
327 return lhs != static_cast<UnitsElectricPotential::enum_value>(rhs);
328 }
329
337 inline bool
338 operator!= (const UnitsElectricPotential& lhs,
339 const std::string& rhs)
340 {
341 return static_cast<const std::string&>(lhs) != rhs;
342 }
343
351 inline bool
352 operator!= (const std::string& lhs,
353 const UnitsElectricPotential& rhs)
354 {
355 return lhs != static_cast<const std::string&>(rhs);
356 }
357
365 template<class charT, class traits>
366 inline std::basic_ostream<charT,traits>&
367 operator<< (std::basic_ostream<charT,traits>& os,
368 const UnitsElectricPotential& enumeration)
369 {
370 return os << static_cast<const std::string&>(enumeration);
371 }
372
380 template<class charT, class traits>
381 inline std::basic_istream<charT,traits>&
382 operator>> (std::basic_istream<charT,traits>& is,
383 UnitsElectricPotential& enumeration)
384 {
385 std::string value;
386 is >> value;
387 if (is)
388 {
389 try
390 {
391 enumeration = UnitsElectricPotential(value, false);
392 }
393 catch (const EnumerationException&)
394 {
395 is.setstate(std::ios::failbit);
396 }
397 }
398
399 return is;
400 }
401
402 }
403 }
404 }
405 }
406
407 #endif // OME_XML_MODEL_PRIMITIVES_ELECTRICPOTENTIALQUANTITY_H
408
409 /*
410 * Local Variables:
411 * mode:C++
412 * End:
413 */
ome::xml::model::primitives::UnitsElectricPotential::ATTOVOLT
attovolt unit.
Definition: ElectricPotentialQuantity.h:111
ome::xml::model::primitives::UnitsElectricPotential::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
ome::xml::model::primitives::UnitsElectricPotential::operator=
UnitsElectricPotential & operator=(const UnitsElectricPotential &rhs)
Assignment operator.
Definition: ElectricPotentialQuantity.h:153
ome::xml::model::primitives::UnitsElectricPotential::EXAVOLT
exavolt unit.
Definition: ElectricPotentialQuantity.h:79
ome::xml::model::primitives::UnitsElectricPotential::NANOVOLT
nanovolt unit.
Definition: ElectricPotentialQuantity.h:105
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::UnitsElectricPotential::YOTTAVOLT
yottavolt unit.
Definition: ElectricPotentialQuantity.h:75
ome::xml::model::primitives::UnitsElectricPotential::MILLIVOLT
millivolt unit.
Definition: ElectricPotentialQuantity.h:101
ome::xml::model::primitives::UnitsElectricPotential::value
enum_value value
Enumeration value.
Definition: ElectricPotentialQuantity.h:213
ome::xml::model::primitives::UnitsElectricPotential::PETAVOLT
petavolt unit.
Definition: ElectricPotentialQuantity.h:81
ome::xml::model::primitives::UnitsElectricPotential::UnitsElectricPotential
UnitsElectricPotential(enum_value value)
Construct a UnitsElectricPotential quantity by an enumeration value.
ome::xml::model::primitives::UnitsElectricPotential::CENTIVOLT
centivolt unit.
Definition: ElectricPotentialQuantity.h:99
ome::xml::model::primitives::UnitsElectricPotential::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
ome::xml::model::primitives::UnitsElectricPotential::ZEPTOVOLT
zeptovolt unit.
Definition: ElectricPotentialQuantity.h:113
ome::xml::model::primitives::UnitsElectricPotential::TERAVOLT
teravolt unit.
Definition: ElectricPotentialQuantity.h:83
ome::xml::model::primitives::UnitsElectricPotential::name
const std::string * name
Enumeration name.
Definition: ElectricPotentialQuantity.h:215
ome::xml::model::primitives::UnitsElectricPotential
UnitsElectricPotential enumeration.
Definition: ElectricPotentialQuantity.h:68
ome
Open Microscopy Environment C++ implementation.
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::UnitsElectricPotential::PICOVOLT
picovolt unit.
Definition: ElectricPotentialQuantity.h:107
ome::xml::model::primitives::UnitsElectricPotential::enum_value
enum_value
Enumeration values.
Definition: ElectricPotentialQuantity.h:72
ome::xml::model::primitives::UnitsElectricPotential::ZETTAVOLT
zettavolt unit.
Definition: ElectricPotentialQuantity.h:77
ome::xml::model::primitives::UnitsElectricPotential::HECTOVOLT
hectovolt unit.
Definition: ElectricPotentialQuantity.h:91
ome::xml::model::primitives::UnitsElectricPotential::YOCTOVOLT
yoctovolt unit.
Definition: ElectricPotentialQuantity.h:115
ome::xml::model::primitives::UnitsElectricPotential::DECAVOLT
decavolt unit.
Definition: ElectricPotentialQuantity.h:93
ome::xml::model::primitives::UnitsElectricPotential::VOLT
volt unit.
Definition: ElectricPotentialQuantity.h:95
ome::xml::model::primitives::UnitsElectricPotential::value_map_type
std::map< UnitsElectricPotential::enum_value, std::string > value_map_type
Value map type.
Definition: ElectricPotentialQuantity.h:185
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::UnitsElectricPotential::DECIVOLT
decivolt unit.
Definition: ElectricPotentialQuantity.h:97
ome::xml::model::primitives::UnitsElectricPotential::GIGAVOLT
gigavolt unit.
Definition: ElectricPotentialQuantity.h:85
ome::xml::model::primitives::UnitsElectricPotential::MICROVOLT
microvolt unit.
Definition: ElectricPotentialQuantity.h:103
ome::xml::model::primitives::UnitsElectricPotential::KILOVOLT
kilovolt unit.
Definition: ElectricPotentialQuantity.h:89
ome::xml::model::primitives::UnitsElectricPotential::values
static const value_map_type & values()
Get a map of valid enum values and string names.
ome::xml::model::primitives::UnitsElectricPotential::string_map_type
std::map< std::string, UnitsElectricPotential::enum_value > string_map_type
String map type.
Definition: ElectricPotentialQuantity.h:183
log.h
ome::xml::model::primitives::UnitsElectricPotential::FEMTOVOLT
femtovolt unit.
Definition: ElectricPotentialQuantity.h:109
ome::xml::model::primitives::UnitsElectricPotential::MEGAVOLT
megavolt unit.
Definition: ElectricPotentialQuantity.h:87