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
34namespace 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
61 public:
64
67
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)
116 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:
192};
193
194#endif
Compile-time configuration.
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:390
Reference-counting pointers.
Container for the value of a Property.
Definition: GyotoValue.h:60
int type
Type of this instance.
Definition: GyotoValue.h:72
Value(long)
Construct/cast from long.
Gyoto::SmartPointer< Gyoto::Spectrometer::Generic > Spectrometer
A Spectrometer object.
Definition: GyotoValue.h:177
Value(Gyoto::SmartPointer< Gyoto::Metric::Generic >)
Cast from Metric object.
Value(std::string)
Construct/cast from string.
Gyoto::SmartPointer< Gyoto::Spectrum::Generic > Spectrum
A Spectrum object.
Definition: GyotoValue.h:168
Value(unsigned long)
Construct/cast from unsigned long.
size_t SizeT
A size_t (only if distinct from unsigned long)
Definition: GyotoValue.h:112
Value()
Constructor.
Value(double)
Construct/cast from double.
Value(Gyoto::SmartPointer< Gyoto::Screen >)
Cast from Screen.
Gyoto::SmartPointer< Gyoto::Metric::Generic > Metric
A Metric object.
Definition: GyotoValue.h:150
double Double
A double value.
Definition: GyotoValue.h:76
Gyoto::SmartPointer< Gyoto::Screen > Screen
A Screen object.
Definition: GyotoValue.h:186
std::string String
A string value.
Definition: GyotoValue.h:123
Value & operator=(Value const &)
Assignement operator.
Value(bool)
Construct/cast from boolean.
Value(std::vector< double >)
Construct/cast from vector of doubles.
Value(Gyoto::SmartPointer< Gyoto::Spectrum::Generic >)
Cast from Spectrum.
Value(Gyoto::SmartPointer< Gyoto::Spectrometer::Generic >)
Cast from Spectrometer.
Gyoto::SmartPointer< Gyoto::Astrobj::Generic > Astrobj
An Astrobj Object.
Definition: GyotoValue.h:159
Value(std::vector< unsigned long >)
Construct/cast from vector of unsigned long values.
long Long
A long value.
Definition: GyotoValue.h:94
~Value()
Destructor.
Value(Gyoto::SmartPointer< Gyoto::Astrobj::Generic >)
Cast from Astrobj.
std::vector< unsigned long > VULong
A vector of unsigned long values.
Definition: GyotoValue.h:141
std::vector< double > VDouble
A vector of double values.
Definition: GyotoValue.h:132
unsigned long ULong
An unsigned long (a.k.a. size_t)
Definition: GyotoValue.h:103
bool Bool
A boolean value.
Definition: GyotoValue.h:85
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43