40 #ifndef __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__ 41 #define __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__ 56 #define REQUIRE_SIMULATION_STAGE(stage,msg) \ 57 if (OPENFLUID_GetCurrentStage() != (stage)) \ 59 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 60 throw openfluid::base::FrameworkException(Context,msg); \ 66 #define REQUIRE_SIMULATION_STAGE_GE(stage,msg) \ 67 if (OPENFLUID_GetCurrentStage() < (stage)) \ 69 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 70 throw openfluid::base::FrameworkException(Context,msg); \ 76 #define REQUIRE_SIMULATION_STAGE_LE(stage,msg) \ 77 if (OPENFLUID_GetCurrentStage() > (stage)) \ 79 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \ 80 throw openfluid::base::FrameworkException(Context,msg); \ 91 #define _STREAMTOSTRING(_stream) ((static_cast<std::ostringstream&>(std::ostringstream().flush() << _stream)).str()) 104 #define OPENFLUID_LogWarning(_stream) \ 105 appendToLog(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 115 #define OPENFLUID_DisplayWarning(_stream) \ 116 displayToConsole(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 127 #define OPENFLUID_LogAndDisplayWarning(_stream) \ 128 OPENFLUID_LogWarning(_stream); \ 129 OPENFLUID_DisplayWarning(_stream) 142 #define OPENFLUID_LogInfo(_stream) \ 143 appendToLog(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 153 #define OPENFLUID_DisplayInfo(_stream) \ 154 displayToConsole(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 165 #define OPENFLUID_LogAndDisplayInfo(_stream) \ 166 OPENFLUID_LogInfo(_stream); \ 167 OPENFLUID_DisplayInfo(_stream) 205 #define OPENFLUID_LogDebug(_stream) \ 206 appendToLog(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 208 #define OPENFLUID_DisplayDebug(_stream) \ 209 displayToConsole(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 211 #define OPENFLUID_LogAndDisplayDebug(_stream) \ 212 OPENFLUID_LogDebug(_stream); \ 213 OPENFLUID_DisplayDebug(_stream) 217 #define OPENFLUID_LogDebug(_stream) 219 #define OPENFLUID_DisplayDebug(_stream) 221 #define OPENFLUID_LogAndDisplayDebug(_stream) 309 std::string OPENFLUID_GetCurrentStageAsString()
const;
322 virtual void OPENFLUID_RaiseWarning(
const std::string& Msg);
332 virtual void OPENFLUID_RaiseWarning(
const std::string& Source,
const std::string& Msg)
OPENFLUID_DEPRECATED;
338 virtual void OPENFLUID_RaiseError(
const std::string& Msg);
347 virtual void OPENFLUID_RaiseError(
const std::string& Source,
const std::string& Msg)
OPENFLUID_DEPRECATED;
350 mp_SimStatus(nullptr), mp_SimLogger(nullptr), m_PreviousTimeIndex(0) { };
361 { mp_SimLogger = SimLogger; };
363 void initializeWare(
const WareID_t& ID);
368 { m_PreviousTimeIndex = TimeIndex; };
void linkToSimulationLogger(openfluid::base::SimulationLogger *SimLogger)
Definition: SimulationDrivenWare.hpp:360
unsigned long long Duration_t
Definition: DateTime.hpp:68
virtual ~SimulationDrivenWare()
Definition: SimulationDrivenWare.hpp:355
Definition: SimulationLogger.hpp:59
Definition: SimulationDrivenWare.hpp:233
#define OPENFLUID_DEPRECATED
Definition: deprecation.hpp:54
Definition: PluggableWare.hpp:97
std::string WareID_t
Definition: TypeDefs.hpp:50
void setPreviousTimeIndex(const openfluid::core::TimeIndex_t &TimeIndex)
Definition: SimulationDrivenWare.hpp:367
SimulationDrivenWare(WareType WType)
Definition: SimulationDrivenWare.hpp:349
virtual bool isLinked() const
Definition: PluggableWare.hpp:122
SchedulingConstraint
Definition: SimulationStatus.hpp:62
Definition: SimulationStatus.hpp:55
virtual bool isLinked() const
Definition: SimulationDrivenWare.hpp:247
Definition: ApplicationException.hpp:47
WareType
Definition: TypeDefs.hpp:62
#define OPENFLUID_API
Definition: dllexport.hpp:87
unsigned long long TimeIndex_t
Definition: DateTime.hpp:62
Definition: ExceptionContext.hpp:53
SimulationStage
Definition: SimulationStatus.hpp:59
LogType
Definition: FileLogger.hpp:69
Class for management of date and time information.
Definition: DateTime.hpp:132