comparison DEPENDENCIES/generic/include/boost/signals2/trackable.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 // Boost.Signals2 library
2
3 // Copyright Frank Mori Hess 2007,2009.
4 // Copyright Timmo Stange 2007.
5 // Copyright Douglas Gregor 2001-2004. Use, modification and
6 // distribution is subject to the Boost Software License, Version
7 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9
10 // Compatibility class to ease porting from the original
11 // Boost.Signals library. However,
12 // boost::signals2::trackable is NOT thread-safe.
13
14 // For more information, see http://www.boost.org
15
16 #ifndef BOOST_SIGNALS2_TRACKABLE_HPP
17 #define BOOST_SIGNALS2_TRACKABLE_HPP
18
19 #include <boost/assert.hpp>
20 #include <boost/shared_ptr.hpp>
21
22 namespace boost {
23 namespace signals2 {
24 namespace detail
25 {
26 class tracked_objects_visitor;
27 }
28 class trackable {
29 protected:
30 trackable(): _tracked_ptr(static_cast<int*>(0)) {}
31 trackable(const trackable &): _tracked_ptr(static_cast<int*>(0)) {}
32 trackable& operator=(const trackable &)
33 {
34 return *this;
35 }
36 ~trackable() {}
37 private:
38 friend class detail::tracked_objects_visitor;
39 const shared_ptr<void>& get_shared_ptr() const
40 {
41 return _tracked_ptr;
42 }
43
44 shared_ptr<void> _tracked_ptr;
45 };
46 } // end namespace signals2
47 } // end namespace boost
48
49 #endif // BOOST_SIGNALS2_TRACKABLE_HPP