40 #ifndef __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__
41 #define __OPENFLUID_WARE_SIMULATIONDRIVENWARE_HPP__
53 #define REQUIRE_SIMULATION_STAGE(stage,msg) \
54 if (OPENFLUID_GetCurrentStage() != (stage)) \
56 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
57 throw openfluid::base::FrameworkException(Context,msg); \
60 #define REQUIRE_SIMULATION_STAGE_GE(stage,msg) \
61 if (OPENFLUID_GetCurrentStage() < (stage)) \
63 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
64 throw openfluid::base::FrameworkException(Context,msg); \
67 #define REQUIRE_SIMULATION_STAGE_LE(stage,msg) \
68 if (OPENFLUID_GetCurrentStage() > (stage)) \
70 openfluid::base::ExceptionContext Context = computeFrameworkContext(OPENFLUID_CODE_LOCATION); \
71 throw openfluid::base::FrameworkException(Context,msg); \
79 #define _STREAMTOSTRING(_stream) ((static_cast<std::ostringstream&>(std::ostringstream().flush() << _stream)).str())
84 #define OPENFLUID_LogWarning(_stream) \
85 appendToLog(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream))
87 #define OPENFLUID_DisplayWarning(_stream) \
88 displayToConsole(openfluid::tools::FileLogger::LOG_WARNING,_STREAMTOSTRING(_stream))
90 #define OPENFLUID_LogAndDisplayWarning(_stream) \
91 OPENFLUID_LogWarning(_stream); \
92 OPENFLUID_DisplayWarning(_stream)
97 #define OPENFLUID_LogInfo(_stream) \
98 appendToLog(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream))
100 #define OPENFLUID_DisplayInfo(_stream) \
101 displayToConsole(openfluid::tools::FileLogger::LOG_INFO,_STREAMTOSTRING(_stream))
103 #define OPENFLUID_LogAndDisplayInfo(_stream) \
104 OPENFLUID_LogInfo(_stream); \
105 OPENFLUID_DisplayInfo(_stream)
112 #define OPENFLUID_LogDebug(_stream) \
113 appendToLog(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream))
115 #define OPENFLUID_DisplayDebug(_stream) \
116 displayToConsole(openfluid::tools::FileLogger::LOG_DEBUG,_STREAMTOSTRING(_stream))
118 #define OPENFLUID_LogAndDisplayDebug(_stream) \
119 OPENFLUID_LogDebug(_stream); \
120 OPENFLUID_DisplayDebug(_stream)
124 #define OPENFLUID_LogDebug(_stream)
126 #define OPENFLUID_DisplayDebug(_stream)
128 #define OPENFLUID_LogAndDisplayDebug(_stream)
137 namespace openfluid {
namespace ware {
216 std::string OPENFLUID_GetCurrentStageAsString()
const;
229 virtual void OPENFLUID_RaiseWarning(
const std::string& Msg);
239 virtual void OPENFLUID_RaiseWarning(
const std::string& Source,
const std::string& Msg)
OPENFLUID_DEPRECATED;
245 virtual void OPENFLUID_RaiseError(
const std::string& Msg);
254 virtual void OPENFLUID_RaiseError(
const std::string& Source,
const std::string& Msg)
OPENFLUID_DEPRECATED;
257 mp_SimStatus(NULL), mp_SimLogger(NULL), m_PreviousTimeIndex(0) { };
268 { mp_SimLogger = SimLogger; };
270 void initializeWare(
const WareID_t& ID);
275 { m_PreviousTimeIndex = TimeIndex; };
virtual bool isLinked() const
Definition: PluggableWare.hpp:127
LogType
Definition: FileLogger.hpp:69
Class for management of date and time information.
Definition: DateTime.hpp:132
Definition: SimulationStatus.hpp:55
unsigned long long Duration_t
Definition: DateTime.hpp:68
SimulationStage
Definition: SimulationStatus.hpp:59
Definition: SimulationLogger.hpp:59
Definition: PluggableWare.hpp:97
SchedulingConstraint
Definition: SimulationStatus.hpp:62
#define OPENFLUID_DEPRECATED
Definition: deprecation.hpp:54
WareType
Definition: PluggableWare.hpp:101
Definition: ExceptionContext.hpp:53
virtual bool isLinked() const
Definition: SimulationDrivenWare.hpp:154
void linkToSimulationLogger(openfluid::base::SimulationLogger *SimLogger)
Definition: SimulationDrivenWare.hpp:267
SimulationDrivenWare(WareType WType)
Definition: SimulationDrivenWare.hpp:256
#define OPENFLUID_API
Definition: dllexport.hpp:87
unsigned long long TimeIndex_t
Definition: DateTime.hpp:62
Definition: SimulationDrivenWare.hpp:140
virtual ~SimulationDrivenWare()
Definition: SimulationDrivenWare.hpp:262
void setPreviousTimeIndex(const openfluid::core::TimeIndex_t &TimeIndex)
Definition: SimulationDrivenWare.hpp:274
std::string WareID_t
Definition: TypeDefs.hpp:50