Dm3Ch

scheduler.hpp

Mar 30th, 2015
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #ifndef SCHEDULER_H
  2. #define SCHEDULER_H
  3.  
  4. #include "boost/date_time/posix_time/posix_time.hpp"
  5. #include <functional>
  6. #include <chrono>
  7.  
  8. namespace schelduler{
  9.     using namespace schelduler;
  10.     using namespace boost::posix_time;
  11.  
  12.     class task_timepoint{
  13.         protected:
  14.             ptime run_time; //Time at(after) that task_function should run
  15.             std::function<void(void)> task_function; //Function that should be run at specified time
  16.  
  17.         public:
  18.             task_timepoint(ptime run_time, std::function<void(void)> task_function);
  19.     };
  20.  
  21.     class task_period : public task_timepoint{
  22.         private:
  23.             time_duration run_period;
  24.  
  25.         public:
  26.             task_period(time_duration run_period, std::function<void(void)> task_function);
  27.     };
  28. }
  29.  #endif
Advertisement
Add Comment
Please, Sign In to add comment