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_OT_CONTEXT_MJM012402_HPP |
---|
9 | #define BOOST_OT_CONTEXT_MJM012402_HPP |
---|
10 | |
---|
11 | |
---|
12 | #include <OpenTransport.h> |
---|
13 | |
---|
14 | #include <boost/utility.hpp> |
---|
15 | |
---|
16 | |
---|
17 | namespace boost { |
---|
18 | |
---|
19 | namespace threads { |
---|
20 | |
---|
21 | namespace mac { |
---|
22 | |
---|
23 | namespace detail { |
---|
24 | |
---|
25 | |
---|
26 | // class ot_context is intended to be used only as a singleton. All that this class |
---|
27 | // does is ask OpenTransport to create him an OTClientContextPtr, and then doles |
---|
28 | // this out to anyone who wants it. ot_context should only be instantiated at |
---|
29 | // system task time. |
---|
30 | |
---|
31 | class ot_context: private noncopyable |
---|
32 | { |
---|
33 | protected: |
---|
34 | ot_context(); |
---|
35 | ~ot_context(); |
---|
36 | |
---|
37 | public: |
---|
38 | OTClientContextPtr get_context(); |
---|
39 | |
---|
40 | private: |
---|
41 | OTClientContextPtr m_pContext; |
---|
42 | }; |
---|
43 | |
---|
44 | |
---|
45 | inline OTClientContextPtr ot_context::get_context() |
---|
46 | { return(m_pContext); } |
---|
47 | |
---|
48 | |
---|
49 | } // namespace detail |
---|
50 | |
---|
51 | } // namespace mac |
---|
52 | |
---|
53 | } // namespace threads |
---|
54 | |
---|
55 | } // namespace boost |
---|
56 | |
---|
57 | |
---|
58 | #endif // BOOST_OT_CONTEXT_MJM012402_HPP |
---|
Note: See
TracBrowser
for help on using the repository browser.