sim: clean up CountedDrainEvent slightly.
There's no reason for it to derive from SimLoopExitEvent. This whole drain thing needs to be redone eventually, but this is a stopgap to make later changes to SimLoopExitEvent feasible.
This commit is contained in:
parent
030736a69b
commit
94807214c4
|
@ -85,14 +85,14 @@ exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat)
|
|||
}
|
||||
|
||||
CountedDrainEvent::CountedDrainEvent()
|
||||
: SimLoopExitEvent("Finished drain", 0), count(0)
|
||||
: count(0)
|
||||
{ }
|
||||
|
||||
void
|
||||
CountedDrainEvent::process()
|
||||
{
|
||||
if (--count == 0)
|
||||
exitSimLoop(cause, code);
|
||||
exitSimLoop("Finished drain", 0);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -55,7 +55,7 @@ class SimLoopExitEvent : public Event
|
|||
virtual const char *description() const;
|
||||
};
|
||||
|
||||
class CountedDrainEvent : public SimLoopExitEvent
|
||||
class CountedDrainEvent : public Event
|
||||
{
|
||||
private:
|
||||
// Count of how many objects have not yet drained
|
||||
|
|
Loading…
Reference in a new issue