Chris@16: // DEPRECATED in favor of adl_predestruct with deconstruct(). Chris@16: // A simple framework for creating objects with predestructors. Chris@16: // The objects must inherit from boost::signals2::predestructible, and Chris@16: // have their lifetimes managed by Chris@16: // boost::shared_ptr created with the boost::signals2::deconstruct_ptr() Chris@16: // function. Chris@16: // Chris@16: // Copyright Frank Mori Hess 2007-2008. Chris@16: // Chris@16: //Use, modification and Chris@16: // distribution is subject to the Boost Software License, Version Chris@16: // 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP Chris@16: #define BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace signals2 Chris@16: { Chris@16: template class predestructing_deleter; Chris@16: Chris@16: namespace predestructible_adl_barrier Chris@16: { Chris@16: class predestructible Chris@16: { Chris@16: protected: Chris@16: predestructible() {} Chris@16: public: Chris@16: template Chris@16: friend void adl_postconstruct(const shared_ptr &, ...) Chris@16: {} Chris@16: friend void adl_predestruct(predestructible *p) Chris@16: { Chris@16: p->predestruct(); Chris@16: } Chris@16: virtual ~predestructible() {} Chris@16: virtual void predestruct() = 0; Chris@16: }; Chris@16: } // namespace predestructible_adl_barrier Chris@16: using predestructible_adl_barrier::predestructible; Chris@16: } Chris@16: } Chris@16: Chris@16: #endif // BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP