00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef SST_CORE_TIMEVORTEX_H
00013 #define SST_CORE_TIMEVORTEX_H
00014
00015 #include <sst/core/serialization.h>
00016
00017 #include <cstdio>
00018 #include <functional>
00019 #include <queue>
00020 #include <vector>
00021
00022 #include <sst/core/activityQueue.h>
00023
00024 namespace SST {
00025
00026 class Output;
00027
00028
00029
00030
00031 class TimeVortex : public ActivityQueue {
00032 public:
00033 TimeVortex();
00034 ~TimeVortex();
00035
00036 bool empty();
00037 int size();
00038 void insert(Activity* activity);
00039 Activity* pop();
00040 Activity* front();
00041
00042
00043 void print(Output &out) const;
00044
00045 uint64_t getCurrentDepth() const { return current_depth; }
00046 uint64_t getMaxDepth() const { return max_depth; }
00047
00048 private:
00049 typedef std::priority_queue<Activity*, std::vector<Activity*>, Activity::pq_less_time_priority> dataType_t;
00050 dataType_t data;
00051 uint64_t insertOrder;
00052
00053 uint64_t current_depth;
00054 uint64_t max_depth;
00055
00056 friend class boost::serialization::access;
00057 template<class Archive>
00058 void
00059 serialize(Archive & ar, const unsigned int version )
00060 {
00061 printf("begin TimeVortex::serialize\n");
00062 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(ActivityQueue);
00063 printf(" - TimeVortex::data\n");
00064
00065 printf("end TimeVortex::serialize\n");
00066 }
00067 };
00068
00069 }
00070
00071 BOOST_CLASS_EXPORT_KEY(SST::TimeVortex)
00072
00073 #endif // SST_CORE_TIMEVORTEX_H