ome-xml 5.2.0

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

- File List

DimensionOrder.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_DIMENSIONORDER_H
47 #define OME_XML_MODEL_ENUMS_DIMENSIONORDER_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 DimensionOrder enumeration.
58 #define OME_XML_MODEL_ENUMS_DIMENSIONORDER_VALUES (XYZCT)(XYZTC)(XYCTZ)(XYCZT)(XYTCZ)(XYTZC)
59
60 namespace ome
61 {
62 namespace xml
63 {
64 namespace model
65 {
66 namespace enums
67 {
68
72 class DimensionOrder
73 {
74 public:
76 enum enum_value
77 {
79 XYZCT,
81 XYZTC,
83 XYCTZ,
85 XYCZT,
87 XYTCZ,
89 XYTZC
90 };
91
97 DimensionOrder (enum_value value);
98
113 DimensionOrder (const std::string& name, bool strict = true);
114
120 DimensionOrder (const DimensionOrder& original);
121
126 inline DimensionOrder&
127 operator= (const DimensionOrder& rhs)
128 {
129 this->value = rhs.value;
130 this->name = rhs.name;
131 return *this;
132 }
133
139 inline
140 operator enum_value () const
141 {
142 return this->value;
143 }
144
150 inline
151 operator const std::string& () const
152 {
153 return *this->name;
154 }
155
157 typedef std::map<std::string, DimensionOrder::enum_value> string_map_type;
159 typedef std::map<DimensionOrder::enum_value, std::string> value_map_type;
160
166 static const string_map_type&
167 strings();
168
174 static const value_map_type&
175 values();
176
177 private:
183 static const string_map_type&
184 lowercase_strings();
185
187 enum_value value;
189 const std::string *name;
190 };
191
199 inline bool
200 operator== (const DimensionOrder& lhs,
201 const DimensionOrder& rhs)
202 {
203 return static_cast<DimensionOrder::enum_value>(lhs) == static_cast<DimensionOrder::enum_value>(rhs);
204 }
205
213 inline bool
214 operator== (const DimensionOrder& lhs,
215 const DimensionOrder::enum_value& rhs)
216 {
217 return static_cast<DimensionOrder::enum_value>(lhs) == rhs;
218 }
219
227 inline bool
228 operator== (const DimensionOrder::enum_value& lhs,
229 const DimensionOrder& rhs)
230 {
231 return lhs == static_cast<DimensionOrder::enum_value>(rhs);
232 }
233
241 inline bool
242 operator== (const DimensionOrder& lhs,
243 const std::string& rhs)
244 {
245 return static_cast<const std::string&>(lhs) == rhs;
246 }
247
255 inline bool
256 operator== (const std::string& lhs,
257 const DimensionOrder& rhs)
258 {
259 return lhs == static_cast<const std::string&>(rhs);
260 }
261
269 inline bool
270 operator!= (const DimensionOrder& lhs,
271 const DimensionOrder& rhs)
272 {
273 return static_cast<DimensionOrder::enum_value>(lhs) != static_cast<DimensionOrder::enum_value>(rhs);
274 }
275
283 inline bool
284 operator!= (const DimensionOrder& lhs,
285 const DimensionOrder::enum_value& rhs)
286 {
287 return static_cast<DimensionOrder::enum_value>(lhs) != rhs;
288 }
289
297 inline bool
298 operator!= (const DimensionOrder::enum_value& lhs,
299 const DimensionOrder& rhs)
300 {
301 return lhs != static_cast<DimensionOrder::enum_value>(rhs);
302 }
303
311 inline bool
312 operator!= (const DimensionOrder& lhs,
313 const std::string& rhs)
314 {
315 return static_cast<const std::string&>(lhs) != rhs;
316 }
317
325 inline bool
326 operator!= (const std::string& lhs,
327 const DimensionOrder& rhs)
328 {
329 return lhs != static_cast<const std::string&>(rhs);
330 }
331
339 template<class charT, class traits>
340 inline std::basic_ostream<charT,traits>&
341 operator<< (std::basic_ostream<charT,traits>& os,
342 const DimensionOrder& enumeration)
343 {
344 return os << static_cast<const std::string&>(enumeration);
345 }
346
354 template<class charT, class traits>
355 inline std::basic_istream<charT,traits>&
356 operator>> (std::basic_istream<charT,traits>& is,
357 DimensionOrder& enumeration)
358 {
359 std::string value;
360 is >> value;
361 if (is)
362 {
363 try
364 {
365 enumeration = DimensionOrder(value, false);
366 }
367 catch (const EnumerationException&)
368 {
369 is.setstate(std::ios::failbit);
370 }
371 }
372
373 return is;
374 }
375
376 }
377 }
378 }
379 }
380
381 #endif // OME_XML_MODEL_ENUMS_DIMENSIONORDER_H
382
383 /*
384 * Local Variables:
385 * mode:C++
386 * End:
387 */
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::DimensionOrder::lowercase_strings
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: DimensionOrder.cpp:176
ome::xml::model::enums::DimensionOrder::enum_value
enum_value
Enumeration values.
Definition: DimensionOrder.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::DimensionOrder::operator=
DimensionOrder & operator=(const DimensionOrder &rhs)
Assignment operator.
Definition: DimensionOrder.h:127
ome::xml::model::enums::DimensionOrder::XYCTZ
XYCTZ.
Definition: DimensionOrder.h:83
ome::xml::model::enums::DimensionOrder::XYTZC
XYTZC.
Definition: DimensionOrder.h:89
ome::xml::model::enums::DimensionOrder::DimensionOrder
DimensionOrder(enum_value value)
Construct a DimensionOrder enumeration by an enumeration value.
Definition: DimensionOrder.cpp:75
ome::xml::model::enums::DimensionOrder
DimensionOrder enumeration.
Definition: DimensionOrder.h:72
ome::xml::model::enums::DimensionOrder::name
const std::string * name
Enumeration name.
Definition: DimensionOrder.h:189
ome::xml::model::enums::DimensionOrder::value_map_type
std::map< DimensionOrder::enum_value, std::string > value_map_type
Value map type.
Definition: DimensionOrder.h:159
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::enums::DimensionOrder::XYZCT
XYZCT.
Definition: DimensionOrder.h:79
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::DimensionOrder::values
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: DimensionOrder.cpp:157
ome::xml::model::enums::DimensionOrder::XYTCZ
XYTCZ.
Definition: DimensionOrder.h:87
ome::xml::model::enums::DimensionOrder::value
enum_value value
Enumeration value.
Definition: DimensionOrder.h:187
ome::xml::model::enums::DimensionOrder::XYZTC
XYZTC.
Definition: DimensionOrder.h:81
ome::xml::model::enums::DimensionOrder::string_map_type
std::map< std::string, DimensionOrder::enum_value > string_map_type
String map type.
Definition: DimensionOrder.h:157
ome::xml::model::enums::DimensionOrder::strings
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: DimensionOrder.cpp:138
log.h
ome::xml::model::enums::DimensionOrder::XYCZT
XYCZT.
Definition: DimensionOrder.h:85