Documentation for OpenFLUID 2.2.0
openfluid::ware::SimulationDrivenWare Class Reference

#include <ware/SimulationDrivenWare.hpp>

Public Member Functions

virtual ~SimulationDrivenWare ()
 
void linkToSimulation (const openfluid::base::SimulationStatus *SimStatus)
 
void linkToSimulationLogger (openfluid::base::SimulationLogger *SimLogger)
 
void initializeWare (const WareID_t &ID)
 
void finalizeWare ()
 
void setPreviousTimeIndex (const openfluid::core::TimeIndex_t &TimeIndex)
 
- Public Member Functions inherited from openfluid::ware::PluggableWare
 PluggableWare ()=default
 
 PluggableWare (const PluggableWare &)=delete
 
 PluggableWare (PluggableWare &&)=default
 
PluggableWareoperator= (const PluggableWare &)=delete
 
PluggableWareoperator= (PluggableWare &&)=default
 
virtual ~PluggableWare ()=default
 
void linkToRunEnvironment (const openfluid::core::MapValue *Env)
 

Protected Member Functions

virtual bool isLinked () const
 
void appendToLog (openfluid::tools::FileLogger::LogType LType, const std::string &Msg) const
 
void displayToConsole (openfluid::tools::FileLogger::LogType LType, const std::string &Msg) const
 
openfluid::base::ExceptionContext computeWareContext (const std::string &CodeLoc="") const
 
openfluid::base::ExceptionContext computeFrameworkContext (const std::string &CodeLoc="") const
 
openfluid::core::DateTime OPENFLUID_GetBeginDate () const
 
openfluid::core::DateTime OPENFLUID_GetEndDate () const
 
openfluid::core::DateTime OPENFLUID_GetCurrentDate () const
 
openfluid::core::Duration_t OPENFLUID_GetSimulationDuration () const
 
openfluid::core::Duration_t OPENFLUID_GetDefaultDeltaT () const
 
openfluid::core::TimeIndex_t OPENFLUID_GetCurrentTimeIndex () const
 
openfluid::core::TimeIndex_t OPENFLUID_GetPreviousRunTimeIndex () const
 
openfluid::base::SimulationStatus::SimulationStage OPENFLUID_GetCurrentStage () const
 
std::string OPENFLUID_GetCurrentStageAsString () const
 
openfluid::base::SimulationStatus::SchedulingConstraint OPENFLUID_GetSchedulingConstraint () const
 
virtual void OPENFLUID_RaiseWarning (const std::string &Msg)
 
virtual void OPENFLUID_RaiseWarning (const std::string &Source, const std::string &Msg)
 
virtual void OPENFLUID_RaiseError (const std::string &Msg)
 
virtual void OPENFLUID_RaiseError (const std::string &Source, const std::string &Msg)
 
 SimulationDrivenWare (WareType WType)
 
bool OPENFLUID_IsWareParameterExist (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName) const
 
openfluid::core::StringValue OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName) const
 
bool OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, openfluid::core::StringValue &Val) const
 
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, openfluid::core::VectorValue &Val) 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, bool &Val) const
 
bool OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, double &Val) const
 
bool OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, long &Val) const
 
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, int &Val) const
 
bool OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::string &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< double > &Vals) const
 
bool OPENFLUID_GetWareParameter (const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName, std::vector< long > &Vals) const
 
- Protected Member Functions inherited from openfluid::ware::PluggableWare
bool OPENFLUID_GetRunEnvironment (const std::string &Key, std::string &Val)
 
bool OPENFLUID_GetRunEnvironment (const std::string &Key, bool &Val)
 
WareID_t OPENFLUID_GetWareID () const
 
WareType OPENFLUID_GetWareType () const
 
 PluggableWare (WareType WType)
 

Friends

class WareRNG
 

Additional Inherited Members

- Static Public Member Functions inherited from openfluid::ware::PluggableWare
static bool isWellFormatted (const openfluid::ware::WareParamKey_t &ParameterKey)
 
- Protected Attributes inherited from openfluid::ware::PluggableWare
bool m_Initialized
 
Inheritance diagram for openfluid::ware::SimulationDrivenWare:
Collaboration diagram for openfluid::ware::SimulationDrivenWare:

Constructor & Destructor Documentation

◆ SimulationDrivenWare()

openfluid::ware::SimulationDrivenWare::SimulationDrivenWare ( WareType  WType)
inlineprotected

