{
}
+GlobalSimLoopExitEvent::GlobalSimLoopExitEvent(const std::string &_cause,
+ int c, Tick r)
+ : GlobalEvent(curTick(), Minimum_Pri, IsExitEvent),
+ cause(_cause), code(c), repeat(r)
+{
+}
+
const char *
GlobalSimLoopExitEvent::description() const
{
new GlobalSimLoopExitEvent(when + simQuantum, message, exit_code, repeat);
}
+void
+exitSimLoopNow(const std::string &message, int exit_code, Tick repeat,
+ bool serialize)
+{
+ new GlobalSimLoopExitEvent(message, exit_code, repeat);
+}
+
LocalSimLoopExitEvent::LocalSimLoopExitEvent(const std::string &_cause, int c,
Tick r)
: Event(Sim_Exit_Pri, IsExitEvent),
Tick repeat;
public:
- // non-scheduling version for createForUnserialize()
- GlobalSimLoopExitEvent();
GlobalSimLoopExitEvent(Tick when, const std::string &_cause, int c,
Tick repeat = 0);
+ GlobalSimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0);
const std::string getCause() const { return cause; }
int getCode() const { return code; }
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
- static Serializable *createForUnserialize(CheckpointIn &cp,
- const std::string §ion);
};
//
void exitSimLoop(const std::string &message, int exit_code = 0,
Tick when = curTick(), Tick repeat = 0,
bool serialize = false);
+/// Schedule an event as above, but make it high priority so it runs before
+/// any normal events which are schedule at the current time.
+void exitSimLoopNow(const std::string &message, int exit_code = 0,
+ Tick repeat = 0, bool serialize = false);
#endif // __SIM_EXIT_HH__