Chris@16: // DEPRECATED in favor of adl_postconstruct with deconstruct(). Chris@16: // A simple framework for creating objects with postconstructors. Chris@16: // The objects must inherit from boost::signals2::postconstructible, 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_POSTCONSTRUCTIBLE_HPP Chris@16: #define BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: template class shared_ptr; Chris@16: Chris@16: namespace signals2 Chris@16: { Chris@16: namespace postconstructible_adl_barrier Chris@16: { Chris@16: class postconstructible; Chris@16: } Chris@16: namespace detail Chris@16: { Chris@16: void do_postconstruct(const boost::signals2::postconstructible_adl_barrier::postconstructible *ptr); Chris@16: } // namespace detail Chris@16: Chris@16: namespace postconstructible_adl_barrier Chris@16: { Chris@16: class postconstructible Chris@16: { Chris@16: public: Chris@16: friend void detail::do_postconstruct(const postconstructible *ptr); Chris@16: template Chris@16: friend void adl_postconstruct(const shared_ptr &sp, postconstructible *p) Chris@16: { Chris@16: p->postconstruct(); Chris@16: } Chris@16: protected: Chris@16: postconstructible() {} Chris@16: virtual ~postconstructible() {} Chris@16: virtual void postconstruct() = 0; Chris@16: }; Chris@16: } // namespace postconstructible_adl_barrier Chris@16: using postconstructible_adl_barrier::postconstructible; Chris@16: Chris@16: } Chris@16: } Chris@16: Chris@16: #endif // BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP