bioformats  5.1.3
LaserMedium.h
1 /*
2  * #%L
3  * OME-XML C++ library for working with OME-XML metadata structures.
4  * %%
5  * Copyright © 2006 - 2015 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 
58 namespace ome
59 {
60  namespace xml
61  {
62  namespace model
63  {
64  namespace enums
65  {
66 
71  {
72  public:
75  {
77  CU,
79  AG,
95  N,
97  AR,
99  KR,
101  XE,
107  CO,
144  };
145 
152 
167  LaserMedium (const std::string& name, bool strict = true);
168 
174  LaserMedium (const LaserMedium& original);
175 
180  inline LaserMedium&
182  {
183  this->value = rhs.value;
184  this->name = rhs.name;
185  return *this;
186  }
187 
193  inline
194  operator enum_value () const
195  {
196  return this->value;
197  }
198 
204  inline
205  operator const std::string& () const
206  {
207  return *this->name;
208  }
209 
211  typedef std::map<std::string, LaserMedium::enum_value> string_map_type;
213  typedef std::map<LaserMedium::enum_value, std::string> value_map_type;
214 
220  static const string_map_type&
221  strings();
222 
228  static const value_map_type&
229  values();
230 
231  private:
235  const std::string *name;
236 
238  static const string_map_type string_map;
240  static const string_map_type lowercase_string_map;
242  static const value_map_type value_map;
243  };
244 
252  inline bool
254  const LaserMedium& rhs)
255  {
256  return static_cast<LaserMedium::enum_value>(lhs) == static_cast<LaserMedium::enum_value>(rhs);
257  }
258 
266  inline bool
268  const LaserMedium::enum_value& rhs)
269  {
270  return static_cast<LaserMedium::enum_value>(lhs) == rhs;
271  }
272 
280  inline bool
282  const LaserMedium& rhs)
283  {
284  return lhs == static_cast<LaserMedium::enum_value>(rhs);
285  }
286 
294  inline bool
296  const std::string& rhs)
297  {
298  return static_cast<const std::string&>(lhs) == rhs;
299  }
300 
308  inline bool
309  operator== (const std::string& lhs,
310  const LaserMedium& rhs)
311  {
312  return lhs == static_cast<const std::string&>(rhs);
313  }
314 
322  inline bool
324  const LaserMedium& rhs)
325  {
326  return static_cast<LaserMedium::enum_value>(lhs) != static_cast<LaserMedium::enum_value>(rhs);
327  }
328 
336  inline bool
338  const LaserMedium::enum_value& rhs)
339  {
340  return static_cast<LaserMedium::enum_value>(lhs) != rhs;
341  }
342 
350  inline bool
352  const LaserMedium& rhs)
353  {
354  return lhs != static_cast<LaserMedium::enum_value>(rhs);
355  }
356 
364  inline bool
366  const std::string& rhs)
367  {
368  return static_cast<const std::string&>(lhs) != rhs;
369  }
370 
378  inline bool
379  operator!= (const std::string& lhs,
380  const LaserMedium& rhs)
381  {
382  return lhs != static_cast<const std::string&>(rhs);
383  }
384 
392  template<class charT, class traits>
393  inline std::basic_ostream<charT,traits>&
394  operator<< (std::basic_ostream<charT,traits>& os,
395  const LaserMedium& enumeration)
396  {
397  return os << static_cast<const std::string&>(enumeration);
398  }
399 
407  template<class charT, class traits>
408  inline std::basic_istream<charT,traits>&
409  operator>> (std::basic_istream<charT,traits>& is,
410  LaserMedium& enumeration)
411  {
412  std::string value;
413  is >> value;
414  if (is)
415  {
416  try
417  {
418  enumeration = LaserMedium(value, false);
419  }
420  catch (const EnumerationException& e)
421  {
422  is.setstate(std::ios::failbit);
423  }
424  }
425 
426  return is;
427  }
428 
429  }
430  }
431  }
432 }
433 
434 #endif // OME_XML_MODEL_ENUMS_LASERMEDIUM_H
435 
436 /*
437  * Local Variables:
438  * mode:C++
439  * End:
440  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:381
enum_value
Enumeration values.
Definition: LaserMedium.h:74
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:295
GaAlAs.
Definition: LaserMedium.h:139
XeFl.
Definition: LaserMedium.h:89
Ar.
Definition: LaserMedium.h:97
NdGlass.
Definition: LaserMedium.h:115
Other.
Definition: LaserMedium.h:143
CO.
Definition: LaserMedium.h:107
CoumarinC30.
Definition: LaserMedium.h:135
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
Kr.
Definition: LaserMedium.h:99
GaAs.
Definition: LaserMedium.h:137
ArFl.
Definition: LaserMedium.h:81
XeBr.
Definition: LaserMedium.h:93
CO2.
Definition: LaserMedium.h:109
Alexandrite.
Definition: LaserMedium.h:131
HeNe.
Definition: LaserMedium.h:103
HoYAG.
Definition: LaserMedium.h:125
H2O.
Definition: LaserMedium.h:111
Ruby.
Definition: LaserMedium.h:127
const std::string * name
Enumeration name.
Definition: LaserMedium.h:235
ErYAG.
Definition: LaserMedium.h:121
XeCl.
Definition: LaserMedium.h:91
Ag.
Definition: LaserMedium.h:79
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: LaserMedium.cpp:74
HeCd.
Definition: LaserMedium.h:105
static const string_map_type string_map
Mapping of enumeration name to value.
Definition: LaserMedium.h:238
static const value_map_type value_map
Mapping of enumeration value to name.
Definition: LaserMedium.h:242
Rhodamine6G.
Definition: LaserMedium.h:133
ErGlass.
Definition: LaserMedium.h:119
EMinus.
Definition: LaserMedium.h:141
std::map< std::string, LaserMedium::enum_value > string_map_type
String map type.
Definition: LaserMedium.h:211
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
TiSapphire.
Definition: LaserMedium.h:129
ArCl.
Definition: LaserMedium.h:83
HFl.
Definition: LaserMedium.h:113
enum_value value
Enumeration value.
Definition: LaserMedium.h:233
static const string_map_type lowercase_string_map
Mapping of lowercase enumeration name to value.
Definition: LaserMedium.h:240
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:225
NdYAG.
Definition: LaserMedium.h:117
LaserMedium & operator=(const LaserMedium &rhs)
Assignment operator.
Definition: LaserMedium.h:181
std::map< LaserMedium::enum_value, std::string > value_map_type
Value map type.
Definition: LaserMedium.h:213
KrCl.
Definition: LaserMedium.h:87
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: LaserMedium.cpp:68
N.
Definition: LaserMedium.h:95
Xe.
Definition: LaserMedium.h:101
KrFl.
Definition: LaserMedium.h:85
LaserMedium(enum_value value)
Construct a LaserMedium enumeration by an enumeration value.
Definition: LaserMedium.cpp:216
Cu.
Definition: LaserMedium.h:77
HoYLF.
Definition: LaserMedium.h:123
LaserMedium enumeration.
Definition: LaserMedium.h:70
Boost.Log compatibility.
Xerces-C modern C++ wrapper.
Definition: Base.h:53