◆ ~SimulationDrivenWare()

virtual openfluid::ware::SimulationDrivenWare::~SimulationDrivenWare ( )
inlinevirtual

Member Function Documentation

◆ appendToLog()

void openfluid::ware::SimulationDrivenWare::appendToLog ( openfluid::tools::FileLogger::LogType  LType,
const std::string &  Msg 
) const
protected

◆ computeFrameworkContext()

openfluid::base::ExceptionContext openfluid::ware::SimulationDrivenWare::computeFrameworkContext ( const std::string &  CodeLoc = "") const
protected

◆ computeWareContext()

openfluid::base::ExceptionContext openfluid::ware::SimulationDrivenWare::computeWareContext ( const std::string &  CodeLoc = "") const
protected

◆ displayToConsole()

void openfluid::ware::SimulationDrivenWare::displayToConsole ( openfluid::tools::FileLogger::LogType  LType,
const std::string &  Msg 
) const
protected

◆ finalizeWare()

void openfluid::ware::SimulationDrivenWare::finalizeWare ( )
virtual

Reimplemented from openfluid::ware::PluggableWare.

◆ initializeWare()

void openfluid::ware::SimulationDrivenWare::initializeWare ( const WareID_t ID)
virtual

Reimplemented from openfluid::ware::PluggableWare.

◆ isLinked()

virtual bool openfluid::ware::SimulationDrivenWare::isLinked ( ) const
inlineprotectedvirtual

◆ linkToSimulation()

void openfluid::ware::SimulationDrivenWare::linkToSimulation ( const openfluid::base::SimulationStatus SimStatus)

◆ linkToSimulationLogger()

void openfluid::ware::SimulationDrivenWare::linkToSimulationLogger ( openfluid::base::SimulationLogger SimLogger)
inline

◆ OPENFLUID_GetBeginDate()

openfluid::core::DateTime openfluid::ware::SimulationDrivenWare::OPENFLUID_GetBeginDate ( ) const
protected

Returns the real beginning date of the simulated period

Returns
the date

◆ OPENFLUID_GetCurrentDate()

openfluid::core::DateTime openfluid::ware::SimulationDrivenWare::OPENFLUID_GetCurrentDate ( ) const
protected

Returns the current real date corresponding to the current time index

Returns
the date

◆ OPENFLUID_GetCurrentStage()

openfluid::base::SimulationStatus::SimulationStage openfluid::ware::SimulationDrivenWare::OPENFLUID_GetCurrentStage ( ) const
protected

Returns the current stage of the simulation

Returns
the stage

◆ OPENFLUID_GetCurrentStageAsString()

std::string openfluid::ware::SimulationDrivenWare::OPENFLUID_GetCurrentStageAsString ( ) const
protected

Returns the current stage of the simulation as a string

Returns
the stage name

◆ OPENFLUID_GetCurrentTimeIndex()

openfluid::core::TimeIndex_t openfluid::ware::SimulationDrivenWare::OPENFLUID_GetCurrentTimeIndex ( ) const
protected

Returns the current time index of the simulation, in seconds since the simulation started. When the simulation starts, the time index is equal to zero.

Returns
the current time index in seconds

◆ OPENFLUID_GetDefaultDeltaT()

openfluid::core::Duration_t openfluid::ware::SimulationDrivenWare::OPENFLUID_GetDefaultDeltaT ( ) const
protected

Returns the default DeltaT used by the scheduler

Returns
the deltaT in seconds

◆ OPENFLUID_GetEndDate()

openfluid::core::DateTime openfluid::ware::SimulationDrivenWare::OPENFLUID_GetEndDate ( ) const
protected

Returns the real ending date of the simulated period

Returns
the date

◆ OPENFLUID_GetPreviousRunTimeIndex()

openfluid::core::TimeIndex_t openfluid::ware::SimulationDrivenWare::OPENFLUID_GetPreviousRunTimeIndex ( ) const
protected

Returns the time index of the simulation when the plugged ware was previously run

Returns
the time index in seconds

◆ OPENFLUID_GetSchedulingConstraint()

openfluid::base::SimulationStatus::SchedulingConstraint openfluid::ware::SimulationDrivenWare::OPENFLUID_GetSchedulingConstraint ( ) const
protected

Returns the scheduling constraint applied to the simulation (may be NONE)

Returns
the constraint type

◆ OPENFLUID_GetSimulationDuration()

