See:
- The implementation simschedule.cpp
- The description Events
<project-file type=“source”/>
<content> #ifndef SIMSCHEDULE_H #define SIMSCHEDULE_H
class SimAgent; class SimProcess;
#include <simdistribution.h> #include <map>
class SimAgent;
/ SimSchedule is an abstraction of all the events */ class SimSchedule { public: / constructor */
SimSchedule(float time); /** destructor */ virtual ~SimSchedule(); /** eventTime returns the event time of the next event */ float eventTime() const { return Time; }
/** handler performs the event */ virtual void handler(float Time, SimProcess *)=0; inline SimAgent* owner() { return Owner; } inline const SimAgent* owner() const { return Owner; } protected: void setEventTime(float time); friend class SimAgent; /** Owner is the agent that manages this schedule. */ SimAgent *Owner; /** EventIndex is used by SimAgent for fast removal of the schedule from the list. */ std::multimap<float, SimSchedule*>::iterator EventIndex; private: /** the occuring time of this event */ float Time;
};
#endif </content>