ome-xml 5.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
72 class LaserMedium
73 {
74 public:
76 enum enum_value
77 {
79 CU,
81 AG,
83 ARFL,
85 ARCL,
87 KRFL,
89 KRCL,
91 XEFL,
93 XECL,
95 XEBR,
97 N,
99 AR,
101 KR,
103 XE,
105 HENE,
107 HECD,
109 CO,
111 CO2,
113 H2O,
115 HFL,
117 NDGLASS,
119 NDYAG,
121 ERGLASS,
123 ERYAG,
125 HOYLF,
127 HOYAG,
129 RUBY,
131 TISAPPHIRE,
133 ALEXANDRITE,
135 RHODAMINE6G,
137 COUMARINC30,
139 GAAS,
141 GAALAS,
143 EMINUS,
145 OTHER
146 };
147
153 LaserMedium (enum_value value);
154
169 LaserMedium (const std::string& name, bool strict = true);
170
176 LaserMedium (const LaserMedium& original);
177
182 inline LaserMedium&
183 operator= (const LaserMedium& rhs)
184 {
185 this->value = rhs.value;
186 this->name = rhs.name;
187 return *this;
188 }
189
195 inline
196 operator enum_value () const
197 {
198 return this->value;
199 }
200
206 inline
207 operator const std::string& () const
208 {
209 return *this->name;
210 }
211
213 typedef std::map<std::string, LaserMedium::enum_value> string_map_type;
215 typedef std::map<LaserMedium::enum_value, std::string> value_map_type;
216
222 static const string_map_type&
223 strings();
224
230 static const value_map_type&
231 values();
232
233 private:
239 static const string_map_type&
240 lowercase_strings();
241
243 enum_value value;
245 const std::string *name;
246 };
247
255 inline bool
256 operator== (const LaserMedium& lhs,
257 const LaserMedium& rhs)
258 {
259 return static_cast<LaserMedium::enum_value>(lhs) == static_cast<LaserMedium::enum_value>(rhs);
260 }
261
269 inline bool
270 operator== (const LaserMedium& lhs,
271 const LaserMedium::enum_value& rhs)
272 {
273 return static_cast<LaserMedium::enum_value>(lhs) == rhs;
274 }
275
283 inline bool
284 operator== (const LaserMedium::enum_value& lhs,
285 const LaserMedium& rhs)
286 {
287 return lhs == static_cast<LaserMedium::enum_value>(rhs);
288 }
289
297 inline bool
298 operator== (const LaserMedium& lhs,
299 const std::string& rhs)
300 {
301 return static_cast<const std::string&>(lhs) == rhs;
302 }
303
311 inline bool
312 operator== (const std::string& lhs,
313 const LaserMedium& rhs)
314 {
315 return lhs == static_cast<const std::string&>(rhs);
316 }
317
325 inline bool
326 operator!= (const LaserMedium& lhs,
327 const LaserMedium& rhs)
328 {
329 return static_cast<LaserMedium::enum_value>(lhs) != static_cast<LaserMedium::enum_value>(rhs);
330 }
331
339 inline bool
340 operator!= (const LaserMedium& lhs,
341 const LaserMedium::enum_value& rhs)
342 {
343 return static_cast<LaserMedium::enum_value>(lhs) != rhs;
344 }
345
353 inline bool
354 operator!= (const LaserMedium::enum_value& lhs,
355 const LaserMedium& rhs)
356 {
357 return lhs != static_cast<LaserMedium::enum_value>(rhs);
358 }
359
367 inline bool
368 operator!= (const LaserMedium& lhs,
369 const std::string& rhs)
370 {
371 return static_cast<const std::string&>(lhs) != rhs;
372 }
373
381 inline bool
382 operator!= (const std::string& lhs,
383 const LaserMedium& rhs)
384 {
385 return lhs != static_cast<const std::string&>(rhs);
386 }
387
395 template<class charT, class traits>
396 inline std::basic_ostream<charT,traits>&
397 operator<< (std::basic_ostream<charT,traits>& os,
398 const LaserMedium& enumeration)
399 {
400 return os << static_cast<const std::string&>(enumeration);
401 }
402
410 template<class charT, class traits>
411 inline std::basic_istream<charT,traits>&
412 operator>> (std::basic_istream<charT,traits>& is,
413 LaserMedium& enumeration)
414 {
415 std::string value;
416 is >> value;
417 if (is)
418 {
419 try
420 {
421 enumeration = LaserMedium(value, false);
422 }
423 catch (const EnumerationException&)
424 {
425 is.setstate(std::ios::failbit);
426 }
427 }
428
429 return is;
430 }
431
432 }
433 }
434 }
435 }
436
437 #endif // OME_XML_MODEL_ENUMS_LASERMEDIUM_H
438
439 /*
440 * Local Variables:
441 * mode:C++
442 * End:
443 */
ome::xml::model::enums::operator>>
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:384
ome::xml::model::enums::LaserMedium::enum_value
enum_value
Enumeration values.
Definition: LaserMedium.h:76
ome::xml::model::enums::operator!=
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:298
ome::xml::model::enums::LaserMedium::GAALAS
GaAlAs.
Definition: LaserMedium.h:141
ome::xml::model::enums::LaserMedium::XEFL
XeFl.
Definition: LaserMedium.h:91
ome::xml::model::enums::LaserMedium::AR
Ar.
Definition: LaserMedium.h:99
ome::xml::model::enums::LaserMedium::NDGLASS
NdGlass.
Definition: LaserMedium.h:117
ome::xml::model::enums::LaserMedium::OTHER
Other.
Definition: LaserMedium.h:145
ome::xml::model::enums::LaserMedium::CO
CO.
Definition: LaserMedium.h:109
ome::xml::model::enums::LaserMedium::COUMARINC30
CoumarinC30.
Definition: LaserMedium.h:137
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::LaserMedium::KR
Kr.
Definition: LaserMedium.h:101
ome::xml::model::enums::LaserMedium::GAAS
GaAs.
Definition: LaserMedium.h:139
ome::xml::model::enums::LaserMedium::ARFL
ArFl.
Definition: LaserMedium.h:83
ome::xml::model::enums::LaserMedium::XEBR
XeBr.
Definition: LaserMedium.h:95
ome::xml::model::enums::LaserMedium::CO2
CO2.
Definition: LaserMedium.h:111
ome::xml::model::enums::LaserMedium::ALEXANDRITE
Alexandrite.
Definition: LaserMedium.h:133
ome::xml::model::enums::LaserMedium::HENE
HeNe.
Definition: LaserMedium.h:105
ome::xml::model::enums::LaserMedium::HOYAG
HoYAG.
Definition: LaserMedium.h:127
ome::xml::model::enums::LaserMedium::H2O
H2O.
Definition: LaserMedium.h:113
ome::xml::model::enums::LaserMedium::RUBY
Ruby.
Definition: LaserMedium.h:129
ome::xml::model::enums::LaserMedium::name
const std::string * name
Enumeration name.
Definition: LaserMedium.h:245
ome::xml::model::enums::LaserMedium::ERYAG
ErYAG.
Definition: LaserMedium.h:123
ome::xml::model::enums::LaserMedium::XECL
XeCl.
Definition: LaserMedium.h:93
ome::xml::model::enums::LaserMedium::AG
Ag.
Definition: LaserMedium.h:81
ome::xml::model::enums::LaserMedium::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: LaserMedium.cpp:200
ome::xml::model::enums::LaserMedium::HECD
HeCd.
Definition: LaserMedium.h:107
ome::xml::model::enums::LaserMedium::RHODAMINE6G
Rhodamine6G.
Definition: LaserMedium.h:135
ome::xml::model::enums::LaserMedium::ERGLASS
ErGlass.
Definition: LaserMedium.h:121
ome::xml::model::enums::LaserMedium::EMINUS
EMinus.
Definition: LaserMedium.h:143
ome::xml::model::enums::LaserMedium::string_map_type
std::map< std::string, LaserMedium::enum_value > string_map_type
String map type.
Definition: LaserMedium.h:213
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::LaserMedium::TISAPPHIRE
TiSapphire.
Definition: LaserMedium.h:131
ome::xml::model::enums::LaserMedium::ARCL
ArCl.
Definition: LaserMedium.h:85
ome::xml::model::enums::LaserMedium::HFL
HFl.
Definition: LaserMedium.h:115
ome::xml::model::enums::LaserMedium::value
enum_value value
Enumeration value.
Definition: LaserMedium.h:243
ome::xml::model::enums::operator==
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:228
ome::xml::model::enums::LaserMedium::NDYAG
NdYAG.
Definition: LaserMedium.h:119
ome::xml::model::enums::LaserMedium::operator=
LaserMedium & operator=(const LaserMedium &rhs)
Assignment operator.
Definition: LaserMedium.h:183
ome::xml::model::enums::LaserMedium::value_map_type
std::map< LaserMedium::enum_value, std::string > value_map_type
Value map type.
Definition: LaserMedium.h:215
ome::xml::model::enums::LaserMedium::KRCL
KrCl.
Definition: LaserMedium.h:89
ome::xml::model::enums::LaserMedium::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: LaserMedium.cpp:247
ome::xml::model::enums::LaserMedium::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: LaserMedium.cpp:153
ome::xml::model::enums::LaserMedium::N
N.
Definition: LaserMedium.h:97
ome::xml::model::enums::LaserMedium::XE
Xe.
Definition: LaserMedium.h:103
ome::xml::model::enums::LaserMedium::KRFL
KrFl.
Definition: LaserMedium.h:87
ome::xml::model::enums::LaserMedium::LaserMedium
LaserMedium(enum_value value)
Construct a LaserMedium enumeration by an enumeration value.
Definition: LaserMedium.cpp:75
ome::xml::model::enums::LaserMedium::CU
Cu.
Definition: LaserMedium.h:79
ome::xml::model::enums::LaserMedium::HOYLF
HoYLF.
Definition: LaserMedium.h:125
ome::xml::model::enums::LaserMedium
LaserMedium enumeration.
Definition: LaserMedium.h:72
log.h