Boost logo

Boost-Commit :

From: fmhess_at_[hidden]
Date: 2007-09-23 20:18:50


Author: fmhess
Date: 2007-09-23 20:18:48 EDT (Sun, 23 Sep 2007)
New Revision: 39493
URL: http://svn.boost.org/trac/boost/changeset/39493

Log:
Moved boost::signalslib::detail::slot_base to boost::signalslib::slot_base,
since it has been exposed in the API by one of the slot::track
methods.

Text files modified:
   sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_base.hpp | 4 +-
   sandbox/thread_safe_signals/boost/thread_safe_signals/detail/slot_template.hpp | 8 ++--
   sandbox/thread_safe_signals/boost/thread_safe_signals/slot_base.hpp | 63 +++++++++++++++++++--------------------
   3 files changed, 36 insertions(+), 39 deletions(-)

Modified: sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_base.hpp
==============================================================================
--- sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_base.hpp (original)
+++ sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_base.hpp 2007-09-23 20:18:48 EDT (Sun, 23 Sep 2007)
@@ -18,13 +18,13 @@
 
 namespace boost {
   namespace signalslib {
+ class slot_base;
     namespace detail {
- class slot_base;
 
       class signal_base : public noncopyable
       {
       public:
- friend class slot_base;
+ friend class boost::signalslib::slot_base;
 
         virtual ~signal_base() {}
       protected:

Modified: sandbox/thread_safe_signals/boost/thread_safe_signals/detail/slot_template.hpp
==============================================================================
--- sandbox/thread_safe_signals/boost/thread_safe_signals/detail/slot_template.hpp (original)
+++ sandbox/thread_safe_signals/boost/thread_safe_signals/detail/slot_template.hpp 2007-09-23 20:18:48 EDT (Sun, 23 Sep 2007)
@@ -23,7 +23,7 @@
   // slot class template.
   template<BOOST_SIGNAL_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS),
     typename SlotFunction = BOOST_FUNCTION_N_DECL(BOOST_SIGNALS_NUM_ARGS)>
- class BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS): public signalslib::detail::slot_base
+ class BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS): public signalslib::slot_base
   {
   public:
     template<BOOST_SIGNAL_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS, Other), typename OtherSlotFunction>
@@ -52,12 +52,12 @@
     template<BOOST_SIGNAL_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS, Other), typename OtherSlotFunction>
     BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(const BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)
       <BOOST_SIGNAL_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS_NUM_ARGS, Other), OtherSlotFunction> &other_slot):
- signalslib::detail::slot_base(other_slot), _slot_function(other_slot._slot_function)
+ signalslib::slot_base(other_slot), _slot_function(other_slot._slot_function)
     {
     }
     template<typename Signature, typename OtherSlotFunction>
     BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(const slot<Signature, OtherSlotFunction> &other_slot):
- signalslib::detail::slot_base(other_slot), _slot_function(other_slot._slot_function)
+ signalslib::slot_base(other_slot), _slot_function(other_slot._slot_function)
     {
     }
     // bind syntactic sugar
@@ -92,7 +92,7 @@
       _trackedObjects.push_back(tracked);
       return *this;
     }
- BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const signalslib::detail::slot_base &slot)
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const signalslib::slot_base &slot)
     {
       tracked_container_type::const_iterator it;
       for(it = slot.tracked_objects().begin(); it != slot.tracked_objects().end(); ++it)

Modified: sandbox/thread_safe_signals/boost/thread_safe_signals/slot_base.hpp
==============================================================================
--- sandbox/thread_safe_signals/boost/thread_safe_signals/slot_base.hpp (original)
+++ sandbox/thread_safe_signals/boost/thread_safe_signals/slot_base.hpp 2007-09-23 20:18:48 EDT (Sun, 23 Sep 2007)
@@ -34,50 +34,47 @@
 
   namespace signalslib
   {
- namespace detail
+ class slot_base
     {
- class slot_base
- {
- public:
- typedef std::vector<boost::weak_ptr<void> > tracked_container_type;
- typedef std::vector<boost::shared_ptr<void> > locked_container_type;
+ public:
+ typedef std::vector<boost::weak_ptr<void> > tracked_container_type;
+ typedef std::vector<boost::shared_ptr<void> > locked_container_type;
 
- const tracked_container_type& tracked_objects() const {return _trackedObjects;}
- locked_container_type lock() const
+ const tracked_container_type& tracked_objects() const {return _trackedObjects;}
+ locked_container_type lock() const
+ {
+ locked_container_type locked_objects;
+ tracked_container_type::const_iterator it;
+ for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
         {
- locked_container_type locked_objects;
- tracked_container_type::const_iterator it;
- for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
+ try
           {
- try
- {
- locked_objects.push_back(shared_ptr<void>(*it));
- }
- catch(const bad_weak_ptr &)
- {
- throw expired_slot();
- }
+ locked_objects.push_back(shared_ptr<void>(*it));
           }
- return locked_objects;
- }
- bool expired() const
- {
- tracked_container_type::const_iterator it;
- for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
+ catch(const bad_weak_ptr &)
           {
- if(it->expired()) return true;
+ throw expired_slot();
           }
- return false;
         }
- protected:
- void track_signal(const signalslib::detail::signal_base &signal)
+ return locked_objects;
+ }
+ bool expired() const
+ {
+ tracked_container_type::const_iterator it;
+ for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
         {
- _trackedObjects.push_back(signal.lock_pimpl());
+ if(it->expired()) return true;
         }
+ return false;
+ }
+ protected:
+ void track_signal(const signalslib::detail::signal_base &signal)
+ {
+ _trackedObjects.push_back(signal.lock_pimpl());
+ }
 
- tracked_container_type _trackedObjects;
- };
- }
+ tracked_container_type _trackedObjects;
+ };
   }
 } // end namespace boost
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk