00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef SST_TIMEVORTEX_H
00014 #define SST_TIMEVORTEX_H
00015
00016 #include <set>
00017
00018 #include <sst/core/activityQueue.h>
00019
00020 namespace SST {
00021
00022 class TimeVortex : public ActivityQueue {
00023 public:
00024 TimeVortex() : ActivityQueue() {}
00025 virtual ~TimeVortex();
00026
00027 bool empty() {return data.empty();}
00028 int size() {return data.size();}
00029 void insert(Activity* activity) {data.insert(activity);}
00030 Activity* pop() {
00031 if ( data.size() == 0 ) return NULL;
00032 std::multiset<Activity*,Activity::less_time_priority>::iterator it = data.begin();
00033 Activity* ret_val = (*it);
00034 data.erase(it);
00035 return ret_val;
00036 }
00037
00038 private:
00039
00040 std::multiset<Activity*,Activity::less_time_priority> data;
00041
00042
00043
00044
00045
00046
00047
00048 };
00049
00050 }
00051
00052 #endif // SST_TIMEVORTEX_H