ome-xml  5.6.0
AcquisitionMode.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_ACQUISITIONMODE_H
47 #define OME_XML_MODEL_ENUMS_ACQUISITIONMODE_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 AcquisitionMode enumeration.
58 #define OME_XML_MODEL_ENUMS_ACQUISITIONMODE_VALUES (WIDEFIELD)(LASERSCANNINGCONFOCALMICROSCOPY)(SPINNINGDISKCONFOCAL)(SLITSCANCONFOCAL)(MULTIPHOTONMICROSCOPY)(STRUCTUREDILLUMINATION)(SINGLEMOLECULEIMAGING)(TOTALINTERNALREFLECTION)(FLUORESCENCELIFETIME)(SPECTRALIMAGING)(FLUORESCENCECORRELATIONSPECTROSCOPY)(NEARFIELDSCANNINGOPTICALMICROSCOPY)(SECONDHARMONICGENERATIONIMAGING)(PALM)(STORM)(STED)(TIRF)(FSM)(LCM)(OTHER)(BRIGHTFIELD)(SWEPTFIELDCONFOCAL)(SPIM)
59 
60 namespace ome
61 {
62  namespace xml
63  {
64  namespace model
65  {
66  namespace enums
67  {
68 
73  {
74  public:
77  {
124  };
125 
132 
147  AcquisitionMode (const std::string& name, bool strict = true);
148 
154  AcquisitionMode (const AcquisitionMode& original);
155 
162  inline AcquisitionMode&
164  {
165  this->value = rhs.value;
166  this->name = rhs.name;
167  return *this;
168  }
169 
175  inline
176  operator enum_value () const
177  {
178  return this->value;
179  }
180 
186  inline
187  operator const std::string& () const
188  {
189  return *this->name;
190  }
191 
193  typedef std::map<std::string, AcquisitionMode::enum_value> string_map_type;
195  typedef std::map<AcquisitionMode::enum_value, std::string> value_map_type;
196 
202  static const string_map_type&
203  strings();
204 
210  static const value_map_type&
211  values();
212 
213  private:
219  static const string_map_type&
221 
225  const std::string *name;
226  };
227 
235  inline bool
237  const AcquisitionMode& rhs)
238  {
239  return static_cast<AcquisitionMode::enum_value>(lhs) == static_cast<AcquisitionMode::enum_value>(rhs);
240  }
241 
249  inline bool
251  const AcquisitionMode::enum_value& rhs)
252  {
253  return static_cast<AcquisitionMode::enum_value>(lhs) == rhs;
254  }
255 
263  inline bool
265  const AcquisitionMode& rhs)
266  {
267  return lhs == static_cast<AcquisitionMode::enum_value>(rhs);
268  }
269 
277  inline bool
279  const std::string& rhs)
280  {
281  return static_cast<const std::string&>(lhs) == rhs;
282  }
283 
291  inline bool
292  operator== (const std::string& lhs,
293  const AcquisitionMode& rhs)
294  {
295  return lhs == static_cast<const std::string&>(rhs);
296  }
297 
305  inline bool
307  const AcquisitionMode& rhs)
308  {
309  return static_cast<AcquisitionMode::enum_value>(lhs) != static_cast<AcquisitionMode::enum_value>(rhs);
310  }
311 
319  inline bool
321  const AcquisitionMode::enum_value& rhs)
322  {
323  return static_cast<AcquisitionMode::enum_value>(lhs) != rhs;
324  }
325 
333  inline bool
335  const AcquisitionMode& rhs)
336  {
337  return lhs != static_cast<AcquisitionMode::enum_value>(rhs);
338  }
339 
347  inline bool
349  const std::string& rhs)
350  {
351  return static_cast<const std::string&>(lhs) != rhs;
352  }
353 
361  inline bool
362  operator!= (const std::string& lhs,
363  const AcquisitionMode& rhs)
364  {
365  return lhs != static_cast<const std::string&>(rhs);
366  }
367 
375  template<class charT, class traits>
376  inline std::basic_ostream<charT,traits>&
377  operator<< (std::basic_ostream<charT,traits>& os,
378  const AcquisitionMode& enumeration)
379  {
380  return os << static_cast<const std::string&>(enumeration);
381  }
382 
390  template<class charT, class traits>
391  inline std::basic_istream<charT,traits>&
392  operator>> (std::basic_istream<charT,traits>& is,
393  AcquisitionMode& enumeration)
394  {
395  std::string value;
396  is >> value;
397  if (is)
398  {
399  try
400  {
401  enumeration = AcquisitionMode(value, false);
402  }
403  catch (const EnumerationException&)
404  {
405  is.setstate(std::ios::failbit);
406  }
407  }
408 
409  return is;
410  }
411 
412  }
413  }
414  }
415 }
416 
417 #endif // OME_XML_MODEL_ENUMS_ACQUISITIONMODE_H
418 
419 /*
420  * Local Variables:
421  * mode:C++
422  * End:
423  */
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, AcquisitionMode &enumeration)
Set AcquisitionMode from input stream.
Definition: AcquisitionMode.h:392
bool operator!=(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for non-equality.
Definition: AcquisitionMode.h:306
static const string_map_type & lowercase_strings()
Get a map of valid lowercased string names and enum values.
Definition: AcquisitionMode.cpp:211
FluorescenceCorrelationSpectroscopy.
Definition: AcquisitionMode.h:99
enum_value value
Enumeration value.
Definition: AcquisitionMode.h:223
SpinningDiskConfocal.
Definition: AcquisitionMode.h:83
WideField.
Definition: AcquisitionMode.h:79
TotalInternalReflection.
Definition: AcquisitionMode.h:93
SpectralImaging.
Definition: AcquisitionMode.h:97
EnumerationException is thrown when an enumeration is invalid or not found.
Definition: EnumerationException.h:74
AcquisitionMode enumeration.
Definition: AcquisitionMode.h:72
std::map< std::string, AcquisitionMode::enum_value > string_map_type
String map type.
Definition: AcquisitionMode.h:193
FluorescenceLifetime.
Definition: AcquisitionMode.h:95
NearFieldScanningOpticalMicroscopy.
Definition: AcquisitionMode.h:101
std::map< AcquisitionMode::enum_value, std::string > value_map_type
Value map type.
Definition: AcquisitionMode.h:195
const std::string * name
Enumeration name.
Definition: AcquisitionMode.h:225
MultiPhotonMicroscopy.
Definition: AcquisitionMode.h:87
SecondHarmonicGenerationImaging.
Definition: AcquisitionMode.h:103
StructuredIllumination.
Definition: AcquisitionMode.h:89
SlitScanConfocal.
Definition: AcquisitionMode.h:85
SPIM.
Definition: AcquisitionMode.h:123
SweptFieldConfocal.
Definition: AcquisitionMode.h:121
Open Microscopy Environment C++ implementation.
PALM.
Definition: AcquisitionMode.h:105
bool operator==(const AcquisitionMode &lhs, const AcquisitionMode &rhs)
Compare two AcquisitionMode objects for equality.
Definition: AcquisitionMode.h:236
STED.
Definition: AcquisitionMode.h:109
FSM.
Definition: AcquisitionMode.h:113
SingleMoleculeImaging.
Definition: AcquisitionMode.h:91
AcquisitionMode(enum_value value)
Construct a AcquisitionMode enumeration by an enumeration value.
Definition: AcquisitionMode.cpp:67
static const value_map_type & values()
Get a map of valid enum values and string names.
Definition: AcquisitionMode.cpp:178
Other.
Definition: AcquisitionMode.h:117
BrightField.
Definition: AcquisitionMode.h:119
STORM.
Definition: AcquisitionMode.h:107
enum_value
Enumeration values.
Definition: AcquisitionMode.h:76
TIRF.
Definition: AcquisitionMode.h:111
static const string_map_type & strings()
Get a map of valid string names and enum values.
Definition: AcquisitionMode.cpp:145
LaserScanningConfocalMicroscopy.
Definition: AcquisitionMode.h:81
AcquisitionMode & operator=(const AcquisitionMode &rhs)
Assignment operator.
Definition: AcquisitionMode.h:163
LCM.
Definition: AcquisitionMode.h:115