Gyoto
GyotoValue.h
Go to the documentation of this file.
1 
6 /*
7  Copyright 2014 Thibaut Paumard
8 
9  This file is part of Gyoto.
10 
11  Gyoto is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  Gyoto is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
25 
26 #ifndef __GyotoValue_H_
27 #define __GyotoValue_H_
28 
29 #include "GyotoConfig.h"
30 #include "GyotoSmartPointer.h"
31 #include <string>
32 #include <vector>
33 
34 namespace Gyoto {
35  class Value;
36  namespace Metric {class Generic;}
37  namespace Astrobj {class Generic;}
38  namespace Spectrum {class Generic;}
39  namespace Spectrometer {class Generic;}
40  class Screen;
41 }
43 
60 class Gyoto::Value {
61  public:
63  Value();
64 
66  ~Value();
67 
69  Value& operator=(Value const&);
70 
72  int type;
73 
74  private:
76  double Double;
77  public:
79  Value(double);
81  operator double() const;
82 
83  private:
85  bool Bool;
86  public:
88  Value(bool);
90  operator bool() const;
91 
92  private:
94  long Long;
95  public:
97  Value(long);
99  operator long() const;
100 
101  private:
103  unsigned long ULong;
104  public:
106  Value(unsigned long);
108  operator unsigned long() const;
109 
110  private:
112  size_t SizeT;
113  public:
114 #if !defined(GYOTO_SIZE__T_IS_UNSIGNED_LONG)
115  Value(size_t);
118  operator size_t() const;
119 #endif
120 
121  private:
123  std::string String;
124  public:
126  Value(std::string);
128  operator std::string() const;
129 
130  private:
132  std::vector<double> VDouble;
133  public:
135  Value(std::vector<double>);
137  operator std::vector<double>() const;
138 
139  private:
141  std::vector<unsigned long> VULong;
142  public:
144  Value(std::vector<unsigned long>);
146  operator std::vector<unsigned long>() const;
147 
148  private:
151  public:
156 
157  private:
160  public:
165 
166  private:
169  public:
174 
175  private:
178  public:
183 
184  private:
187  public:
191  operator Gyoto::SmartPointer<Gyoto::Screen>() const;
192 };
193 
194 #endif
std::vector< double > VDouble
A vector of double values.
Definition: GyotoValue.h:132
Gyoto::SmartPointer< Gyoto::Screen > Screen
A Screen object.
Definition: GyotoValue.h:186
int type
Type of this instance.
Definition: GyotoValue.h:72
Reference-counting pointers.
Gyoto::SmartPointer< Gyoto::Metric::Generic > Metric
A Metric object.
Definition: GyotoValue.h:150
std::vector< unsigned long > VULong
A vector of unsigned long values.
Definition: GyotoValue.h:141
std::string String
A string value.
Definition: GyotoValue.h:123
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:387
Value()
Constructor.
long Long
A long value.
Definition: GyotoValue.h:94
unsigned long ULong
An unsigned long (a.k.a. size_t)
Definition: GyotoValue.h:103
Compile-time configuration.
size_t SizeT
A size_t (only if distinct from unsigned long)
Definition: GyotoValue.h:112
Gyoto::SmartPointer< Gyoto::Astrobj::Generic > Astrobj
An Astrobj Object.
Definition: GyotoValue.h:159
Gyoto::SmartPointer< Gyoto::Spectrum::Generic > Spectrum
A Spectrum object.
Definition: GyotoValue.h:168
~Value()
Destructor.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
Value & operator=(Value const &)
Assignement operator.
Container for the value of a Property.
Definition: GyotoValue.h:60
Gyoto::SmartPointer< Gyoto::Spectrometer::Generic > Spectrometer
A Spectrometer object.
Definition: GyotoValue.h:177
bool Bool
A boolean value.
Definition: GyotoValue.h:85
double Double
A double value.
Definition: GyotoValue.h:76