ome-xml 5.2.3

Correction.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_CORRECTION_H
47 #define OME_XML_MODEL_ENUMS_CORRECTION_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 Correction enumeration.
58 #define OME_XML_MODEL_ENUMS_CORRECTION_VALUES (UV)(PLANAPO)(PLANFLUOR)(SUPERFLUOR)(VIOLETCORRECTED)(ACHRO)(ACHROMAT)(FLUOR)(FL)(FLUAR)(NEOFLUAR)(FLUOTAR)(APO)(PLANNEOFLUAR)(OTHER)
59
60 namespace ome
61 {
62 namespace xml
63 {
64 namespace model
65 {
66 namespace enums
67 {
68
72 class Correction
73 {
74 public:
76 enum enum_value
77 {
79 UV,
81 PLANAPO,
83 PLANFLUOR,
85 SUPERFLUOR,
87 VIOLETCORRECTED,
89 ACHRO,
91 ACHROMAT,
93 FLUOR,
95 FL,
97 FLUAR,
99 NEOFLUAR,
101 FLUOTAR,
103 APO,
105 PLANNEOFLUAR,
107 OTHER
108 };
109
115 Correction (enum_value value);
116
131 Correction (const std::string& name, bool strict = true);
132
138 Correction (const Correction& original);
139
144 inline Correction&
145 operator= (const Correction& rhs)
146 {
147 this->value = rhs.value;
148 this->name = rhs.name;
149 return *this;
150 }
151
157 inline
158 operator enum_value () const
159 {
160 return this->value;
161 }
162
168 inline
169 operator const std::string& () const
170 {
171 return *this->name;
172 }
173
175 typedef std::map<std::string, Correction::enum_value> string_map_type;
177 typedef std::map<Correction::enum_value, std::string> value_map_type;
178
184 static const string_map_type&
185 strings();
186
192 static const value_map_type&
193 values();
194
195 private:
201 static const string_map_type&
202 lowercase_strings();
203
205 enum_value value;
207 const std::string *name;
208 };
209
217 inline bool
218 operator== (const Correction& lhs,
219 const Correction& rhs)
220 {
221 return static_cast<Correction::enum_value>(lhs) == static_cast<Correction::enum_value>(rhs);
222 }
223
231 inline bool
232 operator== (const Correction& lhs,
233 const Correction::enum_value& rhs)
234 {
235 return static_cast<Correction::enum_value>(lhs) == rhs;
236 }
237
245 inline bool
246 operator== (const Correction::enum_value& lhs,
247 const Correction& rhs)
248 {
249 return lhs == static_cast<Correction::enum_value>(rhs);
250 }
251
259 inline bool
260 operator== (const Correction& lhs,
261 const std::string& rhs)
262 {
263 return static_cast<const std::string&>(lhs) == rhs;
264 }
265
273 inline bool
274 operator== (const std::string& lhs,
275 const Correction& rhs)
276 {
277 return lhs == static_cast<const std::string&>(rhs);
278 }
279
287 inline bool
288 operator!= (const Correction& lhs,
289 const Correction& rhs)
290 {
291 return static_cast<Correction::enum_value>(lhs) != static_cast<Correction::enum_value>(rhs);
292 }
293
301 inline bool
302 operator!= (const Correction& lhs,
303 const Correction::enum_value& rhs)
304 {
305 return static_cast<Correction::enum_value>(lhs) != rhs;
306 }
307
315 inline bool
316 operator!= (const Correction::enum_value& lhs,
317 const Correction& rhs)
318 {
319 return lhs != static_cast<Correction::enum_value>(rhs);
320 }
321
329 inline bool
330 operator!= (const Correction& lhs,
331 const std::string& rhs)
332 {
333 return static_cast<const std::string&>(lhs) != rhs;
334 }
335
343 inline bool
344 operator!= (const std::string& lhs,
345 const Correction& rhs)
346 {
347 return lhs != static_cast<const std::string&>(rhs);
348 }
349
357 template<class charT, class traits>
358 inline std::basic_ostream<charT,traits>&
359 operator<< (std::basic_ostream<charT,traits>& os,
360 const Correction& enumeration)
361 {
362 return os << static_cast<const std::string&>(enumeration);
363 }
364
372 template<class charT, class traits>
373 inline std::basic_istream<charT,traits>&
374 operator>> (std::basic_istream<charT,traits>& is,
375 Correction& enumeration)
376 {
377 std::string value;
378 is >> value;
379 if (is)
380 {
381 try
382 {
383 enumeration = Correction(value, false);
384 }
385 catch (const EnumerationException&)
386 {
387 is.setstate(std::ios::failbit);
388 }
389 }
390
391 return is;
392 }
393
394 }
395 }
396 }
397 }
398
399 #endif // OME_XML_MODEL_ENUMS_CORRECTION_H
400
401 /*
402 * Local Variables:
403 * mode:C++
404 * End:
405 */
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:390
ome::xml::model::enums::operator!=
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:304
ome::xml::model::enums::Correction
Correction enumeration.
Definition: Correction.h:72
ome::xml::model::enums::Correction::Correction
Correction(enum_value value)
Construct a Correction enumeration by an enumeration value.
Definition: Correction.cpp:75
ome::xml::model::enums::Correction::FLUOTAR
Fluotar.
Definition: Correction.h:101
ome::xml::model::enums::Correction::PLANNEOFLUAR
PlanNeofluar.
Definition: Correction.h:105
ome::xml::model::enums::Correction::string_map_type
std::map< std::string, Correction::enum_value > string_map_type
String map type.
Definition: Correction.h:175
ome::xml::model::enums::EnumerationException
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
ome::xml::model::enums::Correction::NEOFLUAR
Neofluar.
Definition: Correction.h:99
ome::xml::model::enums::Correction::OTHER
Other.
Definition: Correction.h:107
ome::xml::model::enums::Correction::enum_value
enum_value
Enumeration values.
Definition: Correction.h:76
ome::xml::model::enums::Correction::ACHRO
Achro.
Definition: Correction.h:89
ome::xml::model::enums::Correction::value
enum_value value
Enumeration value.
Definition: Correction.h:205
ome::xml::model::enums::Correction::PLANAPO
PlanApo.
Definition: Correction.h:81
ome::xml::model::enums::Correction::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: Correction.cpp:153
ome::xml::model::enums::Correction::VIOLETCORRECTED
VioletCorrected.
Definition: Correction.h:87
ome::xml::model::enums::Correction::SUPERFLUOR
SuperFluor.
Definition: Correction.h:85
ome::xml::model::enums::Correction::FL
Fl.
Definition: Correction.h:95
ome::xml::model::enums::Correction::name
const std::string * name
Enumeration name.
Definition: Correction.h:207
ome::xml::model::enums::Correction::APO
Apo.
Definition: Correction.h:103
ome::xml::model::enums::Correction::value_map_type
std::map< Correction::enum_value, std::string > value_map_type
Value map type.
Definition: Correction.h:177
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::Correction::operator=
Correction & operator=(const Correction &rhs)
Assignment operator.
Definition: Correction.h:145
ome::xml::model::enums::operator==
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:234
ome::xml::model::enums::Correction::FLUAR
Fluar.
Definition: Correction.h:97
ome::xml::model::enums::Correction::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: Correction.cpp:209
ome::xml::model::enums::Correction::UV
UV.
Definition: Correction.h:79
ome::xml::model::enums::Correction::FLUOR
Fluor.
Definition: Correction.h:93
ome::xml::model::enums::Correction::ACHROMAT
Achromat.
Definition: Correction.h:91
ome::xml::model::enums::Correction::PLANFLUOR
PlanFluor.
Definition: Correction.h:83
log.h
ome::xml::model::enums::Correction::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: Correction.cpp:181