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()) 110 #define OPENFLUID_LogWarning(_stream) \ 111 appendToLog(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 128 #define OPENFLUID_DisplayWarning(_stream) \ 129 displayToConsole(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream)) 146 #define OPENFLUID_LogAndDisplayWarning(_stream) \ 147 OPENFLUID_LogWarning(_stream); \ 148 OPENFLUID_DisplayWarning(_stream) 168 #define OPENFLUID_LogInfo(_stream) \ 169 appendToLog(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 186 #define OPENFLUID_DisplayInfo(_stream) \ 187 displayToConsole(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream)) 204 #define OPENFLUID_LogAndDisplayInfo(_stream) \ 205 OPENFLUID_LogInfo(_stream); \ 206 OPENFLUID_DisplayInfo(_stream) 263 #define OPENFLUID_LogDebug(_stream) \ 264 appendToLog(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 266 #define OPENFLUID_DisplayDebug(_stream) \ 267 displayToConsole(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream)) 269 #define OPENFLUID_LogAndDisplayDebug(_stream) \ 270 OPENFLUID_LogDebug(_stream); \ 271 OPENFLUID_DisplayDebug(_stream) 275 #define OPENFLUID_LogDebug(_stream) 277 #define OPENFLUID_DisplayDebug(_stream) 279 #define OPENFLUID_LogAndDisplayDebug(_stream) 454 std::string OPENFLUID_GetCurrentStageAsString()
const;
476 virtual void OPENFLUID_RaiseWarning(
const std::string& Msg);
486 [[deprecated]]
virtual void OPENFLUID_RaiseWarning(
const std::string& Source,
const std::string& Msg);
501 virtual void OPENFLUID_RaiseError(
const std::string& Msg);
510 [[deprecated]]
virtual void OPENFLUID_RaiseError(
const std::string& Source,
const std::string& Msg);
513 mp_SimStatus(nullptr), mp_SimLogger(nullptr), m_PreviousTimeIndex(0)
526 mp_SimLogger = SimLogger;
529 void initializeWare(
const WareID_t& ID);
535 m_PreviousTimeIndex = TimeIndex;
Definition: SimulationLogger.hpp:57
Definition: ApplicationException.hpp:47
LogType
Definition: FileLogger.hpp:72
std::uint64_t Duration_t
Definition: TypeDefs.hpp:312
WareType
Definition: TypeDefs.hpp:60
Definition: SimulationStatus.hpp:55
std::uint64_t TimeIndex_t
Definition: TypeDefs.hpp:298
virtual bool isLinked() const
Definition: PluggableWare.hpp:123
SimulationDrivenWare(WareType WType)
Definition: SimulationDrivenWare.hpp:512
SchedulingConstraint
Definition: SimulationStatus.hpp:62
void setPreviousTimeIndex(const openfluid::core::TimeIndex_t &TimeIndex)
Definition: SimulationDrivenWare.hpp:533
Definition: PluggableWare.hpp:97
void linkToSimulationLogger(openfluid::base::SimulationLogger *SimLogger)
Definition: SimulationDrivenWare.hpp:524
virtual ~SimulationDrivenWare()
Definition: SimulationDrivenWare.hpp:519
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: ExceptionContext.hpp:53
Definition: SimulationDrivenWare.hpp:291
virtual bool isLinked() const
Definition: SimulationDrivenWare.hpp:305
Class for management of date and time information.
Definition: DateTime.hpp:87
std::string WareID_t
Definition: TypeDefs.hpp:49
SimulationStage
Definition: SimulationStatus.hpp:59