ome-xml  5.6.0
UnitsFrequency.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_UNITSFREQUENCY_H
47 #define OME_XML_MODEL_ENUMS_UNITSFREQUENCY_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 UnitsFrequency enumeration.
60 #define OME_XML_MODEL_ENUMS_UNITSFREQUENCY_VALUES (YOTTAHERTZ)(ZETTAHERTZ)(EXAHERTZ)(PETAHERTZ)(TERAHERTZ)(GIGAHERTZ)(MEGAHERTZ)(KILOHERTZ)(HECTOHERTZ)(DECAHERTZ)(HERTZ)(DECIHERTZ)(CENTIHERTZ)(MILLIHERTZ)(MICROHERTZ)(NANOHERTZ)(PICOHERTZ)(FEMTOHERTZ)(ATTOHERTZ)(ZEPTOHERTZ)(YOCTOHERTZ)
61 
62 namespace ome
63 {
64  namespace xml
65  {
66  namespace model
67  {
68  namespace enums
69  {
70 
75  {
76  public:
79  {
164  };
165 
172 
187  UnitsFrequency (const std::string& name, bool strict = true);
188 
194  UnitsFrequency (const UnitsFrequency& original);
195 
202  inline UnitsFrequency&
204  {
205  this->value = rhs.value;
206  this->name = rhs.name;
207  return *this;
208  }
209 
215  inline
216  operator enum_value () const
217  {
218  return this->value;
219  }
220 
226  inline
227  operator const std::string& () const
228  {
229  return *this->name;
230  }
231 
233  typedef std::map<std::string, UnitsFrequency::enum_value> string_map_type;
235  typedef std::map<UnitsFrequency::enum_value, std::string> value_map_type;
236 
242  static const string_map_type&
243  strings();
244 
250  static const value_map_type&
251  values();
252 
253  private:
259  static const string_map_type&
261 
265  const std::string *name;
266  };
267 
275  inline bool
277  const UnitsFrequency& rhs)
278  {
279  return static_cast<UnitsFrequency::enum_value>(lhs) == static_cast<UnitsFrequency::enum_value>(rhs);
280  }
281 
289  inline bool
291  const UnitsFrequency::enum_value& rhs)
292  {
293  return static_cast<UnitsFrequency::enum_value>(lhs) == rhs;
294  }
295 
303  inline bool
305  const UnitsFrequency& rhs)
306  {
307  return lhs == static_cast<UnitsFrequency::enum_value>(rhs);
308  }
309 
317  inline bool
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 UnitsFrequency& rhs)
334  {
335  return lhs == static_cast<const std::string&>(rhs);
336  }
337 
345  inline bool
347  const UnitsFrequency& rhs)
348  {
349  return static_cast<UnitsFrequency::enum_value>(lhs) != static_cast<UnitsFrequency::enum_value>(rhs);
350  }
351 
359  inline bool
361  const UnitsFrequency::enum_value& rhs)
362  {
363  return static_cast<UnitsFrequency::enum_value>(lhs) != rhs;
364  }
365 
373  inline bool
375  const UnitsFrequency& rhs)
376  {
377  return lhs != static_cast<UnitsFrequency::enum_value>(rhs);
378  }
379 
387  inline bool
389  const std::string& rhs)
390  {
391  return static_cast<const std::string&>(lhs) != rhs;
392  }
393 
401  inline bool
402  operator!= (const std::string& lhs,
403  const UnitsFrequency& rhs)
404  {
405  return lhs != static_cast<const std::string&>(rhs);
406  }
407 
415  template<class charT, class traits>
416  inline std::basic_ostream<charT,traits>&
417  operator<< (std::basic_ostream<charT,traits>& os,
418  const UnitsFrequency& enumeration)
419  {
420  return os << static_cast<const std::string&>(enumeration);
421  }
422 
430  template<class charT, class traits>
431  inline std::basic_istream<charT,traits>&
432  operator>> (std::basic_istream<charT,traits>& is,
433  UnitsFrequency& enumeration)
434  {
435  std::string value;
436  is >> value;
437  if (is)
438  {
439  try
440  {
441  enumeration = UnitsFrequency(value, false);
442  }
443  catch (const EnumerationException&)
444  {
445  is.setstate(std::ios::failbit);
446  }
447  }
448 
449  return is;
450  }
451 
452  }
453  }
454  }
455 }
456 
457 #include <ome/xml/model/enums/UnitsFrequencyConvert.h>
458 
459 #endif // OME_XML_MODEL_ENUMS_UNITSFREQUENCY_H
460 
461 /*
462  * Local Variables:
463  * mode:C++
464  * End:
465  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:392
zettahertz unit.
Definition: UnitsFrequency.h:87
nanohertz unit.
Definition: UnitsFrequency.h:143
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:306
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: UnitsFrequency.cpp:130
std::map< std::string, UnitsFrequency::enum_value > string_map_type
String map type.
Definition: UnitsFrequency.h:233
yoctohertz unit.
Definition: UnitsFrequency.h:163
petahertz unit.
Definition: UnitsFrequency.h:95
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
femtohertz unit.
Definition: UnitsFrequency.h:151
picohertz unit.
Definition: UnitsFrequency.h:147
centihertz unit.
Definition: UnitsFrequency.h:131
gigahertz unit.
Definition: UnitsFrequency.h:103
attohertz unit.
Definition: UnitsFrequency.h:155
yottahertz unit.
Definition: UnitsFrequency.h:83
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: UnitsFrequency.cpp:192
decahertz unit.
Definition: UnitsFrequency.h:119
hertz unit.
Definition: UnitsFrequency.h:123
megahertz unit.
Definition: UnitsFrequency.h:107
const std::string * name
Enumeration name.
Definition: UnitsFrequency.h:265
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: UnitsFrequency.cpp:161
Open Microscopy Environment C++ implementation.
std::map< UnitsFrequency::enum_value, std::string > value_map_type
Value map type.
Definition: UnitsFrequency.h:235
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:236
hectohertz unit.
Definition: UnitsFrequency.h:115
microhertz unit.
Definition: UnitsFrequency.h:139
UnitsFrequency & operator=(const UnitsFrequency &rhs)
Assignment operator.
Definition: UnitsFrequency.h:203
millihertz unit.
Definition: UnitsFrequency.h:135
exahertz unit.
Definition: UnitsFrequency.h:91
UnitsFrequency enumeration.
Definition: UnitsFrequency.h:74
enum_value value
Enumeration value.
Definition: UnitsFrequency.h:263
decihertz unit.
Definition: UnitsFrequency.h:127
UnitsFrequency(enum_value value)
Construct a UnitsFrequency enumeration by an enumeration value.
Definition: UnitsFrequency.cpp:67
enum_value
Enumeration values.
Definition: UnitsFrequency.h:78
kilohertz unit.
Definition: UnitsFrequency.h:111
terahertz unit.
Definition: UnitsFrequency.h:99
zeptohertz unit.
Definition: UnitsFrequency.h:159