ome-xml  5.5.0
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 
69  {
70  public:
73  {
116  };
117 
124 
139  UnitsElectricPotential (const std::string& name, bool strict = true);
140 
147 
152  inline UnitsElectricPotential&
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&
211 
215  const std::string *name;
216  };
217 
225  inline bool
227  const UnitsElectricPotential& rhs)
228  {
229  return static_cast<UnitsElectricPotential::enum_value>(lhs) == static_cast<UnitsElectricPotential::enum_value>(rhs);
230  }
231 
239  inline bool
242  {
243  return static_cast<UnitsElectricPotential::enum_value>(lhs) == rhs;
244  }
245 
253  inline bool
255  const UnitsElectricPotential& rhs)
256  {
257  return lhs == static_cast<UnitsElectricPotential::enum_value>(rhs);
258  }
259 
267  inline bool
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
297  const UnitsElectricPotential& rhs)
298  {
299  return static_cast<UnitsElectricPotential::enum_value>(lhs) != static_cast<UnitsElectricPotential::enum_value>(rhs);
300  }
301 
309  inline bool
312  {
313  return static_cast<UnitsElectricPotential::enum_value>(lhs) != rhs;
314  }
315 
323  inline bool
325  const UnitsElectricPotential& rhs)
326  {
327  return lhs != static_cast<UnitsElectricPotential::enum_value>(rhs);
328  }
329 
337  inline bool
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  */
attovolt unit.
Definition: ElectricPotentialQuantity.h:111
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
UnitsElectricPotential & operator=(const UnitsElectricPotential &rhs)
Assignment operator.
Definition: ElectricPotentialQuantity.h:153
exavolt unit.
Definition: ElectricPotentialQuantity.h:79
nanovolt unit.
Definition: ElectricPotentialQuantity.h:105
bool operator!=(const Color &lhs, const Color &rhs)
Compare two Color objects for non-equality.
Definition: Color.h:392
yottavolt unit.
Definition: ElectricPotentialQuantity.h:75
millivolt unit.
Definition: ElectricPotentialQuantity.h:101
enum_value value
Enumeration value.
Definition: ElectricPotentialQuantity.h:213
petavolt unit.
Definition: ElectricPotentialQuantity.h:81
UnitsElectricPotential(enum_value value)
Construct a UnitsElectricPotential quantity by an enumeration value.
centivolt unit.
Definition: ElectricPotentialQuantity.h:99
static const string_map_type & strings()
Get a map of valid string names and enum values.
zeptovolt unit.
Definition: ElectricPotentialQuantity.h:113
teravolt unit.
Definition: ElectricPotentialQuantity.h:83
const std::string * name
Enumeration name.
Definition: ElectricPotentialQuantity.h:215
UnitsElectricPotential enumeration.
Definition: ElectricPotentialQuantity.h:68
Open Microscopy Environment C++ implementation.
bool operator==(const Color &lhs, const Color &rhs)
Compare two Color objects for equality.
Definition: Color.h:322
picovolt unit.
Definition: ElectricPotentialQuantity.h:107
enum_value
Enumeration values.
Definition: ElectricPotentialQuantity.h:72
zettavolt unit.
Definition: ElectricPotentialQuantity.h:77
hectovolt unit.
Definition: ElectricPotentialQuantity.h:91
yoctovolt unit.
Definition: ElectricPotentialQuantity.h:115
decavolt unit.
Definition: ElectricPotentialQuantity.h:93
volt unit.
Definition: ElectricPotentialQuantity.h:95
std::map< UnitsElectricPotential::enum_value, std::string > value_map_type
Value map type.
Definition: ElectricPotentialQuantity.h:185
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, Color &color)
Set Color from input stream.
Definition: Color.h:478
decivolt unit.
Definition: ElectricPotentialQuantity.h:97
gigavolt unit.
Definition: ElectricPotentialQuantity.h:85
microvolt unit.
Definition: ElectricPotentialQuantity.h:103
kilovolt unit.
Definition: ElectricPotentialQuantity.h:89
static const value_map_type & values()
Get a map of valid enum values and string names.
std::map< std::string, UnitsElectricPotential::enum_value > string_map_type
String map type.
Definition: ElectricPotentialQuantity.h:183
femtovolt unit.
Definition: ElectricPotentialQuantity.h:109
megavolt unit.
Definition: ElectricPotentialQuantity.h:87