Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00013 #ifndef DURING_IF_H
00014 #define DURING_IF_H
00015
00016 #include <systemc>
00017 #include <boost/function.hpp>
00018 #include <boost/bind.hpp>
00019
00020 class sc_during_if {
00021 public:
00022 sc_during_if() {};
00023
00035 template<typename T>
00036 boost::function<void()> bind_this(void (T::*f) (void)) {
00037 return boost::bind(f, dynamic_cast<T*>(this));
00038 }
00039
00043 virtual void extra_time(const sc_core::sc_time & t) = 0;
00044
00049 virtual void extra_time(double time, sc_core::sc_time_unit unit) {
00050 extra_time(sc_core::sc_time(time, unit));
00051 }
00052
00060 virtual void catch_up(const sc_core::sc_time & t) = 0;
00061
00066 virtual void catch_up(double time, sc_core::sc_time_unit unit) {
00067 catch_up(sc_core::sc_time(time, unit));
00068 }
00069
00075 virtual void catch_up() {
00076 catch_up(sc_core::SC_ZERO_TIME);
00077 }
00078
00085 virtual void sc_call(const boost::function<void()> & f) = 0;
00086
00095 virtual void during(const sc_core::sc_time & time, const boost::function<void()> & routine) = 0;
00096
00101 virtual void during(double time, sc_core::sc_time_unit unit, const boost::function<void()> & routine) {
00102 during(sc_core::sc_time(time, unit), routine);
00103 };
00104
00105
00106 virtual ~sc_during_if() {};
00107
00108 enum mode {seq, thread, pool, ondemand};
00109 virtual mode get_mode() = 0;
00110 private:
00111 };
00112
00113 #endif // DURING_IF_H