Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:48

0001 // DEPRECATED in favor of adl_postconstruct with deconstruct<T>().
0002 // A simple framework for creating objects with postconstructors.
0003 // The objects must inherit from boost::signals2::postconstructible, and
0004 // have their lifetimes managed by
0005 // boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
0006 // function.
0007 //
0008 // Copyright Frank Mori Hess 2007-2008.
0009 //
0010 // Use, modification and
0011 // distribution is subject to the Boost Software License, Version
0012 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 
0015 #ifndef BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
0016 #define BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
0017 
0018 namespace boost
0019 {
0020   template<typename T> class shared_ptr;
0021 
0022   namespace signals2
0023   {
0024     namespace postconstructible_adl_barrier
0025     {
0026       class postconstructible;
0027     }
0028     namespace detail
0029     {
0030       void do_postconstruct(const boost::signals2::postconstructible_adl_barrier::postconstructible *ptr);
0031     } // namespace detail
0032 
0033     namespace postconstructible_adl_barrier
0034     {
0035       class postconstructible
0036       {
0037       public:
0038         friend void detail::do_postconstruct(const postconstructible *ptr);
0039         template<typename T>
0040           friend void adl_postconstruct(const shared_ptr<T> &, postconstructible *p)
0041         {
0042           p->postconstruct();
0043         }
0044       protected:
0045         postconstructible() {}
0046         virtual ~postconstructible() {}
0047         virtual void postconstruct() = 0;
0048       };
0049     } // namespace postconstructible_adl_barrier
0050     using postconstructible_adl_barrier::postconstructible;
0051 
0052   }
0053 }
0054 
0055 #endif // BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP