Manual for OpenFLUID 2.1.11

SimulatorSignature.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 SimulatorSignature.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 #ifndef __OPENFLUID_WARE_SIMULATORSIGNATURE_HPP__
40 #define __OPENFLUID_WARE_SIMULATORSIGNATURE_HPP__
41 
42 
43 #include <openfluid/config.hpp>
44 #include <openfluid/dllexport.hpp>
45 #include <openfluid/core/TypeDefs.hpp>
48 
49 
50 namespace openfluid { namespace ware {
51 
52 
53 typedef std::string SimMethod_t;
54 
55 typedef std::string SimProcess_t;
56 
57 typedef std::string SimDomain_t;
58 
59 
60 // =====================================================================
61 // =====================================================================
62 
63 
64 /**
65 Class for storage of the definition of data handled by the simulator.
66 */
68 {
69  public:
70 
71  std::string DataName;
72  std::string Description;
73  std::string DataUnit;
74 
76  DataName(""),Description(""),DataUnit("")
77  { }
78 
79  SignatureDataItem(std::string DName, std::string DDescription, std::string DUnit) :
80  DataName(DName),Description(DDescription),DataUnit(DUnit)
81  { }
82 };
83 
84 
85 // =====================================================================
86 // =====================================================================
87 
88 
89 /**
90 Class for storage of the definition of data handled by the simulator.
91 */
93 {
94  public:
95 
97 
99  SignatureDataItem(), UnitsClass("")
100  { }
101 
103  std::string DDescription, std::string DUnit) :
104  SignatureDataItem(DName,DDescription,DUnit),UnitsClass(UClass)
105  { }
106 };
107 
108 
109 // =====================================================================
110 // =====================================================================
111 
112 
113 /**
114 Class for storage of the definition of typed data handled by the simulator.
115 */
117 {
118 
119  public:
120 
122 
124  SignatureSpatialDataItem(), DataType(openfluid::core::Value::NONE)
125  { }
126 
128  std::string DDescription, std::string DUnit);
129 };
130 
131 
132 // =====================================================================
133 // =====================================================================
134 
135 
136 /**
137  Class for storage of the definition of the data handled by the simulator. This is part of the signature.
138 */
140 {
141  public:
142 
143  // TODO use the same naming style for all members
144 
145  std::vector<SignatureDataItem> UsedParams;
146 
147  std::vector<SignatureDataItem> RequiredParams;
148 
149  std::vector<SignatureTypedSpatialDataItem> ProducedVars;
150 
151  std::vector<SignatureTypedSpatialDataItem> UpdatedVars;
152 
153  std::vector<SignatureTypedSpatialDataItem> RequiredVars;
154 
155  std::vector<SignatureTypedSpatialDataItem> UsedVars;
156 
157  std::vector<SignatureSpatialDataItem> ProducedAttribute;
158 
159  std::vector<SignatureSpatialDataItem> RequiredAttribute;
160 
161  std::vector<SignatureSpatialDataItem> UsedAttribute;
162 
163  std::vector<std::string> RequiredExtraFiles;
164 
165  std::vector<std::string> UsedExtraFiles;
166 
167  std::vector<openfluid::core::UnitsClass_t> UsedEventsOnUnits;
168 
169 
171  {
172  clear();
173  }
174 
175 
176  void clear()
177  {
178  UsedParams.clear();
179  RequiredParams.clear();
180  ProducedVars.clear();
181  UpdatedVars.clear();
182  RequiredVars.clear();
183  UsedVars.clear();
184  ProducedAttribute.clear();
185  RequiredAttribute.clear();
186  UsedAttribute.clear();
187  RequiredExtraFiles.clear();
188  UsedExtraFiles.clear();
189  UsedEventsOnUnits.clear();
190  }
191 
192 };
193 
194 
195 // =====================================================================
196 // =====================================================================
197 
198 
199 /**
200  Class for storage of the definition of spatial units handled by the simulator.
201 */
203 {
204  public:
205 
207 
208  std::string Description;
209 
211  UnitsClass(""),Description("")
212  { }
213 
214  SignatureUnitsClassItem(openfluid::core::UnitsClass_t UClass,std::string DDescription) :
215  UnitsClass(UClass),Description(DDescription)
216  { }
217 };
218 
219 
220 // =====================================================================
221 // =====================================================================
222 
223 
225 {
226  public:
227 
228  std::string UpdatedUnitsGraph;
229 
230  std::vector<SignatureUnitsClassItem> UpdatedUnitsClass;
231 
232 
234  {
235  clear();
236  }
237 
238 
239  void clear()
240  {
241  UpdatedUnitsGraph.clear();
242  UpdatedUnitsClass.clear();
243  }
244 };
245 
246 
247 // =====================================================================
248 // =====================================================================
249 
250 
252 {
253  public:
254 
255  enum SchedulingType { UNDEFINED, DEFAULT, FIXED, RANGE };
256 
258 
260 
262 
263 
265  {
266  setAsUndefined();
267  }
268 
270  {
271  Type = UNDEFINED;
272  Min = 0;
273  Max = 0;
274  }
275 
277  {
278  Type = DEFAULT;
279  Min = 0;
280  Max = 0;
281  }
282 
284  {
285  Type = FIXED;
286  Min = Val;
287  Max = Val;
288  }
289 
291  {
292  Type = RANGE;
293  Min = MinVal;
294  Max = MaxVal;
295  }
296 
297 };
298 
299 
300 // =====================================================================
301 // =====================================================================
302 
303 
304 /**
305  Class encapsulating the plugin signature,
306  returned from the plugin to the host app for registering
307 */
309 {
310 
311  public:
312 
313  /**
314  Plugin domain (i.e. hydrology, pop, erosion, ...)
315  */
317 
318  /**
319  Plugin simulated process (i.e. surface rainfall-runoff production, ditch infiltration, ...)
320  */
322 
323  /**
324  Plugin involved method (i.e. morel-seytoux, hayami, ...)
325  */
327 
328  /**
329  Handled data
330  */
332 
333  /**
334  Handled units graph
335  */
337 
338  /**
339  Time scheduling
340  */
342 
343 
345  {
346  clear();
347  }
348 
349 
350  void clear()
351  {
353  Domain.clear();
354  Process.clear();
355  Method.clear();
356  HandledData.clear();
357  HandledUnitsGraph.clear();
358  TimeScheduling.setAsUndefined();
359  }
360 
361 };
362 
363 
364 } } // namespaces
365 
366 
367 #endif /* __OPENFLUID_WARE_SIMULATORSIGNATURE_HPP__ */
openfluid::ware::SignatureUnitsClassItem::SignatureUnitsClassItem
SignatureUnitsClassItem()
Definition: SimulatorSignature.hpp:210
openfluid::ware::SimMethod_t
std::string SimMethod_t
Definition: SimulatorSignature.hpp:53
openfluid::ware::SignatureHandledData
Definition: SimulatorSignature.hpp:139
openfluid::ware::SignatureHandledData::RequiredAttribute
std::vector< SignatureSpatialDataItem > RequiredAttribute
Definition: SimulatorSignature.hpp:159
openfluid::ware::SignatureUnitsGraph::SignatureUnitsGraph
SignatureUnitsGraph()
Definition: SimulatorSignature.hpp:233
openfluid::ware::SignatureHandledData::RequiredExtraFiles
std::vector< std::string > RequiredExtraFiles
Definition: SimulatorSignature.hpp:163
openfluid::ware::SignatureDataItem::DataName
std::string DataName
Definition: SimulatorSignature.hpp:71
openfluid::ware::SignatureSpatialDataItem::SignatureSpatialDataItem
SignatureSpatialDataItem()
Definition: SimulatorSignature.hpp:98
openfluid::ware::SignatureHandledData::RequiredParams
std::vector< SignatureDataItem > RequiredParams
Definition: SimulatorSignature.hpp:147
openfluid::ware::SimDomain_t
std::string SimDomain_t
Definition: SimulatorSignature.hpp:57
openfluid::ware::SimulatorSignature::TimeScheduling
SignatureTimeScheduling TimeScheduling
Definition: SimulatorSignature.hpp:341
openfluid::ware::SignatureTimeScheduling::setAsFixed
void setAsFixed(openfluid::core::Duration_t Val)
Definition: SimulatorSignature.hpp:283
OPENFLUID_API
#define OPENFLUID_API
Definition: dllexport.hpp:86
openfluid::ware::SignatureHandledData::UpdatedVars
std::vector< SignatureTypedSpatialDataItem > UpdatedVars
Definition: SimulatorSignature.hpp:151
openfluid::ware::WareType::UNDEFINED
@ UNDEFINED
openfluid::ware::SimulatorSignature::Domain
SimDomain_t Domain
Definition: SimulatorSignature.hpp:316
openfluid::ware::SignatureUnitsGraph::UpdatedUnitsGraph
std::string UpdatedUnitsGraph
Definition: SimulatorSignature.hpp:228
openfluid::ware::WareSignature
Definition: WareSignature.hpp:52
openfluid::ware::SignatureHandledData::UsedAttribute
std::vector< SignatureSpatialDataItem > UsedAttribute
Definition: SimulatorSignature.hpp:161
openfluid::ware::SignatureTimeScheduling::setAsUndefined
void setAsUndefined()
Definition: SimulatorSignature.hpp:269
openfluid::ware::SignatureHandledData::SignatureHandledData
SignatureHandledData()
Definition: SimulatorSignature.hpp:170
openfluid::ware::SignatureDataItem::Description
std::string Description
Definition: SimulatorSignature.hpp:72
openfluid::ware::SignatureHandledData::UsedVars
std::vector< SignatureTypedSpatialDataItem > UsedVars
Definition: SimulatorSignature.hpp:155
openfluid::core::Value::Type
Type
Definition: Value.hpp:66
openfluid::ware::SignatureHandledData::ProducedAttribute
std::vector< SignatureSpatialDataItem > ProducedAttribute
Definition: SimulatorSignature.hpp:157
openfluid::ware::SimulatorSignature::Process
SimProcess_t Process
Definition: SimulatorSignature.hpp:321
openfluid::ware::SignatureUnitsClassItem::UnitsClass
openfluid::core::UnitsClass_t UnitsClass
Definition: SimulatorSignature.hpp:206
openfluid::ware::SignatureTimeScheduling::Type
SchedulingType Type
Definition: SimulatorSignature.hpp:257
openfluid::ware::SignatureUnitsGraph
Definition: SimulatorSignature.hpp:224
openfluid::ware::SignatureTimeScheduling::Min
openfluid::core::Duration_t Min
Definition: SimulatorSignature.hpp:259
openfluid::ware::SignatureDataItem::SignatureDataItem
SignatureDataItem()
Definition: SimulatorSignature.hpp:75
openfluid::ware::SignatureTimeScheduling::UNDEFINED
@ UNDEFINED
Definition: SimulatorSignature.hpp:255
openfluid::ware::SignatureTimeScheduling::Max
openfluid::core::Duration_t Max
Definition: SimulatorSignature.hpp:261
openfluid::ware::SignatureTypedSpatialDataItem::SignatureTypedSpatialDataItem
SignatureTypedSpatialDataItem()
Definition: SimulatorSignature.hpp:123
openfluid::ware::SimulatorSignature::clear
void clear()
Definition: SimulatorSignature.hpp:350
openfluid::ware::SignatureDataItem
Definition: SimulatorSignature.hpp:67
openfluid::ware::SimulatorSignature::SimulatorSignature
SimulatorSignature()
Definition: SimulatorSignature.hpp:344
openfluid::ware::SimulatorSignature
Definition: SimulatorSignature.hpp:308
openfluid::ware::SignatureTimeScheduling::SignatureTimeScheduling
SignatureTimeScheduling()
Definition: SimulatorSignature.hpp:264
openfluid::ware::SignatureUnitsClassItem
Definition: SimulatorSignature.hpp:202
openfluid::ware::SignatureUnitsClassItem::Description
std::string Description
Definition: SimulatorSignature.hpp:208
openfluid::ware::SignatureSpatialDataItem::SignatureSpatialDataItem
SignatureSpatialDataItem(std::string DName, openfluid::core::UnitsClass_t UClass, std::string DDescription, std::string DUnit)
Definition: SimulatorSignature.hpp:102
openfluid::ware::SignatureTypedSpatialDataItem
Definition: SimulatorSignature.hpp:116
openfluid::ware::SignatureTimeScheduling::setAsDefaultDeltaT
void setAsDefaultDeltaT()
Definition: SimulatorSignature.hpp:276
openfluid::ware::SimProcess_t
std::string SimProcess_t
Definition: SimulatorSignature.hpp:55
openfluid::ware::SignatureTimeScheduling
Definition: SimulatorSignature.hpp:251
openfluid
Definition: ApplicationException.hpp:47
openfluid::ware::SignatureTimeScheduling::SchedulingType
SchedulingType
Definition: SimulatorSignature.hpp:255
openfluid::ware::SignatureDataItem::SignatureDataItem
SignatureDataItem(std::string DName, std::string DDescription, std::string DUnit)
Definition: SimulatorSignature.hpp:79
openfluid::ware::SignatureSpatialDataItem::UnitsClass
openfluid::core::UnitsClass_t UnitsClass
Definition: SimulatorSignature.hpp:96
openfluid::ware::SignatureUnitsClassItem::SignatureUnitsClassItem
SignatureUnitsClassItem(openfluid::core::UnitsClass_t UClass, std::string DDescription)
Definition: SimulatorSignature.hpp:214
openfluid::ware::SignatureDataItem::DataUnit
std::string DataUnit
Definition: SimulatorSignature.hpp:73
openfluid::ware::SimulatorSignature::HandledUnitsGraph
SignatureUnitsGraph HandledUnitsGraph
Definition: SimulatorSignature.hpp:336
openfluid::core::UnitsClass_t
std::string UnitsClass_t
Definition: TypeDefs.hpp:98
openfluid::ware::SignatureHandledData::UsedEventsOnUnits
std::vector< openfluid::core::UnitsClass_t > UsedEventsOnUnits
Definition: SimulatorSignature.hpp:167
DateTime.hpp
openfluid::core::Duration_t
std::uint64_t Duration_t
Definition: TypeDefs.hpp:312
WareSignature.hpp
openfluid::ware::SignatureTimeScheduling::setAsRange
void setAsRange(openfluid::core::Duration_t MinVal, openfluid::core::Duration_t MaxVal)
Definition: SimulatorSignature.hpp:290
openfluid::ware::SignatureHandledData::UsedExtraFiles
std::vector< std::string > UsedExtraFiles
Definition: SimulatorSignature.hpp:165
openfluid::ware::WareSignature::clear
void clear()
Definition: WareSignature.hpp:99
openfluid::ware::SimulatorSignature::Method
SimMethod_t Method
Definition: SimulatorSignature.hpp:326
openfluid::ware::SignatureUnitsGraph::clear
void clear()
Definition: SimulatorSignature.hpp:239
openfluid::ware::SimulatorSignature::HandledData
SignatureHandledData HandledData
Definition: SimulatorSignature.hpp:331
dllexport.hpp
openfluid::ware::SignatureTypedSpatialDataItem::DataType
openfluid::core::Value::Type DataType
Definition: SimulatorSignature.hpp:121
openfluid::ware::SignatureSpatialDataItem
Definition: SimulatorSignature.hpp:92
openfluid::ware::SignatureHandledData::UsedParams
std::vector< SignatureDataItem > UsedParams
Definition: SimulatorSignature.hpp:145
openfluid::ware::SignatureHandledData::ProducedVars
std::vector< SignatureTypedSpatialDataItem > ProducedVars
Definition: SimulatorSignature.hpp:149
openfluid::ware::SignatureUnitsGraph::UpdatedUnitsClass
std::vector< SignatureUnitsClassItem > UpdatedUnitsClass
Definition: SimulatorSignature.hpp:230
openfluid::ware::SignatureHandledData::clear
void clear()
Definition: SimulatorSignature.hpp:176
openfluid::ware::SignatureHandledData::RequiredVars
std::vector< SignatureTypedSpatialDataItem > RequiredVars
Definition: SimulatorSignature.hpp:153