openfluid::core::Duration_t openfluid::ware::SimulationDrivenWare::OPENFLUID_GetSimulationDuration ( ) const
protected

Returns the simulation duration in seconds

Returns
the duration in seconds

◆ OPENFLUID_GetWareParameter() [1/14]

openfluid::core::StringValue openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName 
) const
protected

Returns a ware parameter from the parameters set, as a StringValue

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
Returns
the value of the requested parameter

◆ OPENFLUID_GetWareParameter() [2/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
bool &  Val 
) const
protected

Gets a ware parameter from the parameters set, as a boolean

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [3/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
double &  Val 
) const
protected

Gets a ware parameter from the parameters set, as a double

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [4/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
float &  Val 
) const
protected

Gets a ware parameter from the parameters set, as a float

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [5/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
int &  Val 
) const
protected

Gets a ware parameter value from the parameters set, as an int

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [6/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
long &  Val 
) const
protected

Gets a ware parameter value from the parameters set, as a long int

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [7/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
openfluid::core::DoubleValue Val 
) const
protected

Gets a ware parameter from the parameters set, as a DoubleValue

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [8/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
openfluid::core::MatrixValue Val 
) const
protected

Gets a ware parameter from the parameters set, as a MatrixValue

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [9/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
openfluid::core::StringValue Val 
) const
protected

Gets a ware parameter from the parameters set, as a StringValue

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [10/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
openfluid::core::VectorValue Val 
) const
protected

Gets a ware parameter from the parameters set, as a VectorValue

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [11/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
std::string &  Val 
) const
protected

Gets a ware parameter value from the parameters set, as a string

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valthe value of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [12/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
std::vector< double > &  Vals 
) const
protected

Gets a ware parameter vector of values from the parameters set, as a vector of doubles

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valsthe vector of values of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [13/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
std::vector< long > &  Vals 
) const
protected

Gets a ware parameter vector of values from the parameters set, as a vector of long ints

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valsthe vector of values of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_GetWareParameter() [14/14]

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_GetWareParameter ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName,
std::vector< std::string > &  Vals 
) const
protected

Gets a ware parameter vector of values from the parameters set, as a vector of strings

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
[out]Valsthe vector of values of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_IsWareParameterExist()

bool openfluid::ware::SimulationDrivenWare::OPENFLUID_IsWareParameterExist ( const openfluid::ware::WareParams_t Params,
const openfluid::ware::WareParamKey_t ParamName 
) const
protected

Returns true if the parameter exists

Parameters
[in]Paramsthe parameters set for the ware
[in]ParamNamethe name of the requested parameter
Returns
true if the parameter exists, false otherwise

◆ OPENFLUID_RaiseError() [1/2]

virtual void openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseError ( const std::string &  Msg)
protectedvirtual

Raises an error message to the kernel. This stops the simulation the next time the kernel has the control

Parameters
[in]Msgthe content of the message

Reimplemented from openfluid::ware::PluggableWare.

◆ OPENFLUID_RaiseError() [2/2]

virtual void openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseError ( const std::string &  Source,
const std::string &  Msg 
)
protectedvirtual

Raises an error message to the kernel. This stops the simulation the next time the kernel has the control

Parameters
[in]Sourcethe source of the message
[in]Msgthe content of the message
Deprecated:
Since version 2.1.0. Use openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseError(const std::string&) instead

◆ OPENFLUID_RaiseWarning() [1/2]

virtual void openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseWarning ( const std::string &  Msg)
protectedvirtual

Raises a time-marked warning message to the kernel. This does not stops the simulation

Parameters
[in]Msgthe content of the message

◆ OPENFLUID_RaiseWarning() [2/2]

virtual void openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseWarning ( const std::string &  Source,
const std::string &  Msg 
)
protectedvirtual

Raises a time-marked warning message to the kernel. This does not stops the simulation

Parameters
[in]Sourcethe source of the message
[in]Msgthe content of the message
Deprecated:
Since version 2.1.0. Use openfluid::ware::SimulationDrivenWare::OPENFLUID_RaiseWarning(const std::string&) or OPENFLUID_LogWarning instead

◆ setPreviousTimeIndex()

void openfluid::ware::SimulationDrivenWare::setPreviousTimeIndex ( const openfluid::core::TimeIndex_t TimeIndex)
inline

Friends And Related Function Documentation

◆ WareRNG

friend class WareRNG
friend

The documentation for this class was generated from the following file: