40 #ifndef __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__ 41 #define __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__ 55 #define REQUIRE_SIMULATION_STAGE(stage,msg) \ 56 if (OPENFLUID_GetCurrentStage() != (stage)) \ 58 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 59 throw openfluid::base::FrameworkException(Context,msg); \ 65 #define REQUIRE_SIMULATION_STAGE_GE(stage,msg) \ 66 if (OPENFLUID_GetCurrentStage() < (stage)) \ 68 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 69 throw openfluid::base::FrameworkException(Context,msg); \ 75 #define REQUIRE_SIMULATION_STAGE_LE(stage,msg) \ 76 if (OPENFLUID_GetCurrentStage() > (stage)) \ 78 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 79 throw openfluid::base::FrameworkException(Context,msg); \ 90 #define _STREAMTOSTRING(_stream) ((static_cast<std::ostringstream&>(std::ostringstream().flush() << _stream)).str()) 103 #define OPENFLUID_LogWarning(_stream) \ 104 appendToLog(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 114 #define OPENFLUID_DisplayWarning(_stream) \ 115 displayToConsole(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 126 #define OPENFLUID_LogAndDisplayWarning(_stream) \ 127 OPENFLUID_LogWarning(_stream); \ 128 OPENFLUID_DisplayWarning(_stream) 141 #define OPENFLUID_LogInfo(_stream) \ 142 appendToLog(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 152 #define OPENFLUID_DisplayInfo(_stream) \ 153 displayToConsole(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 164 #define OPENFLUID_LogAndDisplayInfo(_stream) \ 165 OPENFLUID_LogInfo(_stream); \ 166 OPENFLUID_DisplayInfo(_stream) 204 #define OPENFLUID_LogDebug(_stream) \ 205 appendToLog(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 207 #define OPENFLUID_DisplayDebug(_stream) \ 208 displayToConsole(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 210 #define OPENFLUID_LogAndDisplayDebug(_stream) \ 211 OPENFLUID_LogDebug(_stream); \ 212 OPENFLUID_DisplayDebug(_stream) 216 #define OPENFLUID_LogDebug(_stream) 218 #define OPENFLUID_DisplayDebug(_stream) 220 #define OPENFLUID_LogAndDisplayDebug(_stream) 308 std::string OPENFLUID_GetCurrentStageAsString()
const;
321 virtual void OPENFLUID_RaiseWarning(
const std::string& Msg);
331 [[deprecated]]
virtual void OPENFLUID_RaiseWarning(
const std::string& Source,
const std::string& Msg);
337 virtual void OPENFLUID_RaiseError(
const std::string& Msg);
346 [[deprecated]]
virtual void OPENFLUID_RaiseError(
const std::string& Source,
const std::string& Msg);
349 mp_SimStatus(nullptr), mp_SimLogger(nullptr), m_PreviousTimeIndex(0)
361 { mp_SimLogger = SimLogger; };
363 void initializeWare(
const WareID_t& ID);
368 { m_PreviousTimeIndex = TimeIndex; };
std::uint64_t Duration_t
Definition: TypeDefs.hpp:186
Definition: PluggableWare.hpp:97
SimulationStage
Definition: SimulationStatus.hpp:59
void linkToSimulationLogger(openfluid::base::SimulationLogger *SimLogger)
Definition: SimulationDrivenWare.hpp:360
SimulationDrivenWare(WareType WType)
Definition: SimulationDrivenWare.hpp:348
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: SimulationDrivenWare.hpp:232
Definition: ApplicationException.hpp:47
SchedulingConstraint
Definition: SimulationStatus.hpp:62
std::string WareID_t
Definition: TypeDefs.hpp:49
virtual bool isLinked() const
Definition: PluggableWare.hpp:123
void setPreviousTimeIndex(const openfluid::core::TimeIndex_t &TimeIndex)
Definition: SimulationDrivenWare.hpp:367
LogType
Definition: FileLogger.hpp:72
Definition: SimulationStatus.hpp:55
WareType
Definition: TypeDefs.hpp:60
virtual bool isLinked() const
Definition: SimulationDrivenWare.hpp:246
std::uint64_t TimeIndex_t
Definition: TypeDefs.hpp:181
Definition: ExceptionContext.hpp:53
virtual ~SimulationDrivenWare()
Definition: SimulationDrivenWare.hpp:355
Definition: SimulationLogger.hpp:57
Class for management of date and time information.
Definition: DateTime.hpp:116