|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48932 - in sandbox/thread_safe_signals/trunk: boost boost/signals boost/signals2 boost/signals2/detail boost/thread_safe_signals libs/signals2 libs/signals2/test libs/thread_safe_signals
From: fmhess_at_[hidden]
Date: 2008-09-23 16:23:25
Author: fmhess
Date: 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
New Revision: 48932
URL: http://svn.boost.org/trac/boost/changeset/48932
Log:
Moved everything into signals2 namespace. Moved headers
accordingly to conform with boost policy. Have not
updated documentation to reflect changes yet.
Added:
sandbox/thread_safe_signals/trunk/boost/signals2/
- copied from r48926, /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/
sandbox/thread_safe_signals/trunk/boost/signals2.hpp (contents, props changed)
sandbox/thread_safe_signals/trunk/boost/signals2/deconstruct_ptr.hpp
- copied, changed from r48926, /sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp
sandbox/thread_safe_signals/trunk/boost/signals2/last_value.hpp
- copied, changed from r48926, /sandbox/thread_safe_signals/trunk/boost/last_value.hpp
sandbox/thread_safe_signals/trunk/boost/signals2/postconstructible.hpp
- copied, changed from r48926, /sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp
sandbox/thread_safe_signals/trunk/boost/signals2/predestructible.hpp
- copied, changed from r48926, /sandbox/thread_safe_signals/trunk/boost/predestructible.hpp
sandbox/thread_safe_signals/trunk/boost/signals2/signal.hpp
- copied, changed from r48926, /sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp
sandbox/thread_safe_signals/trunk/libs/signals2/
- copied from r48926, /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/
Removed:
sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp
sandbox/thread_safe_signals/trunk/boost/last_value.hpp
sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp
sandbox/thread_safe_signals/trunk/boost/predestructible.hpp
sandbox/thread_safe_signals/trunk/boost/signal.hpp
sandbox/thread_safe_signals/trunk/boost/signals/
sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp
sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/
sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/
Text files modified:
sandbox/thread_safe_signals/trunk/boost/signals2/auto_threaded.hpp | 6
sandbox/thread_safe_signals/trunk/boost/signals2/connection.hpp | 8
sandbox/thread_safe_signals/trunk/boost/signals2/deconstruct_ptr.hpp | 87 ++++++++-------
sandbox/thread_safe_signals/trunk/boost/signals2/detail/signal_template.hpp | 227 +++++++++++++++++++--------------------
sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common.hpp | 6
sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common_macros.hpp | 5
sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_call_iterator.hpp | 10
sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_groups.hpp | 11 +
sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_template.hpp | 189 ++++++++++++++++----------------
sandbox/thread_safe_signals/trunk/boost/signals2/last_value.hpp | 130 +++++++++++-----------
sandbox/thread_safe_signals/trunk/boost/signals2/multi_threaded.hpp | 6
sandbox/thread_safe_signals/trunk/boost/signals2/postconstructible.hpp | 37 +++--
sandbox/thread_safe_signals/trunk/boost/signals2/predestructible.hpp | 25 ++-
sandbox/thread_safe_signals/trunk/boost/signals2/shared_connection_block.hpp | 8
sandbox/thread_safe_signals/trunk/boost/signals2/signal.hpp | 68 +++++------
sandbox/thread_safe_signals/trunk/boost/signals2/signal_base.hpp | 10
sandbox/thread_safe_signals/trunk/boost/signals2/single_threaded.hpp | 13 -
sandbox/thread_safe_signals/trunk/boost/signals2/slot.hpp | 65 +++++-----
sandbox/thread_safe_signals/trunk/boost/signals2/slot_base.hpp | 24 ++--
sandbox/thread_safe_signals/trunk/libs/signals2/test/dead_slot_test.cpp | 6
sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp | 21 +-
sandbox/thread_safe_signals/trunk/libs/signals2/test/invocation_benchmark.cpp | 4
sandbox/thread_safe_signals/trunk/libs/signals2/test/ordering_test.cpp | 8
sandbox/thread_safe_signals/trunk/libs/signals2/test/regression_test.cpp | 10
sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_n_test.cpp | 40 +++---
sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_test.cpp | 34 ++--
sandbox/thread_safe_signals/trunk/libs/signals2/test/threading_models_test.cpp | 14 +-
sandbox/thread_safe_signals/trunk/libs/signals2/test/track_test.cpp | 10
28 files changed, 550 insertions(+), 532 deletions(-)
Deleted: sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,77 +0,0 @@
-// A function for creating a shared_ptr that enhances the plain
-// shared_ptr constructors by adding support for postconstructors
-// and predestructors through the boost::postconstructible and
-// boost::predestructible base classes.
-//
-// Author: Frank Mori Hess 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_DECONSTRUCT_PTR_HEADER
-#define BOOST_DECONSTRUCT_PTR_HEADER
-
-#include <boost/checked_delete.hpp>
-#include <boost/postconstructible.hpp>
-#include <boost/predestructible.hpp>
-#include <boost/shared_ptr.hpp>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost
-{
- namespace deconstruct_detail
- {
- extern inline void do_postconstruct(const boost::postconstructible *ptr)
- {
- boost::postconstructible *nonconst_ptr = const_cast<boost::postconstructible*>(ptr);
- nonconst_ptr->postconstruct();
- }
- extern inline void do_postconstruct(...)
- {
- }
- }
- template<typename T> class predestructing_deleter
- {
- public:
- void operator()(const T *ptr) const
- {
- m_predestruct(ptr);
- checked_delete(ptr);
- }
- private:
- static void m_predestruct(...)
- {
- }
- static void m_predestruct(const boost::predestructible *ptr)
- {
- boost::predestructible *nonconst_ptr = const_cast<boost::predestructible*>(ptr);
- nonconst_ptr->predestruct();
- }
- };
-
- template<typename T>
- shared_ptr<T> deconstruct_ptr(T *ptr)
- {
- if(ptr == 0) return shared_ptr<T>();
- shared_ptr<T> shared(ptr, boost::predestructing_deleter<T>());
- deconstruct_detail::do_postconstruct(ptr);
- return shared;
- }
- template<typename T, typename D>
- shared_ptr<T> deconstruct_ptr(T *ptr, D deleter)
- {
- if(ptr == 0) return shared_ptr<T>();
- shared_ptr<T> shared(ptr, deleter);
- deconstruct_detail::do_postconstruct(ptr);
- return shared;
- }
-}
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif
Deleted: sandbox/thread_safe_signals/trunk/boost/last_value.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/last_value.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,95 +0,0 @@
-// last_value function object (documented as part of Boost.Signals)
-
-// Copyright Frank Mori Hess 2007.
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org/libs/signals
-
-#ifndef BOOST_LAST_VALUE_HPP
-#define BOOST_LAST_VALUE_HPP
-
-#include <cassert>
-#include <boost/optional.hpp>
-#include <stdexcept>
-
-namespace boost {
- class expired_slot;
- // no_slots_error is thrown when we are unable to generate a return value
- // due to no slots being connected to the signal.
- class no_slots_error: public std::exception
- {
- public:
- virtual const char* what() {return "boost::no_slots_error";}
- };
- namespace last_value_detail {
- template<typename T>
- T default_construct(const T *resolver)
- {
- throw no_slots_error();
- }
- template<typename T>
- optional<T> default_construct(const optional<T> *resolver)
- {
- return optional<T>();
- }
- }
- template<typename T>
- struct last_value {
- typedef T result_type;
-
- template<typename InputIterator>
- T operator()(InputIterator first, InputIterator last) const
- {
- T * resolver = 0;
- if(first == last)
- {
- return last_value_detail::default_construct(resolver);
- }
- optional<T> value;
- while (first != last)
- {
- try
- {
- value = *first;
- }
- catch(const expired_slot &)
- {}
- ++first;
- }
- if(value) return value.get();
- return last_value_detail::default_construct(resolver);
- }
- };
-
- template<>
- class last_value<void> {
-#ifdef BOOST_NO_VOID_RETURNS
- struct unusable {};
- public:
- typedef unusable result_type;
-#else
- public:
- typedef void result_type;
-#endif // BOOST_NO_VOID_RETURNS
- template<typename InputIterator>
- result_type
- operator()(InputIterator first, InputIterator last) const
- {
- while (first != last)
- {
- try
- {
- *first;
- }
- catch(const expired_slot &)
- {}
- ++first;
- }
- return result_type();
- }
- };
-}
-#endif // BOOST_SIGNALS_LAST_VALUE_HPP
Deleted: sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,42 +0,0 @@
-// A simple framework for creating objects with postconstructors.
-// The objects must inherit from boost::postconstructible, and
-// have their lifetimes managed by
-// boost::shared_ptr created with the boost::deconstruct_ptr()
-// function.
-//
-// Author: Frank Mori Hess 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_POSTCONSTRUCTIBLE_HEADER
-#define BOOST_POSTCONSTRUCTIBLE_HEADER
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost
-{
- class postconstructible;
- namespace deconstruct_detail
- {
- void do_postconstruct(const boost::postconstructible *ptr);
- }
-
- class postconstructible
- {
- public:
- friend void deconstruct_detail::do_postconstruct(const boost::postconstructible *ptr);
- protected:
- postconstructible() {}
- virtual ~postconstructible() {}
- virtual void postconstruct() {}
- };
-}
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif
Deleted: sandbox/thread_safe_signals/trunk/boost/predestructible.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/predestructible.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,35 +0,0 @@
-// A simple framework for creating objects with predestructors.
-// The objects must inherit from boost::predestructible, and
-// have their lifetimes managed by
-// boost::shared_ptr created with the boost::deconstruct_ptr()
-// function.
-//
-// Author: Frank Mori Hess 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_PREDESTRUCTIBLE_HEADER
-#define BOOST_PREDESTRUCTIBLE_HEADER
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost
-{
- class predestructible
- {
- public:
- virtual void predestruct() {}
- protected:
- predestructible() {}
- virtual ~predestructible() {}
- };
-}
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif
Deleted: sandbox/thread_safe_signals/trunk/boost/signal.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/signal.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,3 +0,0 @@
-
-#include <boost/thread_safe_signal.hpp>
-
Added: sandbox/thread_safe_signals/trunk/boost/signals2.hpp
==============================================================================
--- (empty file)
+++ sandbox/thread_safe_signals/trunk/boost/signals2.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -0,0 +1,10 @@
+// A convenience header for Boost.Signals2, should pull in everying in the library.
+
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#include <boost/signals2/signal.hpp>
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/auto_threaded.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/auto_threaded.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/auto_threaded.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
// Boost.Signals library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -17,13 +17,13 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
class auto_threaded
{
public:
typedef boost::detail::lightweight_mutex mutex_type;
};
- } // end namespace signalslib
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/connection.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/connection.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/connection.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -3,6 +3,8 @@
Author: Frank Mori Hess <fmhess_at_[hidden]>
Begin: 2007-01-23
*/
+// Copyright Frank Mori Hess 2007-2008.
+//
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,7 +17,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/thread_safe_signals/slot.hpp>
+#include <boost/signals2/slot.hpp>
#include <boost/type_traits.hpp>
#include <boost/visit_each.hpp>
#include <boost/weak_ptr.hpp>
@@ -27,7 +29,7 @@
namespace boost
{
- namespace signalslib
+ namespace signals2
{
extern inline void null_deleter(const void*) {}
namespace detail
@@ -193,7 +195,7 @@
const scoped_connection& operator=(const connection &rhs)
{
disconnect();
- boost::signalslib::connection::operator=(rhs);
+ connection::operator=(rhs);
return *this;
}
void swap(scoped_connection &other)
Copied: sandbox/thread_safe_signals/trunk/boost/signals2/deconstruct_ptr.hpp (from r48926, /sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp)
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/deconstruct_ptr.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/deconstruct_ptr.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,9 +1,11 @@
-// A function for creating a shared_ptr that enhances the plain
+// A factory function for creating a shared_ptr that enhances the plain
// shared_ptr constructors by adding support for postconstructors
-// and predestructors through the boost::postconstructible and
-// boost::predestructible base classes.
+// and predestructors through the boost::signals2::postconstructible and
+// boost::signals2::predestructible base classes.
//
-// Author: Frank Mori Hess 2007. Use, modification and
+// Copyright Frank Mori Hess 2007-2008.
+//
+// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -22,51 +24,54 @@
namespace boost
{
- namespace deconstruct_detail
+ namespace signals2
{
- extern inline void do_postconstruct(const boost::postconstructible *ptr)
- {
- boost::postconstructible *nonconst_ptr = const_cast<boost::postconstructible*>(ptr);
- nonconst_ptr->postconstruct();
- }
- extern inline void do_postconstruct(...)
+ namespace deconstruct_detail
{
+ extern inline void do_postconstruct(const boost::postconstructible *ptr)
+ {
+ boost::postconstructible *nonconst_ptr = const_cast<boost::postconstructible*>(ptr);
+ nonconst_ptr->postconstruct();
+ }
+ extern inline void do_postconstruct(...)
+ {
+ }
}
- }
- template<typename T> class predestructing_deleter
- {
- public:
- void operator()(const T *ptr) const
+ template<typename T> class predestructing_deleter
{
- m_predestruct(ptr);
- checked_delete(ptr);
- }
- private:
- static void m_predestruct(...)
+ public:
+ void operator()(const T *ptr) const
+ {
+ m_predestruct(ptr);
+ checked_delete(ptr);
+ }
+ private:
+ static void m_predestruct(...)
+ {
+ }
+ static void m_predestruct(const boost::predestructible *ptr)
+ {
+ boost::predestructible *nonconst_ptr = const_cast<boost::predestructible*>(ptr);
+ nonconst_ptr->predestruct();
+ }
+ };
+
+ template<typename T>
+ shared_ptr<T> deconstruct_ptr(T *ptr)
{
+ if(ptr == 0) return shared_ptr<T>(ptr);
+ shared_ptr<T> shared(ptr, boost::predestructing_deleter<T>());
+ deconstruct_detail::do_postconstruct(ptr);
+ return shared;
}
- static void m_predestruct(const boost::predestructible *ptr)
+ template<typename T, typename D>
+ shared_ptr<T> deconstruct_ptr(T *ptr, D deleter)
{
- boost::predestructible *nonconst_ptr = const_cast<boost::predestructible*>(ptr);
- nonconst_ptr->predestruct();
+ shared_ptr<T> shared(ptr, deleter);
+ if(ptr == 0) return shared;
+ deconstruct_detail::do_postconstruct(ptr);
+ return shared;
}
- };
-
- template<typename T>
- shared_ptr<T> deconstruct_ptr(T *ptr)
- {
- if(ptr == 0) return shared_ptr<T>();
- shared_ptr<T> shared(ptr, boost::predestructing_deleter<T>());
- deconstruct_detail::do_postconstruct(ptr);
- return shared;
- }
- template<typename T, typename D>
- shared_ptr<T> deconstruct_ptr(T *ptr, D deleter)
- {
- if(ptr == 0) return shared_ptr<T>();
- shared_ptr<T> shared(ptr, deleter);
- deconstruct_detail::do_postconstruct(ptr);
- return shared;
}
}
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/signal_template.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/signal_template.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/signal_template.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -25,7 +25,7 @@
typename Group = int, \
typename GroupCompare = std::less<Group>, \
typename SlotFunction = BOOST_FUNCTION_N_DECL(BOOST_SIGNALS_NUM_ARGS), \
- typename ThreadingModel = signalslib::auto_threaded
+ typename ThreadingModel = signals2::auto_threaded
// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
#define BOOST_SIGNAL_TEMPLATE_DECL \
BOOST_SIGNAL_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS), \
@@ -41,7 +41,7 @@
namespace boost
{
- namespace signalslib
+ namespace signals2
{
namespace detail
{
@@ -55,7 +55,7 @@
slot_function_type> slot_type;
private:
class slot_invoker;
- typedef typename signalslib::detail::group_key<Group>::type group_key_type;
+ typedef typename group_key<Group>::type group_key_type;
typedef shared_ptr<ConnectionBody<group_key_type, slot_type, ThreadingModel> > connection_body_type;
typedef grouped_list<Group, GroupCompare, connection_body_type> connection_list_type;
public:
@@ -64,7 +64,7 @@
typedef typename combiner_type::result_type result_type;
typedef Group group_type;
typedef GroupCompare group_compare_type;
- typedef typename signalslib::detail::slot_call_iterator_t<slot_invoker,
+ typedef typename detail::slot_call_iterator_t<slot_invoker,
typename connection_list_type::iterator, ConnectionBody<group_key_type, slot_type, ThreadingModel> > slot_call_iterator;
BOOST_SIGNAL_IMPL_CLASS_NAME(const combiner_type &combiner,
@@ -73,41 +73,41 @@
_garbage_collector_it(_shared_state->connection_bodies.end())
{}
// connect slot
- signalslib::connection connect(const slot_type &slot, signalslib::connect_position position = signalslib::at_back)
+ connection connect(const slot_type &slot, connect_position position = at_back)
{
typename mutex_type::scoped_lock lock(_mutex);
connection_body_type newConnectionBody =
create_new_connection(slot);
group_key_type group_key;
- if(position == signalslib::at_back)
+ if(position == at_back)
{
- group_key.first = signalslib::detail::back_ungrouped_slots;
+ group_key.first = back_ungrouped_slots;
_shared_state->connection_bodies.push_back(group_key, newConnectionBody);
}else
{
- group_key.first = signalslib::detail::front_ungrouped_slots;
+ group_key.first = front_ungrouped_slots;
_shared_state->connection_bodies.push_front(group_key, newConnectionBody);
}
newConnectionBody->set_group_key(group_key);
- return signalslib::connection(newConnectionBody);
+ return connection(newConnectionBody);
}
- signalslib::connection connect(const group_type &group,
- const slot_type &slot, signalslib::connect_position position = signalslib::at_back)
+ connection connect(const group_type &group,
+ const slot_type &slot, connect_position position = at_back)
{
typename mutex_type::scoped_lock lock(_mutex);
connection_body_type newConnectionBody =
create_new_connection(slot);
// update map to first connection body in group if needed
- group_key_type group_key(signalslib::detail::grouped_slots, group);
+ group_key_type group_key(grouped_slots, group);
newConnectionBody->set_group_key(group_key);
- if(position == signalslib::at_back)
+ if(position == at_back)
{
_shared_state->connection_bodies.push_back(group_key, newConnectionBody);
}else // at_front
{
_shared_state->connection_bodies.push_front(group_key, newConnectionBody);
}
- return signalslib::connection(newConnectionBody);
+ return connection(newConnectionBody);
}
// disconnect slot(s)
void disconnect_all_slots()
@@ -125,7 +125,7 @@
{
shared_ptr<invocation_state> local_state =
get_readable_state();
- group_key_type group_key(signalslib::detail::grouped_slots, group);
+ group_key_type group_key(grouped_slots, group);
typename connection_list_type::iterator it;
typename connection_list_type::iterator end_it =
local_state->connection_bodies.upper_bound(group_key);
@@ -158,7 +158,7 @@
}
slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS_NUM_ARGS, \
(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS)), );
- optional<typename signalslib::detail::slot_result_type_wrapper<slot_result_type>::type > cache;
+ optional<typename slot_result_type_wrapper<slot_result_type>::type > cache;
return local_state->combiner(
slot_call_iterator(local_state->connection_bodies.begin(), local_state->connection_bodies.end(), invoker, cache),
slot_call_iterator(local_state->connection_bodies.end(), local_state->connection_bodies.end(), invoker, cache));
@@ -179,7 +179,7 @@
}
slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS_NUM_ARGS, \
(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS)), );
- optional<typename signalslib::detail::slot_result_type_wrapper<slot_result_type>::type > cache;
+ optional<typename slot_result_type_wrapper<slot_result_type>::type > cache;
return const_cast<const combiner_type&>(local_state->combiner)(
slot_call_iterator(local_state->connection_bodies.begin(), local_state->connection_bodies.end(), invoker, cache),
slot_call_iterator(local_state->connection_bodies.end(), local_state->connection_bodies.end(), invoker, cache));
@@ -229,7 +229,7 @@
class slot_invoker
{
public:
- typedef typename signalslib::detail::slot_result_type_wrapper<slot_result_type>::type result_type;
+ typedef typename slot_result_type_wrapper<slot_result_type>::type result_type;
slot_invoker(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS_NUM_ARGS, :, )
// argn ( argn ) ,
@@ -252,10 +252,10 @@
#undef BOOST_SIGNAL_MISC_STATEMENT
private:
result_type m_invoke(const connection_body_type &connectionBody,
- const signalslib::detail::unusable *) const
+ const unusable *) const
{
connectionBody->slot.slot_function()(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
- return signalslib::detail::unusable();
+ return unusable();
}
result_type m_invoke(const connection_body_type &connectionBody, ...) const
{
@@ -372,105 +372,102 @@
template<BOOST_SIGNAL_TEMPLATE_DECL>
class BOOST_WEAK_SIGNAL_CLASS_NAME;
}
- }
- template<BOOST_SIGNAL_TEMPLATE_DEFAULTED_DECL>
- class BOOST_SIGNAL_CLASS_NAME: public signalslib::signal_base
- {
- public:
- typedef signalslib::detail::BOOST_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
- friend class signalslib::detail::BOOST_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>;
-
- typedef SlotFunction slot_function_type;
- // typedef slotN<Signature, SlotFunction> slot_type;
- typedef BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)<BOOST_SIGNAL_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS_NUM_ARGS),
- slot_function_type> slot_type;
- typedef typename slot_function_type::result_type slot_result_type;
- typedef Combiner combiner_type;
- typedef typename combiner_type::result_type result_type;
- typedef Group group_type;
- typedef GroupCompare group_compare_type;
- typedef typename signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>::slot_call_iterator
- slot_call_iterator;
+ template<BOOST_SIGNAL_TEMPLATE_DEFAULTED_DECL>
+ class BOOST_SIGNAL_CLASS_NAME: public signal_base
+ {
+ public:
+ typedef detail::BOOST_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
+ friend class detail::BOOST_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>;
+
+ typedef SlotFunction slot_function_type;
+ // typedef slotN<Signature, SlotFunction> slot_type;
+ typedef BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)<BOOST_SIGNAL_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS_NUM_ARGS),
+ slot_function_type> slot_type;
+ typedef typename slot_function_type::result_type slot_result_type;
+ typedef Combiner combiner_type;
+ typedef typename combiner_type::result_type result_type;
+ typedef Group group_type;
+ typedef GroupCompare group_compare_type;
+ typedef typename detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>::slot_call_iterator
+ slot_call_iterator;
// typedef Tn argn_type;
#define BOOST_SIGNAL_MISC_STATEMENT(z, n, data) \
typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
- BOOST_PP_REPEAT(BOOST_SIGNALS_NUM_ARGS, BOOST_SIGNAL_MISC_STATEMENT, ~)
+ BOOST_PP_REPEAT(BOOST_SIGNALS_NUM_ARGS, BOOST_SIGNAL_MISC_STATEMENT, ~)
#undef BOOST_SIGNAL_MISC_STATEMENT
#if BOOST_SIGNALS_NUM_ARGS == 1
- typedef arg1_type argument_type;
+ typedef arg1_type argument_type;
#elif BOOST_SIGNALS_NUM_ARGS == 2
- typedef arg1_type first_argument_type;
- typedef arg2_type second_argument_type;
+ typedef arg1_type first_argument_type;
+ typedef arg2_type second_argument_type;
#endif
- BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS_NUM_ARGS);
+ BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS_NUM_ARGS);
- BOOST_SIGNAL_CLASS_NAME(const combiner_type &combiner = combiner_type(),
- const group_compare_type &group_compare = group_compare_type()):
- _pimpl(new signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>(combiner, group_compare))
- {};
- virtual ~BOOST_SIGNAL_CLASS_NAME()
- {
- disconnect_all_slots();
- }
- signalslib::connection connect(const slot_type &slot, signalslib::connect_position position = signalslib::at_back)
- {
- return (*_pimpl).connect(slot, position);
- }
- signalslib::connection connect(const group_type &group,
- const slot_type &slot, signalslib::connect_position position = signalslib::at_back)
- {
- return (*_pimpl).connect(group, slot, position);
- }
- void disconnect_all_slots()
- {
- (*_pimpl).disconnect_all_slots();
- }
- void disconnect(const group_type &group)
- {
- (*_pimpl).disconnect(group);
- }
- template <typename T>
- void disconnect(const T &slot)
- {
- (*_pimpl).disconnect(slot);
- }
- result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
- {
- return (*_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
- }
- result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
- {
- return (*_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
- }
- std::size_t num_slots() const
- {
- return (*_pimpl).num_slots();
- }
- bool empty() const
- {
- return (*_pimpl).empty();
- }
- combiner_type combiner() const
- {
- return (*_pimpl).combiner();
- }
- void set_combiner(const combiner_type &combiner)
- {
- return (*_pimpl).set_combiner(combiner);
- }
- protected:
- virtual shared_ptr<void> lock_pimpl() const
- {
- return _pimpl;
- }
- private:
- shared_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
- _pimpl;
- };
+ BOOST_SIGNAL_CLASS_NAME(const combiner_type &combiner = combiner_type(),
+ const group_compare_type &group_compare = group_compare_type()):
+ _pimpl(new detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION>(combiner, group_compare))
+ {};
+ virtual ~BOOST_SIGNAL_CLASS_NAME()
+ {
+ disconnect_all_slots();
+ }
+ connection connect(const slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect(slot, position);
+ }
+ connection connect(const group_type &group,
+ const slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect(group, slot, position);
+ }
+ void disconnect_all_slots()
+ {
+ (*_pimpl).disconnect_all_slots();
+ }
+ void disconnect(const group_type &group)
+ {
+ (*_pimpl).disconnect(group);
+ }
+ template <typename T>
+ void disconnect(const T &slot)
+ {
+ (*_pimpl).disconnect(slot);
+ }
+ result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
+ {
+ return (*_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
+ }
+ result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
+ {
+ return (*_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
+ }
+ std::size_t num_slots() const
+ {
+ return (*_pimpl).num_slots();
+ }
+ bool empty() const
+ {
+ return (*_pimpl).empty();
+ }
+ combiner_type combiner() const
+ {
+ return (*_pimpl).combiner();
+ }
+ void set_combiner(const combiner_type &combiner)
+ {
+ return (*_pimpl).set_combiner(combiner);
+ }
+ protected:
+ virtual shared_ptr<void> lock_pimpl() const
+ {
+ return _pimpl;
+ }
+ private:
+ shared_ptr<detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
+ _pimpl;
+ };
- namespace signalslib
- {
namespace detail
{
// wrapper class for storing other signals as slots with automatic lifetime tracking
@@ -489,20 +486,20 @@
{}
result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
{
- shared_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
shared_pimpl(_weak_pimpl.lock());
if(shared_pimpl == 0) throw expired_slot();
return (*shared_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
}
result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
{
- shared_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
shared_pimpl(_weak_pimpl.lock());
if(shared_pimpl == 0) throw expired_slot();
return (*shared_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
}
private:
- boost::weak_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
+ boost::weak_ptr<detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
_weak_pimpl;
};
@@ -521,9 +518,9 @@
Combiner, Group,
GroupCompare, SlotFunction, ThreadingModel> type;
};
- }
- }
-}
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
#undef BOOST_SIGNALS_NUM_ARGS
#undef BOOST_SIGNAL_CLASS_NAME
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/signals_common.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -14,7 +14,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/ref.hpp>
-#include <boost/thread_safe_signals/signal_base.hpp>
+#include <boost/signals2/signal_base.hpp>
#include <boost/type_traits.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
@@ -22,7 +22,7 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
namespace detail {
// The unusable class is a placeholder for unused function arguments
// It is also completely unusable except that it constructable from
@@ -66,7 +66,7 @@
signal_or_value>::type type;
};
} // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common_macros.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/signals_common_macros.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/signals_common_macros.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,7 +1,8 @@
/*
- Author: Frank Mori Hess <fmhess_at_[hidden]>
- Begin: 2007-01-23
+ Author: Frank Mori Hess <fmhess_at_[hidden]>
+ Begin: 2007-01-23
*/
+// Copyright Frank Mori Hess 2007-2008
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_call_iterator.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/slot_call_iterator.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_call_iterator.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,7 +1,7 @@
-// Boost.Signals library
+// Boost.Signals2 library
// Copyright Douglas Gregor 2001-2004.
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -17,8 +17,8 @@
#include <boost/iterator/iterator_facade.hpp>
#include <boost/optional.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/thread_safe_signals/connection.hpp>
-#include <boost/thread_safe_signals/slot_base.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/signals2/slot_base.hpp>
#include <boost/type_traits.hpp>
#include <boost/weak_ptr.hpp>
@@ -27,7 +27,7 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
namespace detail {
// Generates a slot call iterator. Essentially, this is an iterator that:
// - skips over disconnected slots in the underlying list
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_groups.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/slot_groups.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_groups.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,7 @@
-// Thread-safe signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007. Use, modification and
+// Copyright Frank Mori Hess 2007-2008.
+// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -10,7 +11,7 @@
#ifndef BOOST_TSS_SLOT_GROUPS_HEADER
#define BOOST_TSS_SLOT_GROUPS_HEADER
-#include <boost/thread_safe_signals/connection.hpp>
+#include <boost/signals2/connection.hpp>
#include <boost/optional.hpp>
#include <list>
#include <map>
@@ -21,7 +22,7 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
namespace detail {
enum slot_meta_group {front_ungrouped_slots, grouped_slots, back_ungrouped_slots};
template<typename Group>
@@ -226,7 +227,7 @@
};
} // end namespace detail
enum connect_position { at_back, at_front };
- } // end namespace signalslib
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_template.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/detail/slot_template.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/detail/slot_template.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Copyright Timmo Stange 2007.
// Copyright Douglas Gregor 2001-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
@@ -18,102 +18,103 @@
namespace boost
{
- template<typename Signature, typename SlotFunction> class slot;
-
- // 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::slot_base
+ namespace signals2
{
- public:
- template<BOOST_SIGNAL_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS, Other), typename OtherSlotFunction>
- friend class BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS);
-
- typedef SlotFunction slot_function_type;
- typedef R result_type;
-// typedef Tn argn_type;
-#define BOOST_SIGNAL_MISC_STATEMENT(z, n, data) \
- typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
- BOOST_PP_REPEAT(BOOST_SIGNALS_NUM_ARGS, BOOST_SIGNAL_MISC_STATEMENT, ~)
-#undef BOOST_SIGNAL_MISC_STATEMENT
-#if BOOST_SIGNALS_NUM_ARGS == 1
- typedef arg1_type argument_type;
-#elif BOOST_SIGNALS_NUM_ARGS == 2
- typedef arg1_type first_argument_type;
- typedef arg2_type second_argument_type;
-#endif
- BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS_NUM_ARGS);
+ template<typename Signature, typename SlotFunction> class slot;
- template<typename F>
- BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(const F& f): _slot_function(signalslib::detail::get_invocable_slot(f, signalslib::detail::tag_type(f)))
- {
- }
- // copy constructors
- 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::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::slot_base(other_slot), _slot_function(other_slot._slot_function)
- {
- }
- // bind syntactic sugar
-// ArgTypeN argN
-#define BOOST_SLOT_BINDING_ARG_DECL(z, n, data) \
- BOOST_PP_CAT(ArgType, n) BOOST_PP_CAT(arg, n)
-// template<typename Func, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slotN(...
-#define BOOST_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename Func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
- BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(Func func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, BOOST_SLOT_BINDING_ARG_DECL, ~)): \
- _slot_function(bind(func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, arg))) \
- {}
-#define BOOST_SLOT_MAX_BINDING_ARGS 10
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_SLOT_MAX_BINDING_ARGS, BOOST_SLOT_BINDING_CONSTRUCTOR, ~)
-#undef BOOST_SLOT_MAX_BINDING_ARGS
-#undef BOOST_SLOT_BINDING_ARG_DECL
-#undef BOOST_SLOT_BINDING_CONSTRUCTOR
- // invocation
- R operator()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
- {
- locked_container_type locked_objects = lock();
- return _slot_function(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
- }
- R operator()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
- {
- locked_container_type locked_objects = lock();
- return _slot_function(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
- }
- // tracking
- BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const weak_ptr<void> &tracked)
- {
- _trackedObjects.push_back(tracked);
- return *this;
- }
- BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const signalslib::signal_base &signal)
- {
- track_signal(signal);
- return *this;
- }
- 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)
+ // 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 slot_base
+ {
+ public:
+ template<BOOST_SIGNAL_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS_NUM_ARGS, Other), typename OtherSlotFunction>
+ friend class BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS);
+
+ typedef SlotFunction slot_function_type;
+ typedef R result_type;
+ // typedef Tn argn_type;
+ #define BOOST_SIGNAL_MISC_STATEMENT(z, n, data) \
+ typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
+ BOOST_PP_REPEAT(BOOST_SIGNALS_NUM_ARGS, BOOST_SIGNAL_MISC_STATEMENT, ~)
+ #undef BOOST_SIGNAL_MISC_STATEMENT
+ #if BOOST_SIGNALS_NUM_ARGS == 1
+ typedef arg1_type argument_type;
+ #elif BOOST_SIGNALS_NUM_ARGS == 2
+ typedef arg1_type first_argument_type;
+ typedef arg2_type second_argument_type;
+ #endif
+ BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS_NUM_ARGS);
+
+ template<typename F>
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(const F& f): _slot_function(detail::get_invocable_slot(f, detail::tag_type(f)))
{
- track(*it);
}
- return *this;
- }
+ // copy constructors
+ 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):
+ 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):
+ slot_base(other_slot), _slot_function(other_slot._slot_function)
+ {
+ }
+ // bind syntactic sugar
+ // ArgTypeN argN
+ #define BOOST_SLOT_BINDING_ARG_DECL(z, n, data) \
+ BOOST_PP_CAT(ArgType, n) BOOST_PP_CAT(arg, n)
+ // template<typename Func, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slotN(...
+ #define BOOST_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
+ template<typename Func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)(Func func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, BOOST_SLOT_BINDING_ARG_DECL, ~)): \
+ _slot_function(bind(func BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, arg))) \
+ {}
+ #define BOOST_SLOT_MAX_BINDING_ARGS 10
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_SLOT_MAX_BINDING_ARGS, BOOST_SLOT_BINDING_CONSTRUCTOR, ~)
+ #undef BOOST_SLOT_MAX_BINDING_ARGS
+ #undef BOOST_SLOT_BINDING_ARG_DECL
+ #undef BOOST_SLOT_BINDING_CONSTRUCTOR
+ // invocation
+ R operator()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
+ {
+ locked_container_type locked_objects = lock();
+ return _slot_function(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
+ }
+ R operator()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
+ {
+ locked_container_type locked_objects = lock();
+ return _slot_function(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
+ }
+ // tracking
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const weak_ptr<void> &tracked)
+ {
+ _trackedObjects.push_back(tracked);
+ return *this;
+ }
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const signal_base &signal)
+ {
+ track_signal(signal);
+ return *this;
+ }
+ BOOST_SLOT_CLASS_NAME(BOOST_SIGNALS_NUM_ARGS)& track(const slot_base &slot)
+ {
+ tracked_container_type::const_iterator it;
+ for(it = slot.tracked_objects().begin(); it != slot.tracked_objects().end(); ++it)
+ {
+ track(*it);
+ }
+ return *this;
+ }
+
+ const slot_function_type& slot_function() const {return _slot_function;}
+ slot_function_type& slot_function() {return _slot_function;}
+ private:
+ SlotFunction _slot_function;
+ };
- const slot_function_type& slot_function() const {return _slot_function;}
- slot_function_type& slot_function() {return _slot_function;}
- private:
- SlotFunction _slot_function;
- };
- namespace signalslib
- {
namespace detail
{
template<unsigned arity, typename Signature, typename SlotFunction>
@@ -128,7 +129,7 @@
SlotFunction> type;
};
}
- }
+ } // end namespace signals2
} // end namespace boost
#undef BOOST_SIGNALS_NUM_ARGS
Copied: sandbox/thread_safe_signals/trunk/boost/signals2/last_value.hpp (from r48926, /sandbox/thread_safe_signals/trunk/boost/last_value.hpp)
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/last_value.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/last_value.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -6,7 +6,7 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-// For more information, see http://www.boost.org/libs/signals
+// For more information, see http://www.boost.org
#ifndef BOOST_LAST_VALUE_HPP
#define BOOST_LAST_VALUE_HPP
@@ -16,80 +16,82 @@
#include <stdexcept>
namespace boost {
- class expired_slot;
- // no_slots_error is thrown when we are unable to generate a return value
- // due to no slots being connected to the signal.
- class no_slots_error: public std::exception
- {
- public:
- virtual const char* what() {return "boost::no_slots_error";}
- };
- namespace last_value_detail {
- template<typename T>
- T default_construct(const T *resolver)
+ namespace signals2 {
+ class expired_slot;
+ // no_slots_error is thrown when we are unable to generate a return value
+ // due to no slots being connected to the signal.
+ class no_slots_error: public std::exception
{
- throw no_slots_error();
+ public:
+ virtual const char* what() {return "boost::no_slots_error";}
+ };
+ namespace last_value_detail {
+ template<typename T>
+ T default_construct(const T *resolver)
+ {
+ throw no_slots_error();
+ }
+ template<typename T>
+ optional<T> default_construct(const optional<T> *resolver)
+ {
+ return optional<T>();
+ }
}
template<typename T>
- optional<T> default_construct(const optional<T> *resolver)
- {
- return optional<T>();
- }
- }
- template<typename T>
- struct last_value {
- typedef T result_type;
+ struct last_value {
+ typedef T result_type;
- template<typename InputIterator>
- T operator()(InputIterator first, InputIterator last) const
- {
- T * resolver = 0;
- if(first == last)
+ template<typename InputIterator>
+ T operator()(InputIterator first, InputIterator last) const
{
- return last_value_detail::default_construct(resolver);
- }
- optional<T> value;
- while (first != last)
- {
- try
+ T * resolver = 0;
+ if(first == last)
+ {
+ return last_value_detail::default_construct(resolver);
+ }
+ optional<T> value;
+ while (first != last)
{
- value = *first;
+ try
+ {
+ value = *first;
+ }
+ catch(const expired_slot &)
+ {}
+ ++first;
}
- catch(const expired_slot &)
- {}
- ++first;
+ if(value) return value.get();
+ return last_value_detail::default_construct(resolver);
}
- if(value) return value.get();
- return last_value_detail::default_construct(resolver);
- }
- };
+ };
- template<>
- class last_value<void> {
-#ifdef BOOST_NO_VOID_RETURNS
- struct unusable {};
- public:
- typedef unusable result_type;
-#else
- public:
- typedef void result_type;
-#endif // BOOST_NO_VOID_RETURNS
- template<typename InputIterator>
- result_type
- operator()(InputIterator first, InputIterator last) const
- {
- while (first != last)
+ template<>
+ class last_value<void> {
+ #ifdef BOOST_NO_VOID_RETURNS
+ struct unusable {};
+ public:
+ typedef unusable result_type;
+ #else
+ public:
+ typedef void result_type;
+ #endif // BOOST_NO_VOID_RETURNS
+ template<typename InputIterator>
+ result_type
+ operator()(InputIterator first, InputIterator last) const
{
- try
+ while (first != last)
{
- *first;
+ try
+ {
+ *first;
+ }
+ catch(const expired_slot &)
+ {}
+ ++first;
}
- catch(const expired_slot &)
- {}
- ++first;
+ return result_type();
}
- return result_type();
- }
- };
-}
+ };
+ } // namespace signals2
+} // namespace boost
#endif // BOOST_SIGNALS_LAST_VALUE_HPP
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/multi_threaded.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/multi_threaded.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/multi_threaded.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
// Boost.Signals library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -18,13 +18,13 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
class multi_threaded
{
public:
typedef mutex mutex_type;
};
- } // end namespace signalslib
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Copied: sandbox/thread_safe_signals/trunk/boost/signals2/postconstructible.hpp (from r48926, /sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp)
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/postconstructible.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/postconstructible.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,10 +1,12 @@
// A simple framework for creating objects with postconstructors.
-// The objects must inherit from boost::postconstructible, and
+// The objects must inherit from boost::signals2::postconstructible, and
// have their lifetimes managed by
-// boost::shared_ptr created with the boost::deconstruct_ptr()
+// boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
// function.
//
-// Author: Frank Mori Hess 2007. Use, modification and
+// Copyright Frank Mori Hess 2007-2008.
+//
+// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -18,21 +20,24 @@
namespace boost
{
- class postconstructible;
- namespace deconstruct_detail
+ namespace signals2
{
- void do_postconstruct(const boost::postconstructible *ptr);
+ class postconstructible;
+ namespace deconstruct_detail
+ {
+ void do_postconstruct(const boost::postconstructible *ptr);
+ }
+
+ class postconstructible
+ {
+ public:
+ friend void deconstruct_detail::do_postconstruct(const boost::postconstructible *ptr);
+ protected:
+ postconstructible() {}
+ virtual ~postconstructible() {}
+ virtual void postconstruct() {}
+ };
}
-
- class postconstructible
- {
- public:
- friend void deconstruct_detail::do_postconstruct(const boost::postconstructible *ptr);
- protected:
- postconstructible() {}
- virtual ~postconstructible() {}
- virtual void postconstruct() {}
- };
}
#ifdef BOOST_HAS_ABI_HEADERS
Copied: sandbox/thread_safe_signals/trunk/boost/signals2/predestructible.hpp (from r48926, /sandbox/thread_safe_signals/trunk/boost/predestructible.hpp)
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/predestructible.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/predestructible.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,10 +1,12 @@
// A simple framework for creating objects with predestructors.
-// The objects must inherit from boost::predestructible, and
+// The objects must inherit from boost::signals2::predestructible, and
// have their lifetimes managed by
-// boost::shared_ptr created with the boost::deconstruct_ptr()
+// boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
// function.
//
-// Author: Frank Mori Hess 2007. Use, modification and
+// Copyright Frank Mori Hess 2007-2008.
+//
+//Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -18,14 +20,17 @@
namespace boost
{
- class predestructible
+ namespace signals2
{
- public:
- virtual void predestruct() {}
- protected:
- predestructible() {}
- virtual ~predestructible() {}
- };
+ class predestructible
+ {
+ public:
+ virtual void predestruct() {}
+ protected:
+ predestructible() {}
+ virtual ~predestructible() {}
+ };
+ }
}
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/shared_connection_block.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/shared_connection_block.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/shared_connection_block.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -12,7 +12,7 @@
#define BOOST_SHARED_CONNECTION_BLOCK_HEADER
#include <boost/shared_ptr.hpp>
-#include <boost/thread_safe_signals/connection.hpp>
+#include <boost/signals2/connection.hpp>
#include <boost/weak_ptr.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
@@ -21,7 +21,7 @@
namespace boost
{
- namespace signalslib
+ namespace signals2
{
class shared_connection_block
{
Copied: sandbox/thread_safe_signals/trunk/boost/signals2/signal.hpp (from r48926, /sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp)
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/signal.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,9 +1,10 @@
/*
- A thread-safe (partial) implementation of boost.signals.
+ A thread-safe version of Boost.Signals.
- Author: Frank Mori Hess <fmhess_at_[hidden]>
- Begin: 2007-01-23
+ Author: Frank Mori Hess <fmhess_at_[hidden]>
+ Begin: 2007-01-23
*/
+// Copyright Frank Mori Hess 2007-2008
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -14,8 +15,6 @@
#ifndef _THREAD_SAFE_SIGNAL_HPP
#define _THREAD_SAFE_SIGNAL_HPP
-#define BOOST_SIGNALS_NAMESPACE signalslib
-
#include <algorithm>
#include <boost/assert.hpp>
#include <boost/config.hpp>
@@ -27,15 +26,15 @@
#include <boost/preprocessor/repetition.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/type_traits.hpp>
-#include <boost/thread_safe_signals/detail/signals_common.hpp>
-#include <boost/thread_safe_signals/detail/signals_common_macros.hpp>
-#include <boost/thread_safe_signals/detail/slot_groups.hpp>
-#include <boost/thread_safe_signals/detail/slot_call_iterator.hpp>
-#include <boost/thread_safe_signals/auto_threaded.hpp>
-#include <boost/thread_safe_signals/connection.hpp>
-#include <boost/thread_safe_signals/shared_connection_block.hpp>
-#include <boost/thread_safe_signals/single_threaded.hpp>
-#include <boost/thread_safe_signals/slot.hpp>
+#include <boost/signals2/detail/signals_common.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+#include <boost/signals2/detail/slot_groups.hpp>
+#include <boost/signals2/detail/slot_call_iterator.hpp>
+#include <boost/signals2/auto_threaded.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/signals2/shared_connection_block.hpp>
+#include <boost/signals2/single_threaded.hpp>
+#include <boost/signals2/slot.hpp>
#include <functional>
#ifdef BOOST_HAS_ABI_HEADERS
@@ -43,32 +42,31 @@
#endif
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS_MAX_ARGS)
-#define BOOST_PP_FILENAME_1 <boost/thread_safe_signals/detail/signal_template.hpp>
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/signal_template.hpp>
#include BOOST_PP_ITERATE()
namespace boost
{
-#ifndef signals
- // for backward compatibility
- namespace signals = signalslib;
-#endif
- template<typename Signature,
- typename Combiner = last_value<typename boost::function_traits<Signature>::result_type>,
- typename Group = int,
- typename GroupCompare = std::less<Group>,
- typename SlotFunction = function<Signature>,
- typename ThreadingModel = signalslib::auto_threaded >
- class signal: public signalslib::detail::signalN<function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type
+ namespace signals2
{
- private:
- typedef typename signalslib::detail::signalN<boost::function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type base_type;
- public:
- signal(const Combiner &combiner = Combiner(), const GroupCompare &group_compare = GroupCompare()):
- base_type(combiner, group_compare)
- {}
- };
+ template<typename Signature,
+ typename Combiner = last_value<typename boost::function_traits<Signature>::result_type>,
+ typename Group = int,
+ typename GroupCompare = std::less<Group>,
+ typename SlotFunction = function<Signature>,
+ typename ThreadingModel = auto_threaded >
+ class signal: public detail::signalN<function_traits<Signature>::arity,
+ Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type
+ {
+ private:
+ typedef typename detail::signalN<boost::function_traits<Signature>::arity,
+ Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type base_type;
+ public:
+ signal(const Combiner &combiner = Combiner(), const GroupCompare &group_compare = GroupCompare()):
+ base_type(combiner, group_compare)
+ {}
+ };
+ }
}
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/signal_base.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/signal_base.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/signal_base.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,7 +1,7 @@
-// Boost.Signals library
+// Boost.Signals2 library
// Copyright Douglas Gregor 2001-2004.
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -19,19 +19,19 @@
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
class slot_base;
class signal_base : public noncopyable
{
public:
- friend class boost::signalslib::slot_base;
+ friend class slot_base;
virtual ~signal_base() {}
protected:
virtual shared_ptr<void> lock_pimpl() const = 0;
};
- } // end namespace BOOST_SIGNALS_NAMESPACE
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/single_threaded.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/single_threaded.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/single_threaded.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -10,14 +10,12 @@
#ifndef BOOST_SIGNALS_SINGLE_THREADED_MODEL_HEADER
#define BOOST_SIGNALS_SINGLE_THREADED_MODEL_HEADER
-#include <boost/concept_check.hpp>
-
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
- namespace signalslib {
+ namespace signals2 {
namespace detail
{
class null_mutex;
@@ -25,9 +23,8 @@
class null_scoped_lock
{
public:
- null_scoped_lock(null_mutex &mutex)
+ null_scoped_lock(null_mutex &)
{
- boost::ignore_unused_variable_warning(mutex);
}
};
class null_mutex
@@ -42,7 +39,7 @@
public:
typedef detail::null_mutex mutex_type;
};
- } // end namespace signalslib
+ } // end namespace signals2
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/slot.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/slot.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/slot.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Copyright Timmo Stange 2007.
// Copyright Douglas Gregor 2001-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
@@ -16,9 +16,9 @@
#include <boost/function.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/ref.hpp>
-#include <boost/thread_safe_signals/detail/signals_common.hpp>
-#include <boost/thread_safe_signals/detail/signals_common_macros.hpp>
-#include <boost/thread_safe_signals/slot_base.hpp>
+#include <boost/signals2/detail/signals_common.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+#include <boost/signals2/slot_base.hpp>
#include <boost/type_traits.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/weak_ptr.hpp>
@@ -30,34 +30,34 @@
namespace boost
{
- namespace signalslib
+ namespace signals2
{
namespace detail
{
// Get the slot so that it can be copied
template<typename F>
typename F::weak_signal_type
- get_invocable_slot(const F &signal, signalslib::detail::signal_tag)
+ get_invocable_slot(const F &signal, signal_tag)
{ return typename F::weak_signal_type(signal); }
template<typename F>
const F&
- get_invocable_slot(const F& f, signalslib::detail::reference_tag)
+ get_invocable_slot(const F& f, reference_tag)
{ return f; }
template<typename F>
const F&
- get_invocable_slot(const F& f, signalslib::detail::value_tag)
+ get_invocable_slot(const F& f, value_tag)
{ return f; }
// Determines the type of the slot - is it a signal, a reference to a
// slot or just a normal slot.
template<typename F>
- typename signalslib::detail::get_slot_tag<F>::type
+ typename get_slot_tag<F>::type
tag_type(const F&)
{
- typedef typename signalslib::detail::get_slot_tag<F>::type
- the_tag_type;
+ typedef typename get_slot_tag<F>::type
+ the_tag_type;
the_tag_type tag = the_tag_type();
return tag;
}
@@ -66,39 +66,42 @@
} // end namespace boost
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS_MAX_ARGS)
-#define BOOST_PP_FILENAME_1 <boost/thread_safe_signals/detail/slot_template.hpp>
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/slot_template.hpp>
#include BOOST_PP_ITERATE()
namespace boost
{
- template<typename Signature,
- typename SlotFunction = boost::function<Signature> >
- class slot: public signalslib::detail::slotN<function_traits<Signature>::arity,
- Signature, SlotFunction>::type
+ namespace signals2
{
- private:
- typedef typename signalslib::detail::slotN<boost::function_traits<Signature>::arity,
- Signature, SlotFunction>::type base_type;
- public:
- template<typename F>
- slot(const F& f): base_type(f)
- {}
- // bind syntactic sugar
+ template<typename Signature,
+ typename SlotFunction = boost::function<Signature> >
+ class slot: public detail::slotN<function_traits<Signature>::arity,
+ Signature, SlotFunction>::type
+ {
+ private:
+ typedef typename detail::slotN<boost::function_traits<Signature>::arity,
+ Signature, SlotFunction>::type base_type;
+ public:
+ template<typename F>
+ slot(const F& f): base_type(f)
+ {}
+ // bind syntactic sugar
// AN aN
#define BOOST_SLOT_BINDING_ARG_DECL(z, n, data) \
BOOST_PP_CAT(A, n) BOOST_PP_CAT(a, n)
// template<typename F, typename A0, typename A1, ..., typename An-1> slot(...
#define BOOST_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename F, BOOST_PP_ENUM_PARAMS(n, typename A)> \
- slot(F f, BOOST_PP_ENUM(n, BOOST_SLOT_BINDING_ARG_DECL, ~)): \
- base_type(f, BOOST_PP_ENUM_PARAMS(n, a)) \
- {}
+ template<typename F, BOOST_PP_ENUM_PARAMS(n, typename A)> \
+ slot(F f, BOOST_PP_ENUM(n, BOOST_SLOT_BINDING_ARG_DECL, ~)): \
+ base_type(f, BOOST_PP_ENUM_PARAMS(n, a)) \
+ {}
#define BOOST_SLOT_MAX_BINDING_ARGS 10
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_SLOT_MAX_BINDING_ARGS, BOOST_SLOT_BINDING_CONSTRUCTOR, ~)
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_SLOT_MAX_BINDING_ARGS, BOOST_SLOT_BINDING_CONSTRUCTOR, ~)
#undef BOOST_SLOT_MAX_BINDING_ARGS
#undef BOOST_SLOT_BINDING_ARG_DECL
#undef BOOST_SLOT_BINDING_CONSTRUCTOR
- };
+ };
+ } // namespace signals2
}
#ifdef BOOST_HAS_ABI_HEADERS
Modified: sandbox/thread_safe_signals/trunk/boost/signals2/slot_base.hpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/boost/thread_safe_signals/slot_base.hpp (original)
+++ sandbox/thread_safe_signals/trunk/boost/signals2/slot_base.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,6 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Frank Mori Hess 2007.
+// Copyright Frank Mori Hess 2007-2008.
// Copyright Timmo Stange 2007.
// Copyright Douglas Gregor 2001-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
@@ -14,7 +14,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
-#include <boost/thread_safe_signals/signal_base.hpp>
+#include <boost/signals2/signal_base.hpp>
#include <vector>
#ifdef BOOST_HAS_ABI_HEADERS
@@ -23,17 +23,17 @@
namespace boost
{
- class expired_slot: public bad_weak_ptr
+ namespace signals2
{
- public:
- virtual char const * what() const throw()
+ class expired_slot: public bad_weak_ptr
{
- return "boost::expired_slot";
- }
- };
+ public:
+ virtual char const * what() const throw()
+ {
+ return "boost::expired_slot";
+ }
+ };
- namespace signalslib
- {
class slot_base
{
public:
@@ -68,7 +68,7 @@
return false;
}
protected:
- void track_signal(const signalslib::signal_base &signal)
+ void track_signal(const signal_base &signal)
{
_trackedObjects.push_back(signal.lock_pimpl());
}
Deleted: sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/boost/thread_safe_signal.hpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
+++ (empty file)
@@ -1,78 +0,0 @@
-/*
- A thread-safe (partial) implementation of boost.signals.
-
- Author: Frank Mori Hess <fmhess_at_[hidden]>
- Begin: 2007-01-23
-*/
-// Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef _THREAD_SAFE_SIGNAL_HPP
-#define _THREAD_SAFE_SIGNAL_HPP
-
-#define BOOST_SIGNALS_NAMESPACE signalslib
-
-#include <algorithm>
-#include <boost/assert.hpp>
-#include <boost/config.hpp>
-#include <boost/function.hpp>
-#include <boost/last_value.hpp>
-#include <boost/preprocessor/arithmetic.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/iteration.hpp>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/thread_safe_signals/detail/signals_common.hpp>
-#include <boost/thread_safe_signals/detail/signals_common_macros.hpp>
-#include <boost/thread_safe_signals/detail/slot_groups.hpp>
-#include <boost/thread_safe_signals/detail/slot_call_iterator.hpp>
-#include <boost/thread_safe_signals/auto_threaded.hpp>
-#include <boost/thread_safe_signals/connection.hpp>
-#include <boost/thread_safe_signals/shared_connection_block.hpp>
-#include <boost/thread_safe_signals/single_threaded.hpp>
-#include <boost/thread_safe_signals/slot.hpp>
-#include <functional>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-#define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS_MAX_ARGS)
-#define BOOST_PP_FILENAME_1 <boost/thread_safe_signals/detail/signal_template.hpp>
-#include BOOST_PP_ITERATE()
-
-namespace boost
-{
-#ifndef signals
- // for backward compatibility
- namespace signals = signalslib;
-#endif
- template<typename Signature,
- typename Combiner = last_value<typename boost::function_traits<Signature>::result_type>,
- typename Group = int,
- typename GroupCompare = std::less<Group>,
- typename SlotFunction = function<Signature>,
- typename ThreadingModel = signalslib::auto_threaded >
- class signal: public signalslib::detail::signalN<function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type
- {
- private:
- typedef typename signalslib::detail::signalN<boost::function_traits<Signature>::arity,
- Signature, Combiner, Group, GroupCompare, SlotFunction, ThreadingModel>::type base_type;
- public:
- signal(const Combiner &combiner = Combiner(), const GroupCompare &group_compare = GroupCompare()):
- base_type(combiner, group_compare)
- {}
- };
-}
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // _THREAD_SAFE_SIGNAL_HPP
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/dead_slot_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/dead_slot_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/dead_slot_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -9,10 +9,10 @@
#include <boost/shared_ptr.hpp>
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <boost/bind.hpp>
-typedef boost::signal1<int, int> sig_type;
+typedef boost::signals2::signal1<int, int> sig_type;
class with_constant {
public:
@@ -31,7 +31,7 @@
// Should invalidate the slot, so that we cannot connect to it
wc.reset();
- boost::BOOST_SIGNALS_NAMESPACE::connection c = sig.connect(slot);
+ boost::signals2::connection c = sig.connect(slot);
BOOST_CHECK(!c.connected());
}
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/deletion_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,6 +1,7 @@
-// Boost.Signals library
+// Boost.Signals2 library
-// Copyright Douglas Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-2003.
+// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -8,11 +9,11 @@
// For more information, see http://www.boost.org
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <iostream>
#include <string>
-static boost::BOOST_SIGNALS_NAMESPACE::connection connections[5];
+static boost::signals2::connection connections[5];
static std::string test_output;
@@ -39,7 +40,7 @@
static void
test_remove_self()
{
- boost::signal0<void> s0;
+ boost::signals2::signal0<void> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1));
@@ -95,7 +96,7 @@
std::cout << "Blocking 2" << std::endl;
{
- boost::BOOST_SIGNALS_NAMESPACE::shared_connection_block block(connections[2]);
+ boost::signals2::shared_connection_block block(connections[2]);
test_output = "";
s0(); std::cout << std::endl;
BOOST_CHECK(test_output == "13");
@@ -129,7 +130,7 @@
static void
test_remove_prior()
{
- boost::signal0<void> s0;
+ boost::signals2::signal0<void> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1, 0));
@@ -168,7 +169,7 @@
static void
test_remove_after()
{
- boost::signal0<void> s0;
+ boost::signals2::signal0<void> s0;
connections[0] = s0.connect(remove_connection(0, 1));
connections[1] = s0.connect(remove_connection(1));
@@ -207,7 +208,7 @@
static void
test_bloodbath()
{
- boost::signal0<void> s0;
+ boost::signals2::signal0<void> s0;
connections[0] = s0.connect(remove_connection(0, 1));
connections[1] = s0.connect(remove_connection(1, 1));
@@ -228,7 +229,7 @@
static void
test_disconnect_equal()
{
- boost::signal0<void> s0;
+ boost::signals2::signal0<void> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1));
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/invocation_benchmark.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/invocation_benchmark.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/invocation_benchmark.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,10 +1,10 @@
#include <cstdlib>
#include <iostream>
#include <boost/bind.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <boost/thread/thread.hpp>
-typedef boost::signal<void ()> signal_type;
+typedef boost::signals2::signal<void ()> signal_type;
void myslot()
{
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/ordering_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/ordering_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/ordering_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -1,4 +1,4 @@
-// Boost.Signals library
+// Boost.Signals2 library
// Copyright Douglas Gregor 2002-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
@@ -8,7 +8,7 @@
// For more information, see http://www.boost.org
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
@@ -68,7 +68,7 @@
std::vector<int> sortedValues;
- boost::signal0<void> sig;
+ boost::signals2::signal0<void> sig;
sig.connect(write_ungrouped1());
for (int i = 0; i < 100; ++i) {
#ifdef BOOST_NO_STDC_NAMESPACE
@@ -89,7 +89,7 @@
// 17 at beginning, 42 at end
sortedValues.insert(sortedValues.begin(), 17);
- sig.connect(emit_int(17), boost::BOOST_SIGNALS_NAMESPACE::at_front);
+ sig.connect(emit_int(17), boost::signals2::at_front);
sortedValues.push_back(42);
sig.connect(emit_int(42));
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/regression_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/regression_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/regression_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -11,9 +11,9 @@
// For more information, see http://www.boost.org
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
-typedef boost::signal0<void> sig0_type;
+typedef boost::signals2::signal0<void> sig0_type;
// combiner that returns the number of slots invoked
struct slot_counter {
@@ -56,7 +56,7 @@
sig.disconnect(&my_slot);
BOOST_CHECK(sig.num_slots() == 1);
/* 2008-03-11: checked iterator barfed on next line, due to bad semantics of copy construction
- for boost::signalslib::detail::grouped_list */
+ for boost::signals2::detail::grouped_list */
sig();
BOOST_CHECK(sig.num_slots() == 2);
}
@@ -64,10 +64,10 @@
/* 2008-03-10: we weren't disconnecting old connection in scoped_connection assignment operator */
void scoped_connection_test()
{
- typedef boost::signal0<void, slot_counter> signal_type;
+ typedef boost::signals2::signal0<void, slot_counter> signal_type;
signal_type sig;
{
- boost::signalslib::scoped_connection conn = sig.connect(&my_slot);
+ boost::signals2::scoped_connection conn = sig.connect(&my_slot);
BOOST_CHECK(sig() == 1);
conn = sig.connect(&my_slot);
BOOST_CHECK(sig() == 1);
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_n_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/signal_n_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_n_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -9,7 +9,7 @@
#include <boost/optional.hpp>
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <functional>
template<typename T>
@@ -65,12 +65,12 @@
make_int i62(62, 61);
{
- boost::signal0<int, max_or_default<int>, std::string> s0;
- boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
- boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect("72", i72);
- boost::BOOST_SIGNALS_NAMESPACE::connection c62 = s0.connect("6x", i62);
- boost::BOOST_SIGNALS_NAMESPACE::connection c42 = s0.connect(i42);
- boost::BOOST_SIGNALS_NAMESPACE::connection c37 = s0.connect(&get_37);
+ boost::signals2::signal0<int, max_or_default<int>, std::string> s0;
+ boost::signals2::connection c2 = s0.connect(i2);
+ boost::signals2::connection c72 = s0.connect("72", i72);
+ boost::signals2::connection c62 = s0.connect("6x", i62);
+ boost::signals2::connection c42 = s0.connect(i42);
+ boost::signals2::connection c37 = s0.connect(&get_37);
BOOST_CHECK(s0() == 72);
@@ -102,13 +102,13 @@
}
{
- boost::signal0<int, max_or_default<int> > s0;
- boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
- boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect(i72);
- boost::BOOST_SIGNALS_NAMESPACE::connection c62 = s0.connect(i62);
- boost::BOOST_SIGNALS_NAMESPACE::connection c42 = s0.connect(i42);
+ boost::signals2::signal0<int, max_or_default<int> > s0;
+ boost::signals2::connection c2 = s0.connect(i2);
+ boost::signals2::connection c72 = s0.connect(i72);
+ boost::signals2::connection c62 = s0.connect(i62);
+ boost::signals2::connection c42 = s0.connect(i42);
- const boost::signal0<int, max_or_default<int> >& cs0 = s0;
+ const boost::signals2::signal0<int, max_or_default<int> >& cs0 = s0;
BOOST_CHECK(cs0() == 72);
}
@@ -116,9 +116,9 @@
make_increasing_int<7> i7;
make_increasing_int<10> i10;
- boost::signal0<int, max_or_default<int> > s0;
- boost::BOOST_SIGNALS_NAMESPACE::connection c7 = s0.connect(i7);
- boost::BOOST_SIGNALS_NAMESPACE::connection c10 = s0.connect(i10);
+ boost::signals2::signal0<int, max_or_default<int> > s0;
+ boost::signals2::connection c7 = s0.connect(i7);
+ boost::signals2::connection c10 = s0.connect(i10);
BOOST_CHECK(s0() == 10);
BOOST_CHECK(s0() == 11);
@@ -128,7 +128,7 @@
static void
test_one_arg()
{
- boost::signal1<int, int, max_or_default<int> > s1;
+ boost::signals2::signal1<int, int, max_or_default<int> > s1;
s1.connect(std::negate<int>());
s1.connect(std::bind1st(std::multiplies<int>(), 2));
@@ -140,7 +140,7 @@
static void
test_signal_signal_connect()
{
- typedef boost::signal1<int, int, max_or_default<int> > signal_type;
+ typedef boost::signals2::signal1<int, int, max_or_default<int> > signal_type;
signal_type s1;
s1.connect(std::negate<int>());
@@ -176,10 +176,10 @@
test_ref()
{
EventCounter ec;
- boost::signal0<void> s;
+ boost::signals2::signal0<void> s;
{
- boost::BOOST_SIGNALS_NAMESPACE::scoped_connection c = s.connect(boost::ref(ec));
+ boost::signals2::scoped_connection c = s.connect(boost::ref(ec));
BOOST_CHECK(ec.count == 0);
s();
BOOST_CHECK(ec.count == 1);
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/signal_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/signal_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -9,7 +9,7 @@
#include <boost/optional.hpp>
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <functional>
#include <iostream>
@@ -65,13 +65,13 @@
make_int i62(62, 61);
{
- boost::signal<int (), max_or_default<int> > s0;
+ boost::signals2::signal<int (), max_or_default<int> > s0;
std::cout << "sizeof(signal) = " << sizeof(s0) << std::endl;
- boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
- boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect(72, i72);
- boost::BOOST_SIGNALS_NAMESPACE::connection c62 = s0.connect(60, i62);
- boost::BOOST_SIGNALS_NAMESPACE::connection c42 = s0.connect(i42);
+ boost::signals2::connection c2 = s0.connect(i2);
+ boost::signals2::connection c72 = s0.connect(72, i72);
+ boost::signals2::connection c62 = s0.connect(60, i62);
+ boost::signals2::connection c42 = s0.connect(i42);
BOOST_CHECK(s0() == 72);
@@ -100,13 +100,13 @@
}
{
- boost::signal<int (), max_or_default<int> > s0;
- boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
- boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect(i72);
- boost::BOOST_SIGNALS_NAMESPACE::connection c62 = s0.connect(i62);
- boost::BOOST_SIGNALS_NAMESPACE::connection c42 = s0.connect(i42);
+ boost::signals2::signal<int (), max_or_default<int> > s0;
+ boost::signals2::connection c2 = s0.connect(i2);
+ boost::signals2::connection c72 = s0.connect(i72);
+ boost::signals2::connection c62 = s0.connect(i62);
+ boost::signals2::connection c42 = s0.connect(i42);
- const boost::signal<int (), max_or_default<int> >& cs0 = s0;
+ const boost::signals2::signal<int (), max_or_default<int> >& cs0 = s0;
BOOST_CHECK(cs0() == 72);
}
@@ -114,9 +114,9 @@
make_increasing_int<7> i7;
make_increasing_int<10> i10;
- boost::signal<int (), max_or_default<int> > s0;
- boost::BOOST_SIGNALS_NAMESPACE::connection c7 = s0.connect(i7);
- boost::BOOST_SIGNALS_NAMESPACE::connection c10 = s0.connect(i10);
+ boost::signals2::signal<int (), max_or_default<int> > s0;
+ boost::signals2::connection c7 = s0.connect(i7);
+ boost::signals2::connection c10 = s0.connect(i10);
BOOST_CHECK(s0() == 10);
BOOST_CHECK(s0() == 11);
@@ -126,7 +126,7 @@
static void
test_one_arg()
{
- boost::signal<int (int value), max_or_default<int> > s1;
+ boost::signals2::signal<int (int value), max_or_default<int> > s1;
s1.connect(std::negate<int>());
s1.connect(std::bind1st(std::multiplies<int>(), 2));
@@ -138,7 +138,7 @@
static void
test_signal_signal_connect()
{
- typedef boost::signal<int (int value), max_or_default<int> > signal_type;
+ typedef boost::signals2::signal<int (int value), max_or_default<int> > signal_type;
signal_type s1;
s1.connect(std::negate<int>());
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/threading_models_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/threading_models_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/threading_models_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -10,9 +10,9 @@
// For more information, see http://www.boost.org
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
-#include <boost/thread_safe_signals/multi_threaded.hpp>
-#include <boost/thread_safe_signals/single_threaded.hpp>
+#include <boost/signals2.hpp>
+#include <boost/signals2/multi_threaded.hpp>
+#include <boost/signals2/single_threaded.hpp>
// combiner that returns the number of slots invoked
struct slot_counter {
@@ -52,11 +52,11 @@
int test_main(int, char*[])
{
- typedef boost::signal<void (), slot_counter, int, std::less<int>, boost::function<void ()>,
- boost::signalslib::multi_threaded> sig0_mt_type;
+ typedef boost::signals2::signal<void (), slot_counter, int, std::less<int>, boost::function<void ()>,
+ boost::signals2::multi_threaded> sig0_mt_type;
simple_test<sig0_mt_type>();
- typedef boost::signal<void (), slot_counter, int, std::less<int>, boost::function<void ()>,
- boost::signalslib::single_threaded> sig0_st_type;
+ typedef boost::signals2::signal<void (), slot_counter, int, std::less<int>, boost::function<void ()>,
+ boost::signals2::single_threaded> sig0_st_type;
simple_test<sig0_st_type>();
return 0;
}
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/track_test.cpp
==============================================================================
--- /sandbox/thread_safe_signals/trunk/libs/thread_safe_signals/test/track_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/track_test.cpp 2008-09-23 16:23:22 EDT (Tue, 23 Sep 2008)
@@ -13,7 +13,7 @@
#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/test/minimal.hpp>
-#include <boost/thread_safe_signal.hpp>
+#include <boost/signals2.hpp>
#include <boost/bind.hpp>
struct swallow {
@@ -42,7 +42,7 @@
max = value;
}
}
- catch(const boost::expired_slot &)
+ catch(const boost::signals2::expired_slot &)
{}
}
if(max) return *max;
@@ -58,9 +58,9 @@
int test_main(int, char*[])
{
- typedef boost::signal1<int, int, max_or_default<int> > sig_type;
+ typedef boost::signals2::signal1<int, int, max_or_default<int> > sig_type;
sig_type s1;
- boost::signalslib::connection connection;
+ boost::signals2::connection connection;
// Test auto-disconnection
BOOST_CHECK(s1(5) == 0);
@@ -89,7 +89,7 @@
// Test binding of a slot to another slot
{
boost::shared_ptr<int> shorty(new int(2));
- boost::slot<int (double)> other_slot(&myfunc, boost::cref(*shorty.get()), _1);
+ boost::signals2::slot<int (double)> other_slot(&myfunc, boost::cref(*shorty.get()), _1);
other_slot.track(shorty);
connection = s1.connect(sig_type::slot_type(other_slot, 0.5).track(other_slot));
BOOST_CHECK(s1(3) == 2);
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