ome-xml 5.2.0

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

- File List

DetectorType.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_DETECTORTYPE_H
47 #define OME_XML_MODEL_ENUMS_DETECTORTYPE_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 DetectorType enumeration.
58 #define OME_XML_MODEL_ENUMS_DETECTORTYPE_VALUES (CCD)(INTENSIFIEDCCD)(ANALOGVIDEO)(PMT)(PHOTODIODE)(SPECTROSCOPY)(LIFETIMEIMAGING)(CORRELATIONSPECTROSCOPY)(FTIR)(EMCCD)(APD)(CMOS)(EBCCD)(OTHER)
59
60 namespace ome
61 {
62 namespace xml
63 {
64 namespace model
65 {
66 namespace enums
67 {
68
72 class DetectorType
73 {
74 public:
76 enum enum_value
77 {
79 CCD,
81 INTENSIFIEDCCD,
83 ANALOGVIDEO,
85 PMT,
87 PHOTODIODE,
89 SPECTROSCOPY,
91 LIFETIMEIMAGING,
93 CORRELATIONSPECTROSCOPY,
95 FTIR,
97 EMCCD,
99 APD,
101 CMOS,
103 EBCCD,
105 OTHER
106 };
107
113 DetectorType (enum_value value);
114
129 DetectorType (const std::string& name, bool strict = true);
130
136 DetectorType (const DetectorType& original);
137
142 inline DetectorType&
143 operator= (const DetectorType& rhs)
144 {
145 this->value = rhs.value;
146 this->name = rhs.name;
147 return *this;
148 }
149
155 inline
156 operator enum_value () const
157 {
158 return this->value;
159 }
160
166 inline
167 operator const std::string& () const
168 {
169 return *this->name;
170 }
171
173 typedef std::map<std::string, DetectorType::enum_value> string_map_type;
175 typedef std::map<DetectorType::enum_value, std::string> value_map_type;
176
182 static const string_map_type&
183 strings();
184
190 static const value_map_type&
191 values();
192
193 private:
199 static const string_map_type&
200 lowercase_strings();
201
203 enum_value value;
205 const std::string *name;
206 };
207
215 inline bool
216 operator== (const DetectorType& lhs,
217 const DetectorType& rhs)
218 {
219 return static_cast<DetectorType::enum_value>(lhs) == static_cast<DetectorType::enum_value>(rhs);
220 }
221
229 inline bool
230 operator== (const DetectorType& lhs,
231 const DetectorType::enum_value& rhs)
232 {
233 return static_cast<DetectorType::enum_value>(lhs) == rhs;
234 }
235
243 inline bool
244 operator== (const DetectorType::enum_value& lhs,
245 const DetectorType& rhs)
246 {
247 return lhs == static_cast<DetectorType::enum_value>(rhs);
248 }
249
257 inline bool
258 operator== (const DetectorType& lhs,
259 const std::string& rhs)
260 {
261 return static_cast<const std::string&>(lhs) == rhs;
262 }
263
271 inline bool
272 operator== (const std::string& lhs,
273 const DetectorType& rhs)
274 {
275 return lhs == static_cast<const std::string&>(rhs);
276 }
277
285 inline bool
286 operator!= (const DetectorType& lhs,
287 const DetectorType& rhs)
288 {
289 return static_cast<DetectorType::enum_value>(lhs) != static_cast<DetectorType::enum_value>(rhs);
290 }
291
299 inline bool
300 operator!= (const DetectorType& lhs,
301 const DetectorType::enum_value& rhs)
302 {
303 return static_cast<DetectorType::enum_value>(lhs) != rhs;
304 }
305
313 inline bool
314 operator!= (const DetectorType::enum_value& lhs,
315 const DetectorType& rhs)
316 {
317 return lhs != static_cast<DetectorType::enum_value>(rhs);
318 }
319
327 inline bool
328 operator!= (const DetectorType& lhs,
329 const std::string& rhs)
330 {
331 return static_cast<const std::string&>(lhs) != rhs;
332 }
333
341 inline bool
342 operator!= (const std::string& lhs,
343 const DetectorType& rhs)
344 {
345 return lhs != static_cast<const std::string&>(rhs);
346 }
347
355 template<class charT, class traits>
356 inline std::basic_ostream<charT,traits>&
357 operator<< (std::basic_ostream<charT,traits>& os,
358 const DetectorType& enumeration)
359 {
360 return os << static_cast<const std::string&>(enumeration);
361 }
362
370 template<class charT, class traits>
371 inline std::basic_istream<charT,traits>&
372 operator>> (std::basic_istream<charT,traits>& is,
373 DetectorType& enumeration)
374 {
375 std::string value;
376 is >> value;
377 if (is)
378 {
379 try
380 {
381 enumeration = DetectorType(value, false);
382 }
383 catch (const EnumerationException&)
384 {
385 is.setstate(std::ios::failbit);
386 }
387 }
388
389 return is;
390 }
391
392 }
393 }
394 }
395 }
396
397 #endif // OME_XML_MODEL_ENUMS_DETECTORTYPE_H
398
399 /*
400 * Local Variables:
401 * mode:C++
402 * End:
403 */
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::operator!=
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:298
ome::xml::model::enums::DetectorType::name
const std::string * name
Enumeration name.
Definition: DetectorType.h:205
ome::xml::model::enums::DetectorType::INTENSIFIEDCCD
IntensifiedCCD.
Definition: DetectorType.h:81
ome::xml::model::enums::DetectorType::enum_value
enum_value
Enumeration values.
Definition: DetectorType.h:76
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::DetectorType::value
enum_value value
Enumeration value.
Definition: DetectorType.h:203
ome::xml::model::enums::DetectorType::PHOTODIODE
Photodiode.
Definition: DetectorType.h:87
ome::xml::model::enums::DetectorType::APD
APD.
Definition: DetectorType.h:99
ome::xml::model::enums::DetectorType::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: DetectorType.cpp:153
ome::xml::model::enums::DetectorType::EBCCD
EBCCD.
Definition: DetectorType.h:103
ome::xml::model::enums::DetectorType::EMCCD
EMCCD.
Definition: DetectorType.h:97
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::DetectorType::PMT
PMT.
Definition: DetectorType.h:85
ome::xml::model::enums::DetectorType::DetectorType
DetectorType(enum_value value)
Construct a DetectorType enumeration by an enumeration value.
Definition: DetectorType.cpp:75
ome::xml::model::enums::DetectorType
DetectorType enumeration.
Definition: DetectorType.h:72
ome::xml::model::enums::DetectorType::CORRELATIONSPECTROSCOPY
CorrelationSpectroscopy.
Definition: DetectorType.h:93
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::DetectorType::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: DetectorType.cpp:207
ome::xml::model::enums::DetectorType::value_map_type
std::map< DetectorType::enum_value, std::string > value_map_type
Value map type.
Definition: DetectorType.h:175
ome::xml::model::enums::DetectorType::SPECTROSCOPY
Spectroscopy.
Definition: DetectorType.h:89
ome::xml::model::enums::DetectorType::operator=
DetectorType & operator=(const DetectorType &rhs)
Assignment operator.
Definition: DetectorType.h:143
ome::xml::model::enums::DetectorType::string_map_type
std::map< std::string, DetectorType::enum_value > string_map_type
String map type.
Definition: DetectorType.h:173
ome::xml::model::enums::DetectorType::CCD
CCD.
Definition: DetectorType.h:79
ome::xml::model::enums::DetectorType::FTIR
FTIR.
Definition: DetectorType.h:95
ome::xml::model::enums::DetectorType::OTHER
Other.
Definition: DetectorType.h:105
ome::xml::model::enums::DetectorType::LIFETIMEIMAGING
LifetimeImaging.
Definition: DetectorType.h:91
ome::xml::model::enums::DetectorType::ANALOGVIDEO
AnalogVideo.
Definition: DetectorType.h:83
log.h
ome::xml::model::enums::DetectorType::CMOS
CMOS.
Definition: DetectorType.h:101
ome::xml::model::enums::DetectorType::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: DetectorType.cpp:180