Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SCHEDULER_H
- #define SCHEDULER_H
- #include "boost/date_time/posix_time/posix_time.hpp"
- #include <functional>
- #include <chrono>
- namespace schelduler{
- using namespace schelduler;
- using namespace boost::posix_time;
- class task_timepoint{
- protected:
- ptime run_time; //Time at(after) that task_function should run
- std::function<void(void)> task_function; //Function that should be run at specified time
- public:
- task_timepoint(ptime run_time, std::function<void(void)> task_function);
- };
- class task_period : public task_timepoint{
- private:
- time_duration run_period;
- public:
- task_period(time_duration run_period, std::function<void(void)> task_function);
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment