Manual for OpenFLUID 2.1.10

TypeDefs.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file core/TypeDefs.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 
40 #ifndef __OPENFLUID_CORE_TYPEDEFS_HPP__
41 #define __OPENFLUID_CORE_TYPEDEFS_HPP__
42 
43 
44 #include <vector>
45 #include <list>
46 #include <map>
47 #include <cstdint>
48 
49 #include <openfluid/dllexport.hpp>
53 
54 
55 namespace openfluid { namespace core {
56 
57 
58 /**
59  Type definition for the ID of units
60 
61  @cond OpenFLUID:completion
62  {
63  "contexts" : ["ANYWARE"],
64  "menupath" : ["Compute code", "Types", "Spatial domain"],
65  "title" : "Unit ID",
66  "text" : "openfluid::core::UnitID_t %%SEL_START%%UnitID%%SEL_END%%"
67  }
68  @endcond
69 */
70 typedef unsigned int UnitID_t;
71 
72 /**
73  Type definition for the process order of units
74 
75  @cond OpenFLUID:completion
76  {
77  "contexts" : ["ANYWARE"],
78  "menupath" : ["Compute code", "Types", "Spatial domain"],
79  "title" : "Process order",
80  "text" : "openfluid::core::PcsOrd_t %%SEL_START%%PcsOrd%%SEL_END%%"
81  }
82  @endcond
83 */
84 typedef int PcsOrd_t;
85 
86 /**
87  Type definition for the class of units
88 
89  @cond OpenFLUID:completion
90  {
91  "contexts" : ["ANYWARE"],
92  "menupath" : ["Compute code", "Types", "Spatial domain"],
93  "title" : "Units class name",
94  "text" : "openfluid::core::UnitsClass_t %%SEL_START%%ClassName%%SEL_END%%"
95  }
96  @endcond
97 */
98 typedef std::string UnitsClass_t;
99 
100 /**
101  @deprecated Since version 2.1.0. Use openfluid::core::UnitsClass_t instead
102 */
103 [[deprecated]] typedef UnitsClass_t UnitClass_t;
104 
105 /**
106  Type definition for name of an attribute
107 
108  @cond OpenFLUID:completion
109  {
110  "contexts" : ["ANYWARE"],
111  "menupath" : ["Compute code", "Types", "Attributes"],
112  "title" : "Attribute name",
113  "text" : "openfluid::core::AttributeName_t %%SEL_START%%AttrName%%SEL_END%%"
114  }
115  @endcond
116 */
117 typedef std::string AttributeName_t;
118 
119 /**
120  Type definition for name of a variable
121 
122  @cond OpenFLUID:completion
123  {
124  "contexts" : ["ANYWARE"],
125  "menupath" : ["Compute code", "Types", "Variables"],
126  "title" : "Variable name",
127  "text" : "openfluid::core::VariableName_t %%SEL_START%%VarName%%SEL_END%%"
128  }
129  @endcond
130 */
131 typedef std::string VariableName_t;
132 
133 /**
134  Type definition for a pair containing the unit class and the unit ID
135 */
136 typedef std::pair<UnitsClass_t,UnitID_t> UnitClassID_t;
137 
138 /**
139  Type definition for a link between two units defined by their class and ID
140 */
141 typedef std::pair<UnitClassID_t,UnitClassID_t> UnitsLink_t;
142 
143 
144 // =====================================================================
145 // =====================================================================
146 
147 
148 /**
149  Type definition for a serie of DoubleValue
150  */
151 typedef std::vector<DoubleValue> SerieOfDoubleValue;
152 
153 
154 /**
155  Type definition for a serie of VectorValue
156  */
157 typedef std::vector<VectorValue> SerieOfVectorValue;
158 
159 
160 // =====================================================================
161 // =====================================================================
162 
163 
164 /**
165  Generic map container associating a unit ID to data
166 */
167 template<class T>
168 struct IDMap
169 {
170  typedef std::map<UnitID_t,T> Type;
171 };
172 
173 
174 /**
175  Map associating a float value to a unit ID
176 
177  @cond OpenFLUID:completion
178  {
179  "contexts" : ["ANYWARE"],
180  "menupath" : ["Compute code", "Types", "ID..Map"],
181  "title" : "ID to single precision (signed)",
182  "text" : "openfluid::core::IDFloatMap %%SEL_START%%ValMap%%SEL_END%%"
183  }
184  @endcond
185 */
187 
188 /**
189  Map associating a double precision value to a unit ID
190 
191  @cond OpenFLUID:completion
192  {
193  "contexts" : ["ANYWARE"],
194  "menupath" : ["Compute code", "Types", "ID..Map"],
195  "title" : "ID to double precision (signed)",
196  "text" : "openfluid::core::IDDoubleMap %%SEL_START%%ValMap%%SEL_END%%"
197  }
198  @endcond
199 */
201 
202 /**
203  Map associating a DoubleValue value to a unit ID
204 
205  @cond OpenFLUID:completion
206  {
207  "contexts" : ["ANYWARE"],
208  "menupath" : ["Compute code", "Types", "ID..Map"],
209  "title" : "ID to DoubleValue",
210  "text" : "openfluid::core::IDDoubleValueMap %%SEL_START%%ValMap%%SEL_END%%"
211  }
212  @endcond
213 */
215 
216 /**
217  Map associating an integer value to a unit ID
218 
219  @cond OpenFLUID:completion
220  {
221  "contexts" : ["ANYWARE"],
222  "menupath" : ["Compute code", "Types", "ID..Map"],
223  "title" : "ID to integer (signed)",
224  "text" : "openfluid::core::IDIntMap %%SEL_START%%ValMap%%SEL_END%%"
225  }
226  @endcond
227 */
229 
230 /**
231  Map associating a boolean value to a unit ID
232 
233  @cond OpenFLUID:completion
234  {
235  "contexts" : ["ANYWARE"],
236  "menupath" : ["Compute code", "Types", "ID..Map"],
237  "title" : "ID to boolean",
238  "text" : "openfluid::core::IDBoolMap %%SEL_START%%ValMap%%SEL_END%%"
239  }
240  @endcond
241 */
243 
244 /**
245  Map associating an openfluid::core::VectorValue value to a unit ID
246 
247  @cond OpenFLUID:completion
248  {
249  "contexts" : ["ANYWARE"],
250  "menupath" : ["Compute code", "Types", "ID..Map"],
251  "title" : "ID to VectorValue",
252  "text" : "openfluid::core::IDVectorValueMap %%SEL_START%%ValMap%%SEL_END%%"
253  }
254  @endcond
255 */
257 
258 /**
259  Map associating a pointer to an openfluid::core::VectorValue value to a unit ID
260 
261  @cond OpenFLUID:completion
262  {
263  "contexts" : ["ANYWARE"],
264  "menupath" : ["Compute code", "Types", "ID..Map"],
265  "title" : "ID to pointer to VectorValue",
266  "text" : "openfluid::core::IDVectorValuePtrMap %%SEL_START%%ValMap%%SEL_END%%"
267  }
268  @endcond
269 */
271 
273 
275 
276 
277 // =====================================================================
278 // =====================================================================
279 
280 
281 /**
282  Type for raw time (seconds since 4713BC)
283 */
284 typedef std::uint64_t RawTime_t;
285 
286 /**
287  Type for time indexes (in seconds)
288 
289  @cond OpenFLUID:completion
290  {
291  "contexts" : ["ANYWARE"],
292  "menupath" : ["Compute code", "Types", "Time"],
293  "title" : "Time index",
294  "text" : "openfluid::core::TimeIndex_t %%SEL_START%%TimeIndex%%SEL_END%%"
295  }
296  @endcond
297 */
298 typedef std::uint64_t TimeIndex_t;
299 
300 /**
301  Type for durations (in seconds)
302 
303  @cond OpenFLUID:completion
304  {
305  "contexts" : ["ANYWARE"],
306  "menupath" : ["Compute code", "Types", "Time"],
307  "title" : "Duration",
308  "text" : "openfluid::core::Duration_t %%SEL_START%%Duration%%SEL_END%%"
309  }
310  @endcond
311 */
312 typedef std::uint64_t Duration_t;
313 
314 
315 } } // namespaces
316 
317 
318 #endif /* __OPENFLUID_CORE_TYPEDEFS_HPP__ */
IDMap< SerieOfDoubleValue * >::Type IDSerieOfDoubleValuePtrMap
Definition: TypeDefs.hpp:274
Definition: ApplicationException.hpp:47
UnitsClass_t UnitClass_t
Definition: TypeDefs.hpp:103
std::pair< UnitClassID_t, UnitClassID_t > UnitsLink_t
Definition: TypeDefs.hpp:141
Definition: TypeDefs.hpp:168
std::string VariableName_t
Definition: TypeDefs.hpp:131
std::uint64_t RawTime_t
Definition: TypeDefs.hpp:284
std::string UnitsClass_t
Definition: TypeDefs.hpp:98
IDMap< bool >::Type IDBoolMap
Definition: TypeDefs.hpp:242
std::vector< VectorValue > SerieOfVectorValue
Definition: TypeDefs.hpp:157
IDMap< VectorValue >::Type IDVectorValueMap
Definition: TypeDefs.hpp:256
std::uint64_t Duration_t
Definition: TypeDefs.hpp:312
std::string AttributeName_t
Definition: TypeDefs.hpp:117
IDMap< SerieOfDoubleValue >::Type IDSerieOfDoubleValueMap
Definition: TypeDefs.hpp:272
IDMap< float >::Type IDFloatMap
Definition: TypeDefs.hpp:186
std::uint64_t TimeIndex_t
Definition: TypeDefs.hpp:298
IDMap< VectorValue * >::Type IDVectorValuePtrMap
Definition: TypeDefs.hpp:270
IDMap< DoubleValue >::Type IDDoubleValueMap
Definition: TypeDefs.hpp:214
std::map< UnitID_t, T > Type
Definition: TypeDefs.hpp:170
IDMap< int >::Type IDIntMap
Definition: TypeDefs.hpp:228
std::vector< DoubleValue > SerieOfDoubleValue
Definition: TypeDefs.hpp:151
int PcsOrd_t
Definition: TypeDefs.hpp:84
std::pair< UnitsClass_t, UnitID_t > UnitClassID_t
Definition: TypeDefs.hpp:136
IDMap< double >::Type IDDoubleMap
Definition: TypeDefs.hpp:200
unsigned int UnitID_t
Definition: TypeDefs.hpp:70