ome-xml  5.6.0
LaserMedium.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_LASERMEDIUM_H
47 #define OME_XML_MODEL_ENUMS_LASERMEDIUM_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 // All values in the LaserMedium enumeration.
58 #define OME_XML_MODEL_ENUMS_LASERMEDIUM_VALUES (CU)(AG)(ARFL)(ARCL)(KRFL)(KRCL)(XEFL)(XECL)(XEBR)(N)(AR)(KR)(XE)(HENE)(HECD)(CO)(CO2)(H2O)(HFL)(NDGLASS)(NDYAG)(ERGLASS)(ERYAG)(HOYLF)(HOYAG)(RUBY)(TISAPPHIRE)(ALEXANDRITE)(RHODAMINE6G)(COUMARINC30)(GAAS)(GAALAS)(EMINUS)(OTHER)
59 
60 namespace ome
61 {
62  namespace xml
63  {
64  namespace model
65  {
66  namespace enums
67  {
68 
73  {
74  public:
77  {
79  CU,
81  AG,
97  N,
99  AR,
101  KR,
103  XE,
109  CO,
146  };
147 
154 
169  LaserMedium (const std::string& name, bool strict = true);
170 
176  LaserMedium (const LaserMedium& original);
177 
184  inline LaserMedium&
186  {
187  this->value = rhs.value;
188  this->name = rhs.name;
189  return *this;
190  }
191 
197  inline
198  operator enum_value () const
199  {
200  return this->value;
201  }
202 
208  inline
209  operator const std::string& () const
210  {
211  return *this->name;
212  }
213 
215  typedef std::map<std::string, LaserMedium::enum_value> string_map_type;
217  typedef std::map<LaserMedium::enum_value, std::string> value_map_type;
218 
224  static const string_map_type&
225  strings();
226 
232  static const value_map_type&
233  values();
234 
235  private:
241  static const string_map_type&
243 
247  const std::string *name;
248  };
249 
257  inline bool
259  const LaserMedium& rhs)
260  {
261  return static_cast<LaserMedium::enum_value>(lhs) == static_cast<LaserMedium::enum_value>(rhs);
262  }
263 
271  inline bool
273  const LaserMedium::enum_value& rhs)
274  {
275  return static_cast<LaserMedium::enum_value>(lhs) == rhs;
276  }
277 
285  inline bool
287  const LaserMedium& rhs)
288  {
289  return lhs == static_cast<LaserMedium::enum_value>(rhs);
290  }
291 
299  inline bool
301  const std::string& rhs)
302  {
303  return static_cast<const std::string&>(lhs) == rhs;
304  }
305 
313  inline bool
314  operator== (const std::string& lhs,
315  const LaserMedium& rhs)
316  {
317  return lhs == static_cast<const std::string&>(rhs);
318  }
319 
327  inline bool
329  const LaserMedium& rhs)
330  {
331  return static_cast<LaserMedium::enum_value>(lhs) != static_cast<LaserMedium::enum_value>(rhs);
332  }
333 
341  inline bool
343  const LaserMedium::enum_value& rhs)
344  {
345  return static_cast<LaserMedium::enum_value>(lhs) != rhs;
346  }
347 
355  inline bool
357  const LaserMedium& rhs)
358  {
359  return lhs != static_cast<LaserMedium::enum_value>(rhs);
360  }
361 
369  inline bool
371  const std::string& rhs)
372  {
373  return static_cast<const std::string&>(lhs) != rhs;
374  }
375 
383  inline bool
384  operator!= (const std::string& lhs,
385  const LaserMedium& rhs)
386  {
387  return lhs != static_cast<const std::string&>(rhs);
388  }
389 
397  template<class charT, class traits>
398  inline std::basic_ostream<charT,traits>&
399  operator<< (std::basic_ostream<charT,traits>& os,
400  const LaserMedium& enumeration)
401  {
402  return os << static_cast<const std::string&>(enumeration);
403  }
404 
412  template<class charT, class traits>
413  inline std::basic_istream<charT,traits>&
414  operator>> (std::basic_istream<charT,traits>& is,
415  LaserMedium& enumeration)
416  {
417  std::string value;
418  is >> value;
419  if (is)
420  {
421  try
422  {
423  enumeration = LaserMedium(value, false);
424  }
425  catch (const EnumerationException&)
426  {
427  is.setstate(std::ios::failbit);
428  }
429  }
430 
431  return is;
432  }
433 
434  }
435  }
436  }
437 }
438 
439 #endif // OME_XML_MODEL_ENUMS_LASERMEDIUM_H
440 
441 /*
442  * Local Variables:
443  * mode:C++
444  * End:
445  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:392
enum_value
Enumeration values.
Definition: LaserMedium.h:76
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:306
GaAlAs.
Definition: LaserMedium.h:141
XeFl.
Definition: LaserMedium.h:91
Ar.
Definition: LaserMedium.h:99
NdGlass.
Definition: LaserMedium.h:117
Other.
Definition: LaserMedium.h:145
CO.
Definition: LaserMedium.h:109
CoumarinC30.
Definition: LaserMedium.h:137
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
Kr.
Definition: LaserMedium.h:101
GaAs.
Definition: LaserMedium.h:139
ArFl.
Definition: LaserMedium.h:83
XeBr.
Definition: LaserMedium.h:95
CO2.
Definition: LaserMedium.h:111
Alexandrite.
Definition: LaserMedium.h:133
HeNe.
Definition: LaserMedium.h:105
HoYAG.
Definition: LaserMedium.h:127
H2O.
Definition: LaserMedium.h:113
Ruby.
Definition: LaserMedium.h:129
const std::string * name
Enumeration name.
Definition: LaserMedium.h:247
ErYAG.
Definition: LaserMedium.h:123
XeCl.
Definition: LaserMedium.h:93
Ag.
Definition: LaserMedium.h:81
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: LaserMedium.cpp:189
HeCd.
Definition: LaserMedium.h:107
Rhodamine6G.
Definition: LaserMedium.h:135
ErGlass.
Definition: LaserMedium.h:121
EMinus.
Definition: LaserMedium.h:143
std::map< std::string, LaserMedium::enum_value > string_map_type
String map type.
Definition: LaserMedium.h:215
Open Microscopy Environment C++ implementation.
TiSapphire.
Definition: LaserMedium.h:131
ArCl.
Definition: LaserMedium.h:85
HFl.
Definition: LaserMedium.h:115
enum_value value
Enumeration value.
Definition: LaserMedium.h:245
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:236
NdYAG.
Definition: LaserMedium.h:119
LaserMedium & operator=(const LaserMedium &rhs)
Assignment operator.
Definition: LaserMedium.h:185
std::map< LaserMedium::enum_value, std::string > value_map_type
Value map type.
Definition: LaserMedium.h:217
KrCl.
Definition: LaserMedium.h:89
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: LaserMedium.cpp:233
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: LaserMedium.cpp:145
N.
Definition: LaserMedium.h:97
Xe.
Definition: LaserMedium.h:103
KrFl.
Definition: LaserMedium.h:87
LaserMedium(enum_value value)
Construct a LaserMedium enumeration by an enumeration value.
Definition: LaserMedium.cpp:67
Cu.
Definition: LaserMedium.h:79
HoYLF.
Definition: LaserMedium.h:125
LaserMedium enumeration.
Definition: LaserMedium.h:72