ome-xml  5.2.4
FillRule.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_FILLRULE_H
47 #define OME_XML_MODEL_ENUMS_FILLRULE_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 FillRule enumeration.
58 #define OME_XML_MODEL_ENUMS_FILLRULE_VALUES (EVENODD)(NONZERO)
59 
60 namespace ome
61 {
62  namespace xml
63  {
64  namespace model
65  {
66  namespace enums
67  {
68 
72  class FillRule
73  {
74  public:
77  {
82  };
83 
90 
105  FillRule (const std::string& name, bool strict = true);
106 
112  FillRule (const FillRule& original);
113 
118  inline FillRule&
119  operator= (const FillRule& rhs)
120  {
121  this->value = rhs.value;
122  this->name = rhs.name;
123  return *this;
124  }
125 
131  inline
132  operator enum_value () const
133  {
134  return this->value;
135  }
136 
142  inline
143  operator const std::string& () const
144  {
145  return *this->name;
146  }
147 
149  typedef std::map<std::string, FillRule::enum_value> string_map_type;
151  typedef std::map<FillRule::enum_value, std::string> value_map_type;
152 
158  static const string_map_type&
159  strings();
160 
166  static const value_map_type&
167  values();
168 
169  private:
175  static const string_map_type&
177 
181  const std::string *name;
182  };
183 
191  inline bool
192  operator== (const FillRule& lhs,
193  const FillRule& rhs)
194  {
195  return static_cast<FillRule::enum_value>(lhs) == static_cast<FillRule::enum_value>(rhs);
196  }
197 
205  inline bool
206  operator== (const FillRule& lhs,
207  const FillRule::enum_value& rhs)
208  {
209  return static_cast<FillRule::enum_value>(lhs) == rhs;
210  }
211 
219  inline bool
221  const FillRule& rhs)
222  {
223  return lhs == static_cast<FillRule::enum_value>(rhs);
224  }
225 
233  inline bool
234  operator== (const FillRule& lhs,
235  const std::string& rhs)
236  {
237  return static_cast<const std::string&>(lhs) == rhs;
238  }
239 
247  inline bool
248  operator== (const std::string& lhs,
249  const FillRule& rhs)
250  {
251  return lhs == static_cast<const std::string&>(rhs);
252  }
253 
261  inline bool
262  operator!= (const FillRule& lhs,
263  const FillRule& rhs)
264  {
265  return static_cast<FillRule::enum_value>(lhs) != static_cast<FillRule::enum_value>(rhs);
266  }
267 
275  inline bool
276  operator!= (const FillRule& lhs,
277  const FillRule::enum_value& rhs)
278  {
279  return static_cast<FillRule::enum_value>(lhs) != rhs;
280  }
281 
289  inline bool
291  const FillRule& rhs)
292  {
293  return lhs != static_cast<FillRule::enum_value>(rhs);
294  }
295 
303  inline bool
304  operator!= (const FillRule& lhs,
305  const std::string& rhs)
306  {
307  return static_cast<const std::string&>(lhs) != rhs;
308  }
309 
317  inline bool
318  operator!= (const std::string& lhs,
319  const FillRule& rhs)
320  {
321  return lhs != static_cast<const std::string&>(rhs);
322  }
323 
331  template<class charT, class traits>
332  inline std::basic_ostream<charT,traits>&
333  operator<< (std::basic_ostream<charT,traits>& os,
334  const FillRule& enumeration)
335  {
336  return os << static_cast<const std::string&>(enumeration);
337  }
338 
346  template<class charT, class traits>
347  inline std::basic_istream<charT,traits>&
348  operator>> (std::basic_istream<charT,traits>& is,
349  FillRule& enumeration)
350  {
351  std::string value;
352  is >> value;
353  if (is)
354  {
355  try
356  {
357  enumeration = FillRule(value, false);
358  }
359  catch (const EnumerationException&)
360  {
361  is.setstate(std::ios::failbit);
362  }
363  }
364 
365  return is;
366  }
367 
368  }
369  }
370  }
371 }
372 
373 #endif // OME_XML_MODEL_ENUMS_FILLRULE_H
374 
375 /*
376  * Local Variables:
377  * mode:C++
378  * End:
379  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:390
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:304
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: FillRule.cpp:138
FillRule & operator=(const FillRule &rhs)
Assignment operator.
Definition: FillRule.h:119
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
enum_value
Enumeration values.
Definition: FillRule.h:76
FillRule enumeration.
Definition: FillRule.h:72
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: FillRule.cpp:168
enum_value value
Enumeration value.
Definition: FillRule.h:179
NonZero.
Definition: FillRule.h:81
const std::string * name
Enumeration name.
Definition: FillRule.h:181
Open Microscopy Environment C++ implementation.
std::map< std::string, FillRule::enum_value > string_map_type
String map type.
Definition: FillRule.h:149
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:234
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: FillRule.cpp:153
EvenOdd.
Definition: FillRule.h:79
std::map< FillRule::enum_value, std::string > value_map_type
Value map type.
Definition: FillRule.h:151
FillRule(enum_value value)
Construct a FillRule enumeration by an enumeration value.
Definition: FillRule.cpp:75