Line | |
---|
1 | // (C) Copyright Mac Murrett 2001. |
---|
2 | // Use, modification and distribution are subject to the |
---|
3 | // Boost Software License, Version 1.0. (See accompanying file |
---|
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
5 | |
---|
6 | // See http://www.boost.org for most recent version. |
---|
7 | |
---|
8 | #ifndef BOOST_DT_SCHEDULER_MJM012402_HPP |
---|
9 | #define BOOST_DT_SCHEDULER_MJM012402_HPP |
---|
10 | |
---|
11 | |
---|
12 | #include "periodical.hpp" |
---|
13 | |
---|
14 | #include <OpenTransport.h> |
---|
15 | |
---|
16 | |
---|
17 | namespace boost { |
---|
18 | |
---|
19 | namespace threads { |
---|
20 | |
---|
21 | namespace mac { |
---|
22 | |
---|
23 | namespace detail { |
---|
24 | |
---|
25 | |
---|
26 | // class dt_scheduler calls its pure-virtual periodic_function method periodically at |
---|
27 | // deferred task time. This is generally 1kHz under Mac OS 9. |
---|
28 | |
---|
29 | class dt_scheduler |
---|
30 | { |
---|
31 | public: |
---|
32 | dt_scheduler(); |
---|
33 | virtual ~dt_scheduler(); |
---|
34 | |
---|
35 | protected: |
---|
36 | void start_polling(); |
---|
37 | void stop_polling(); |
---|
38 | |
---|
39 | private: |
---|
40 | virtual void periodic_function() = 0; |
---|
41 | |
---|
42 | private: |
---|
43 | void schedule_task(); |
---|
44 | static pascal void task_entry(void *pRefCon); |
---|
45 | void task(); |
---|
46 | |
---|
47 | private: |
---|
48 | bool m_bReschedule; |
---|
49 | OTProcessUPP m_uppTask; |
---|
50 | long m_lTask; |
---|
51 | }; |
---|
52 | |
---|
53 | |
---|
54 | } // namespace detail |
---|
55 | |
---|
56 | } // namespace mac |
---|
57 | |
---|
58 | } // namespace threads |
---|
59 | |
---|
60 | } // namespace boost |
---|
61 | |
---|
62 | |
---|
63 | #endif // BOOST_DT_SCHEDULER_MJM012402_HPP |
---|
Note: See
TracBrowser
for help on using the repository browser.