10
10
// boost::thread / boost::function / boost::chrono should be ported to
11
11
// std::thread / std::function / std::chrono when we support C++11.
12
12
//
13
- #include < boost/function.hpp>
14
13
#include < boost/chrono/chrono.hpp>
15
14
#include < boost/thread.hpp>
16
15
#include < map>
23
22
//
24
23
// CScheduler* s = new CScheduler();
25
24
// s->scheduleFromNow(doSomething, 11); // Assuming a: void doSomething() { }
26
- // s->scheduleFromNow(boost ::bind(Class::func, this, argument), 3);
25
+ // s->scheduleFromNow(std ::bind(Class::func, this, argument), 3);
27
26
// boost::thread* t = new boost::thread(boost::bind(CScheduler::serviceQueue, s));
28
27
//
29
28
// ... then at program shutdown, clean up the thread running serviceQueue:
@@ -39,20 +38,20 @@ class CScheduler
39
38
CScheduler ();
40
39
~CScheduler ();
41
40
42
- typedef boost ::function<void (void )> Function;
41
+ typedef std ::function<void (void )> Function;
43
42
44
43
// Call func at/after time t
45
44
void schedule (Function f, boost::chrono::system_clock::time_point t);
46
45
47
46
// Convenience method: call f once deltaSeconds from now
48
- void scheduleFromNow (Function f, int64_t deltaSeconds );
47
+ void scheduleFromNow (Function f, int64_t deltaMilliSeconds );
49
48
50
49
// Another convenience method: call f approximately
51
50
// every deltaSeconds forever, starting deltaSeconds from now.
52
51
// To be more precise: every time f is finished, it
53
52
// is rescheduled to run deltaSeconds later. If you
54
53
// need more accurate scheduling, don't use this method.
55
- void scheduleEvery (Function f, int64_t deltaSeconds );
54
+ void scheduleEvery (Function f, int64_t deltaMilliSeconds );
56
55
57
56
// To keep things as simple as possible, there is no unschedule.
58
57
0 commit comments