Documentation for OpenFLUID 2.2.2
Loading...
Searching...
No Matches
SimulationDrivenWare.hpp
Go to the documentation of this file.
1/*
2
3 This file is part of OpenFLUID software
4 Copyright(c) 2021-2026, INRAE
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 SimulationDrivenWare.hpp
35
36 @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38
39
40#ifndef __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__
41#define __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__
42
43
50
51
52/**
53 @internal
54*/
55#define REQUIRE_SIMULATION_STAGE(stage,msg) \
56 if (OPENFLUID_GetCurrentStage() != (stage)) \
57 { \
58 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
59 throw openfluid::base::FrameworkException(Context,msg); \
60 }
61
62/**
63 @internal
64*/
65#define REQUIRE_SIMULATION_STAGE_GE(stage,msg) \
66 if (OPENFLUID_GetCurrentStage() < (stage)) \
67 { \
68 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
69 throw openfluid::base::FrameworkException(Context,msg); \
70 }
71
72/**
73 @internal
74*/
75#define REQUIRE_SIMULATION_STAGE_LE(stage,msg) \
76 if (OPENFLUID_GetCurrentStage() > (stage)) \
77 { \
78 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
79 throw openfluid::base::FrameworkException(Context,msg); \
80 }
81
82
83// =====================================================================
84// =====================================================================
85
86
87/**
88 @internal
89*/
90#define _STREAMTOSTRING(_stream) ((static_cast<std::ostringstream&>(std::ostringstream().flush() << _stream)).str())
91
92
93// Log macros for warnings
94
95/**
96 Adds a warning message to simulation log file
97
98 Exemple:
99 @snippet wares/InfosDebugSim.cpp macro_logwarning
100
101 @cond OpenFLUID:completion
102 {
103 "contexts" : ["SIMULATOR", "OBSERVER"],
104 "menupath" : ["Messages"],
105 "title" : "Log warning message",
106 "text" : "OPENFLUID_LogWarning(%%SEL_START%%\"message\"%%SEL_END%%)"
107 }
108 @endcond
109*/
110#define OPENFLUID_LogWarning(_stream) \
111 appendToLog(openfluid::tools::FileLogger::LogType::WARNING_MSG,_STREAMTOSTRING(_stream))
112
113/**
114 Displays a warning message to stdout (on screen by default)
115
116 Exemple:
117 @snippet wares/InfosDebugSim.cpp macro_displaywarning
118
119 @cond OpenFLUID:completion
120 {
121 "contexts" : ["SIMULATOR", "OBSERVER"],
122 "menupath" : ["Messages"],
123 "title" : "Display warning message",
124 "text" : "OPENFLUID_DisplayWarning(%%SEL_START%%\"message\"%%SEL_END%%)"
125 }
126 @endcond
127*/
128#define OPENFLUID_DisplayWarning(_stream) \
129 displayToConsole(openfluid::tools::FileLogger::LogType::WARNING_MSG,_STREAMTOSTRING(_stream))
130
131/**
132 Adds a warning message to simulation log file and displays it to stdout (on screen by default)
133
134 Exemple:
135 @snippet wares/InfosDebugSim.cpp macro_logdisplaywarning
136
137 @cond OpenFLUID:completion
138 {
139 "contexts" : ["SIMULATOR", "OBSERVER"],
140 "menupath" : ["Messages"],
141 "title" : "Log and warning debug message",
142 "text" : "OPENFLUID_LogAndDisplayWarning(%%SEL_START%%\"message\"%%SEL_END%%)"
143 }
144 @endcond
145*/
146#define OPENFLUID_LogAndDisplayWarning(_stream) \
147 OPENFLUID_LogWarning(_stream); \
148 OPENFLUID_DisplayWarning(_stream)
149
150
151// Log macros for infos
152
153/**
154 Adds an information message to simulation log file
155
156 Exemple:
157 @snippet wares/InfosDebugSim.cpp macro_loginfo
158
159 @cond OpenFLUID:completion
160 {
161 "contexts" : ["SIMULATOR", "OBSERVER"],
162 "menupath" : ["Messages"],
163 "title" : "Log information message",
164 "text" : "OPENFLUID_LogInfo(%%SEL_START%%\"message\"%%SEL_END%%)"
165 }
166 @endcond
167*/
168#define OPENFLUID_LogInfo(_stream) \
169 appendToLog(openfluid::tools::FileLogger::LogType::INFO_MSG,_STREAMTOSTRING(_stream))
170
171/**
172 Displays an information message to stdout (on screen by default)
173
174 Exemple:
175 @snippet wares/InfosDebugSim.cpp macro_displayinfo
176
177 @cond OpenFLUID:completion
178 {
179 "contexts" : ["SIMULATOR", "OBSERVER"],
180 "menupath" : ["Messages"],
181 "title" : "Display information message",
182 "text" : "OPENFLUID_DisplayInfo(%%SEL_START%%\"message\"%%SEL_END%%)"
183 }
184 @endcond
185*/
186#define OPENFLUID_DisplayInfo(_stream) \
187 displayToConsole(openfluid::tools::FileLogger::LogType::INFO_MSG,_STREAMTOSTRING(_stream))
188
189/**
190 Adds an information message to simulation log file and displays it to stdout (on screen by default)
191
192 Exemple:
193 @snippet wares/InfosDebugSim.cpp macro_logdisplayinfo
194
195 @cond OpenFLUID:completion
196 {
197 "contexts" : ["SIMULATOR", "OBSERVER"],
198 "menupath" : ["Messages"],
199 "title" : "Log and display information message",
200 "text" : "OPENFLUID_LogAndDisplayInfo(%%SEL_START%%\"message\"%%SEL_END%%)"
201 }
202 @endcond
203*/
204#define OPENFLUID_LogAndDisplayInfo(_stream) \
205 OPENFLUID_LogInfo(_stream); \
206 OPENFLUID_DisplayInfo(_stream)
207
208
209// Log macros for debug
210
211/**
212 @def OPENFLUID_LogDebug
213 Adds a debug message to simulation log file
214
215 Exemple:
216 @snippet wares/InfosDebugSim.cpp macro_logdebug
217
218 @cond OpenFLUID:completion
219 {
220 "contexts" : ["SIMULATOR", "OBSERVER"],
221 "menupath" : ["Messages"],
222 "title" : "Log debug message",
223 "text" : "OPENFLUID_LogDebug(%%SEL_START%%\"message\"%%SEL_END%%)"
224 }
225 @endcond
226*/
227
228/**
229 @def OPENFLUID_DisplayDebug
230 Displays a debug message to stdout (on screen by default)
231
232 Exemple:
233 @snippet wares/InfosDebugSim.cpp macro_displaydebug
234
235 @cond OpenFLUID:completion
236 {
237 "contexts" : ["SIMULATOR", "OBSERVER"],
238 "menupath" : ["Messages"],
239 "title" : "Display debug message",
240 "text" : "OPENFLUID_DisplayDebug(%%SEL_START%%\"message\"%%SEL_END%%)"
241 }
242 @endcond
243*/
244
245/**
246 @def OPENFLUID_LogAndDisplayDebug
247 Adds a debug message to simulation log file and displays it to stdout (on screen by default)
248
249 @snippet wares/InfosDebugSim.cpp macro_logdisplaydebug
250
251 @cond OpenFLUID:completion
252 {
253 "contexts" : ["SIMULATOR", "OBSERVER"],
254 "menupath" : ["Messages"],
255 "title" : "Log and display debug message",
256 "text" : "OPENFLUID_LogAndDisplayDebug(%%SEL_START%%\"message\"%%SEL_END%%)"
257 }
258 @endcond
259*/
260
261#ifndef NDEBUG
262
263#define OPENFLUID_LogDebug(_stream) \
264 appendToLog(openfluid::tools::FileLogger::LogType::DEBUG_MSG,_STREAMTOSTRING(_stream))
265
266#define OPENFLUID_DisplayDebug(_stream) \
267 displayToConsole(openfluid::tools::FileLogger::LogType::DEBUG_MSG,_STREAMTOSTRING(_stream))
268
269#define OPENFLUID_LogAndDisplayDebug(_stream) \
270 OPENFLUID_LogDebug(_stream); \
271 OPENFLUID_DisplayDebug(_stream)
272
273#else
274
275#define OPENFLUID_LogDebug(_stream)
276
277#define OPENFLUID_DisplayDebug(_stream)
278
279#define OPENFLUID_LogAndDisplayDebug(_stream)
280
281#endif
282
283
284// =====================================================================
285// =====================================================================
286
287
288namespace openfluid { namespace ware {
289
290
292{
293 friend class WareRNG;
294
295 private:
296
297 const openfluid::base::SimulationStatus* mp_SimStatus;
298
300
301 openfluid::core::TimeIndex_t m_PreviousTimeIndex;
302
303 protected:
304
305
306 virtual bool isLinked() const
307 {
308 return (PluggableWare::isLinked() && mp_SimLogger != nullptr && mp_SimStatus != nullptr);
309 }
310
311 void appendToLog(openfluid::tools::FileLogger::LogType LType, const std::string& Msg) const;
312
313 void displayToConsole(openfluid::tools::FileLogger::LogType LType, const std::string& Msg) const;
314
315
316 openfluid::base::ExceptionContext computeWareContext(const std::string& CodeLoc = "") const;
317
318 openfluid::base::ExceptionContext computeFrameworkContext(const std::string& CodeLoc = "") const;
319
320
321 /**
322 Returns the real beginning date of the simulated period
323 @return the date
324
325 @cond OpenFLUID:completion
326 {
327 "contexts" : ["SIMULATOR", "OBSERVER"],
328 "menupath" : ["Time"],
329 "title" : "Get begin date of simulation",
330 "text" : "OPENFLUID_GetBeginDate()"
331 }
332 @endcond
333 */
335
336 /**
337 Returns the real ending date of the simulated period
338 @return the date
339
340 @cond OpenFLUID:completion
341 {
342 "contexts" : ["SIMULATOR", "OBSERVER"],
343 "menupath" : ["Time"],
344 "title" : "Get end date of simulation",
345 "text" : "OPENFLUID_GetEndDate()"
346 }
347 @endcond
348 */
350
351 /**
352 Returns the current real date corresponding to the current time index
353 @return the date
354
355 @cond OpenFLUID:completion
356 {
357 "contexts" : ["SIMULATOR", "OBSERVER"],
358 "menupath" : ["Time"],
359 "title" : "Get begin current date of simulation",
360 "text" : "OPENFLUID_GetCurrentDate()"
361 }
362 @endcond
363 */
365
366 /**
367 Returns the simulation duration in seconds
368 @return the duration in seconds
369
370 @cond OpenFLUID:completion
371 {
372 "contexts" : ["SIMULATOR", "OBSERVER"],
373 "menupath" : ["Time"],
374 "title" : "Get total simulation duration",
375 "text" : "OPENFLUID_GetSimulationDuration()"
376 }
377 @endcond
378 */
380
381 /**
382 Returns the default DeltaT used by the scheduler
383 @return the deltaT in seconds
384
385 @cond OpenFLUID:completion
386 {
387 "contexts" : ["SIMULATOR", "OBSERVER"],
388 "menupath" : ["Time"],
389 "title" : "Get default deltaT",
390 "text" : "OPENFLUID_GetDefaultDeltaT()"
391 }
392 @endcond
393 */
395
396 /**
397 Returns the current time index of the simulation, in seconds since the simulation started.
398 When the simulation starts, the time index is equal to zero.
399 @return the current time index in seconds
400
401 @cond OpenFLUID:completion
402 {
403 "contexts" : ["SIMULATOR", "OBSERVER"],
404 "menupath" : ["Time"],
405 "title" : "Get current time index",
406 "text" : "OPENFLUID_GetCurrentTimeIndex()"
407 }
408 @endcond
409 */
411
412 /**
413 Returns the time index of the simulation when the plugged ware was previously run
414 @return the time index in seconds
415
416 @cond OpenFLUID:completion
417 {
418 "contexts" : ["SIMULATOR", "OBSERVER"],
419 "menupath" : ["Time"],
420 "title" : "Get time index of the previous ware run",
421 "text" : "OPENFLUID_GetPreviousRunTimeIndex()"
422 }
423 @endcond
424 */
426
427 /**
428 Returns the current stage of the simulation
429 @return the stage
430
431 @cond OpenFLUID:completion
432 {
433 "contexts" : ["SIMULATOR", "OBSERVER"],
434 "menupath" : ["Time"],
435 "title" : "Get current simulation stage",
436 "text" : "OPENFLUID_GetCurrentStage()"
437 }
438 @endcond
439 */
441
442 /**
443 Returns the current stage of the simulation as a string
444 @return the stage name
445
446 @cond OpenFLUID:completion
447 {
448 "contexts" : ["SIMULATOR", "OBSERVER"],
449 "menupath" : ["Time"],
450 "title" : "Get current simulation stage as a string",
451 "text" : "OPENFLUID_GetCurrentStageAsString()"
452 }
453 @endcond
454 */
456
457 /**
458 Returns the scheduling constraint applied to the simulation (may be NONE)
459 @return the constraint type
460
461 @cond OpenFLUID:completion
462 {
463 "contexts" : ["SIMULATOR", "OBSERVER"],
464 "menupath" : ["Time"],
465 "title" : "Get scheduling constraint mode",
466 "text" : "OPENFLUID_GetSchedulingConstraint()"
467 }
468 @endcond
469 */
471
472
473 /**
474 Raises a time-marked warning message to the kernel. This does not stops the simulation
475 @param[in] Msg the content of the message
476 */
477 virtual void OPENFLUID_RaiseWarning(const std::string& Msg);
478
479 /**
480 Raises a time-marked warning message to the kernel. This does not stops the simulation
481 @param[in] Source the source of the message
482 @param[in] Msg the content of the message
483 @deprecated Since version 2.1.0.
484 Use openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseWarning(const std::string&)
485 or #OPENFLUID_LogWarning instead
486 */
487 [[deprecated]] virtual void OPENFLUID_RaiseWarning(const std::string& Source, const std::string& Msg);
488
489 /**
490 Raises an error message to the kernel. This stops the simulation the next time the kernel has the control
491 @param[in] Msg the content of the message
492
493 @cond OpenFLUID:completion
494 {
495 "contexts" : ["SIMULATOR", "OBSERVER"],
496 "menupath" : ["Messages"],
497 "title" : "Raise fatal error",
498 "text" : "OPENFLUID_RaiseError(%%SEL_START%%\"message\"%%SEL_END%%)"
499 }
500 @endcond
501 */
502 virtual void OPENFLUID_RaiseError(const std::string& Msg);
503
504 /**
505 Raises an error message to the kernel. This stops the simulation the next time the kernel has the control
506 @param[in] Source the source of the message
507 @param[in] Msg the content of the message
508 @deprecated Since version 2.1.0.
509 Use openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseError(const std::string&) instead
510 */
511 [[deprecated]] virtual void OPENFLUID_RaiseError(const std::string& Source, const std::string& Msg);
512
514 mp_SimStatus(nullptr), mp_SimLogger(nullptr), m_PreviousTimeIndex(0)
515 { }
516
517
518 protected:
519
520 /**
521 Returns true if the parameter exists
522 @param[in] Params the parameters set for the ware
523 @param[in] ParamName the name of the requested parameter
524 @return true if the parameter exists, false otherwise
525
526 @cond OpenFLUID:completion
527 {
528 "contexts" : ["SIMULATOR", "OBSERVER"],
529 "menupath" : ["Parameters"],
530 "title" : "Test if a ware parameter exists",
531 "text" : "OPENFLUID_IsWareParameterExist(Params,%%SEL_START%%ParamName%%SEL_END%%)"
532 }
533 @endcond
534 */
536 const openfluid::ware::WareParamKey_t& ParamName) const;
537
538 /**
539 Returns a ware parameter from the parameters set, as a StringValue
540 @param[in] Params the parameters set for the ware
541 @param[in] ParamName the name of the requested parameter
542 @return the value of the requested parameter
543
544 @cond OpenFLUID:completion
545 {
546 "contexts" : ["SIMULATOR", "OBSERVER"],
547 "menupath" : ["Parameters"],
548 "title" : "Get ware parameter (by return)",
549 "text" : "OPENFLUID_GetWareParameter(Params,%%SEL_START%%ParamName%%SEL_END%%)"
550 }
551 @endcond
552 */
554 const openfluid::ware::WareParamKey_t& ParamName)
555 const;
556
557 /**
558 Gets a ware parameter from the parameters set, as a StringValue
559 @param[in] Params the parameters set for the ware
560 @param[in] ParamName the name of the requested parameter
561 @param[out] Val the value of the requested parameter
562 @return true if the parameter exists, false otherwise
563
564 @cond OpenFLUID:completion
565 {
566 "contexts" : ["SIMULATOR", "OBSERVER"],
567 "menupath" : ["Parameters"],
568 "title" : "Get ware parameter",
569 "text" : "OPENFLUID_GetWareParameter(Params,%%SEL_START%%ParamName%%SEL_END%%,Val)"
570 }
571 @endcond
572 */
574 const openfluid::ware::WareParamKey_t& ParamName,
576
577 /**
578 Gets a ware parameter from the parameters set, as a DoubleValue
579 @param[in] Params the parameters set for the ware
580 @param[in] ParamName the name of the requested parameter
581 @param[out] Val the value of the requested parameter
582 @return true if the parameter exists, false otherwise
583 */
585 const openfluid::ware::WareParamKey_t& ParamName,
587
588 /**
589 Gets a ware parameter from the parameters set, as a VectorValue
590 @param[in] Params the parameters set for the ware
591 @param[in] ParamName the name of the requested parameter
592 @param[out] Val the value of the requested parameter
593 @return true if the parameter exists, false otherwise
594 */
596 const openfluid::ware::WareParamKey_t& ParamName,
598
599 /**
600 Gets a ware parameter from the parameters set, as a MatrixValue
601 @param[in] Params the parameters set for the ware
602 @param[in] ParamName the name of the requested parameter
603 @param[out] Val the value of the requested parameter
604 @return true if the parameter exists, false otherwise
605 */
607 const openfluid::ware::WareParamKey_t& ParamName,
609
610 /**
611 Gets a ware parameter from the parameters set, as a boolean
612 @param[in] Params the parameters set for the ware
613 @param[in] ParamName the name of the requested parameter
614 @param[out] Val the value of the requested parameter
615 @return true if the parameter exists, false otherwise
616 */
618 const openfluid::ware::WareParamKey_t& ParamName,
619 bool& Val) const;
620
621 /**
622 Gets a ware parameter from the parameters set, as a double
623 @param[in] Params the parameters set for the ware
624 @param[in] ParamName the name of the requested parameter
625 @param[out] Val the value of the requested parameter
626 @return true if the parameter exists, false otherwise
627 */
629 const openfluid::ware::WareParamKey_t& ParamName,
630 double& Val) const;
631
632 /**
633 Gets a ware parameter value from the parameters set, as a long int
634 @param[in] Params the parameters set for the ware
635 @param[in] ParamName the name of the requested parameter
636 @param[out] Val the value of the requested parameter
637 @return true if the parameter exists, false otherwise
638 */
640 const openfluid::ware::WareParamKey_t& ParamName,
641 long& Val) const;
642
643 /**
644 Gets a ware parameter from the parameters set, as a float
645 @param[in] Params the parameters set for the ware
646 @param[in] ParamName the name of the requested parameter
647 @param[out] Val the value of the requested parameter
648 @return true if the parameter exists, false otherwise
649 */
651 const openfluid::ware::WareParamKey_t& ParamName,
652 float& Val) const;
653
654 /**
655 Gets a ware parameter value from the parameters set, as an int
656 @param[in] Params the parameters set for the ware
657 @param[in] ParamName the name of the requested parameter
658 @param[out] Val the value of the requested parameter
659 @return true if the parameter exists, false otherwise
660 */
662 const openfluid::ware::WareParamKey_t& ParamName,
663 int& Val) const;
664
665 /**
666 Gets a ware parameter value from the parameters set, as a string
667 @param[in] Params the parameters set for the ware
668 @param[in] ParamName the name of the requested parameter
669 @param[out] Val the value of the requested parameter
670 @return true if the parameter exists, false otherwise
671 */
673 const openfluid::ware::WareParamKey_t& ParamName,
674 std::string& Val) const;
675
676 /**
677 Gets a ware parameter vector of values from the parameters set, as a vector of strings
678 @param[in] Params the parameters set for the ware
679 @param[in] ParamName the name of the requested parameter
680 @param[out] Vals the vector of values of the requested parameter
681 @return true if the parameter exists, false otherwise
682 */
684 const openfluid::ware::WareParamKey_t& ParamName,
685 std::vector<std::string>& Vals) const;
686
687 /**
688 Gets a ware parameter vector of values from the parameters set, as a vector of doubles
689 @param[in] Params the parameters set for the ware
690 @param[in] ParamName the name of the requested parameter
691 @param[out] Vals the vector of values of the requested parameter
692 @return true if the parameter exists, false otherwise
693 */
695 const openfluid::ware::WareParamKey_t& ParamName,
696 std::vector<double>& Vals) const;
697
698 /**
699 Gets a ware parameter vector of values from the parameters set, as a vector of long ints
700 @param[in] Params the parameters set for the ware
701 @param[in] ParamName the name of the requested parameter
702 @param[out] Vals the vector of values of the requested parameter
703 @return true if the parameter exists, false otherwise
704 */
706 const openfluid::ware::WareParamKey_t& ParamName,
707 std::vector<long>& Vals) const;
708
709
710 public:
711
713 { }
714
716
718 {
719 mp_SimLogger = SimLogger;
720 }
721
722 void initializeWare(const WareID_t& ID);
723
725
727 {
728 m_PreviousTimeIndex = TimeIndex;
729 }
730
731};
732
733
734} } // openfluid::ware
735
736
737#endif /* __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__ */
Definition ExceptionContext.hpp:54
Definition SimulationLogger.hpp:58
Definition SimulationStatus.hpp:56
SimulationStage
Definition SimulationStatus.hpp:59
SchedulingConstraint
Definition SimulationStatus.hpp:62
Class for management of date and time information.
Definition DateTime.hpp:88
Definition DoubleValue.hpp:81
Definition MatrixValue.hpp:85
Definition StringValue.hpp:83
Definition VectorValue.hpp:85
LogType
Definition FileLogger.hpp:72
Definition PluggableWare.hpp:98
Definition SimulationDrivenWare.hpp:292
void linkToSimulationLogger(openfluid::base::SimulationLogger *SimLogger)
Definition SimulationDrivenWare.hpp:717
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, bool &Val) const
virtual bool isLinked() const
Definition SimulationDrivenWare.hpp:306
openfluid::base::SimulationStatus::SimulationStage OPENFLUID_GetCurrentStage() const
openfluid::core::TimeIndex_t OPENFLUID_GetCurrentTimeIndex() const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, openfluid::core::MatrixValue &Val) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, openfluid::core::VectorValue &Val) const
void setPreviousTimeIndex(const openfluid::core::TimeIndex_t &TimeIndex)
Definition SimulationDrivenWare.hpp:726
openfluid::core::DateTime OPENFLUID_GetBeginDate() const
void initializeWare(const WareID_t &ID)
openfluid::core::DateTime OPENFLUID_GetEndDate() const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::vector< double > &Vals) const
openfluid::core::Duration_t OPENFLUID_GetDefaultDeltaT() const
void appendToLog(openfluid::tools::FileLogger::LogType LType, const std::string &Msg) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, long &Val) const
openfluid::core::Duration_t OPENFLUID_GetSimulationDuration() const
virtual void OPENFLUID_RaiseWarning(const std::string &Msg)
openfluid::base::SimulationStatus::SchedulingConstraint OPENFLUID_GetSchedulingConstraint() const
openfluid::base::ExceptionContext computeFrameworkContext(const std::string &CodeLoc="") const
void displayToConsole(openfluid::tools::FileLogger::LogType LType, const std::string &Msg) const
std::string OPENFLUID_GetCurrentStageAsString() const
SimulationDrivenWare(WareType WType)
Definition SimulationDrivenWare.hpp:513
openfluid::core::StringValue OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName) const
virtual void OPENFLUID_RaiseError(const std::string &Source, const std::string &Msg)
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, openfluid::core::DoubleValue &Val) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, double &Val) const
virtual void OPENFLUID_RaiseWarning(const std::string &Source, const std::string &Msg)
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::string &Val) const
openfluid::core::TimeIndex_t OPENFLUID_GetPreviousRunTimeIndex() const
virtual ~SimulationDrivenWare()
Definition SimulationDrivenWare.hpp:712
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, openfluid::core::StringValue &Val) const
openfluid::core::DateTime OPENFLUID_GetCurrentDate() const
bool OPENFLUID_IsWareParameterExist(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName) const
void linkToSimulation(const openfluid::base::SimulationStatus *SimStatus)
virtual void OPENFLUID_RaiseError(const std::string &Msg)
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, float &Val) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::vector< std::string > &Vals) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::vector< long > &Vals) const
bool OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, int &Val) const
openfluid::base::ExceptionContext computeWareContext(const std::string &CodeLoc="") const
Definition WareRNG.hpp:58
#define OPENFLUID_API
Definition dllexport.hpp:86
std::uint64_t Duration_t
Definition TypeDefs.hpp:312
std::uint64_t TimeIndex_t
Definition TypeDefs.hpp:298
WareType
Definition TypeDefs.hpp:61
std::string WareID_t
Definition TypeDefs.hpp:49
std::string WareParamKey_t
Definition TypeDefs.hpp:142
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition TypeDefs.hpp:146
Definition ApplicationException.hpp:47