|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53569 - in branches/release: boost/signals2 boost/signals2/detail libs/signals2/doc libs/signals2/doc/reference libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-06-02 10:18:36
Author: fmhess
Date: 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
New Revision: 53569
URL: http://svn.boost.org/trac/boost/changeset/53569
Log:
Merged Boost.Signals2 revisions r53132:53548 from trunk to release.
Added:
branches/release/boost/signals2/detail/preprocessed_arg_type.hpp
- copied unchanged from r53502, /trunk/boost/signals2/detail/preprocessed_arg_type.hpp
branches/release/boost/signals2/detail/preprocessed_arg_type_template.hpp
- copied unchanged from r53502, /trunk/boost/signals2/detail/preprocessed_arg_type_template.hpp
branches/release/boost/signals2/detail/replace_slot_function.hpp
- copied unchanged from r53502, /trunk/boost/signals2/detail/replace_slot_function.hpp
branches/release/boost/signals2/detail/variadic_arg_type.hpp
- copied unchanged from r53502, /trunk/boost/signals2/detail/variadic_arg_type.hpp
branches/release/boost/signals2/detail/variadic_slot_invoker.hpp
- copied unchanged from r53502, /trunk/boost/signals2/detail/variadic_slot_invoker.hpp
branches/release/boost/signals2/preprocessed_signal.hpp
- copied unchanged from r53502, /trunk/boost/signals2/preprocessed_signal.hpp
branches/release/boost/signals2/preprocessed_slot.hpp
- copied unchanged from r53502, /trunk/boost/signals2/preprocessed_slot.hpp
branches/release/boost/signals2/signal.hpp
- copied unchanged from r53502, /trunk/boost/signals2/signal.hpp
branches/release/boost/signals2/slot.hpp
- copied unchanged from r53502, /trunk/boost/signals2/slot.hpp
branches/release/boost/signals2/variadic_signal.hpp
- copied unchanged from r53502, /trunk/boost/signals2/variadic_signal.hpp
branches/release/boost/signals2/variadic_slot.hpp
- copied unchanged from r53502, /trunk/boost/signals2/variadic_slot.hpp
Text files modified:
branches/release/boost/signals2/connection.hpp | 1
branches/release/boost/signals2/deconstruct.hpp | 12
branches/release/boost/signals2/detail/result_type_wrapper.hpp | 25 ++
branches/release/boost/signals2/detail/signal_template.hpp | 289 ++++++++++++-----------
branches/release/boost/signals2/detail/signals_common.hpp | 30 ++
branches/release/boost/signals2/detail/signals_common_macros.hpp | 147 +++++++++++
branches/release/boost/signals2/detail/slot_call_iterator.hpp | 1
branches/release/boost/signals2/detail/slot_template.hpp | 48 +++
branches/release/boost/signals2/detail/tracked_objects_visitor.hpp | 4
branches/release/boost/signals2/last_value.hpp | 5
branches/release/boost/signals2/optional_last_value.hpp | 5
branches/release/boost/signals2/signal_base.hpp | 1
branches/release/libs/signals2/doc/examples.xml | 2
branches/release/libs/signals2/doc/faq.xml | 6
branches/release/libs/signals2/doc/porting.xml | 486 ++++++++++++++++++++++-----------------
branches/release/libs/signals2/doc/rationale.xml | 20
branches/release/libs/signals2/doc/reference/connection.xml | 40 +-
branches/release/libs/signals2/doc/reference/deconstruct.xml | 2
branches/release/libs/signals2/doc/reference/dummy_mutex.xml | 2
branches/release/libs/signals2/doc/reference/last_value.xml | 7
branches/release/libs/signals2/doc/reference/mutex.xml | 6
branches/release/libs/signals2/doc/reference/optional_last_value.xml | 10
branches/release/libs/signals2/doc/reference/shared_connection_block.xml | 6
branches/release/libs/signals2/doc/reference/signal_header.xml | 173 ++++---------
branches/release/libs/signals2/doc/reference/slot.xml | 186 ++++----------
branches/release/libs/signals2/doc/reference/slot_base.xml | 4
branches/release/libs/signals2/doc/reference/trackable.xml | 6
branches/release/libs/signals2/doc/tests.xml | 16 -
branches/release/libs/signals2/doc/thread_safety.xml | 10
branches/release/libs/signals2/doc/tutorial.xml | 272 +--------------------
branches/release/libs/signals2/test/connection_test.cpp | 2
branches/release/libs/signals2/test/dead_slot_test.cpp | 2
branches/release/libs/signals2/test/deletion_test.cpp | 10
branches/release/libs/signals2/test/ordering_test.cpp | 2
branches/release/libs/signals2/test/regression_test.cpp | 4
branches/release/libs/signals2/test/shared_connection_block_test.cpp | 2
branches/release/libs/signals2/test/signal_n_test.cpp | 13
branches/release/libs/signals2/test/signal_test.cpp | 55 ++++
branches/release/libs/signals2/test/signals_vs_signals2_benchmark.cpp | 5
branches/release/libs/signals2/test/slot_compile_test.cpp | 1
branches/release/libs/signals2/test/track_test.cpp | 3
branches/release/libs/signals2/test/trackable_test.cpp | 4
42 files changed, 961 insertions(+), 964 deletions(-)
Modified: branches/release/boost/signals2/connection.hpp
==============================================================================
--- branches/release/boost/signals2/connection.hpp (original)
+++ branches/release/boost/signals2/connection.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -21,7 +21,6 @@
#include <boost/signals2/detail/null_output_iterator.hpp>
#include <boost/signals2/detail/unique_lock.hpp>
#include <boost/signals2/slot.hpp>
-#include <boost/type_traits.hpp>
#include <boost/weak_ptr.hpp>
namespace boost
Modified: branches/release/boost/signals2/deconstruct.hpp
==============================================================================
--- branches/release/boost/signals2/deconstruct.hpp (original)
+++ branches/release/boost/signals2/deconstruct.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -44,7 +44,7 @@
namespace detail
{
-#if defined( BOOST_HAS_RVALUE_REFS )
+#if !defined(BOOST_NO_RVALUE_REFERENCES)
template< class T > T&& forward( T &&t )
{
return t;
@@ -71,7 +71,7 @@
}
return _sp;
}
-#if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
template<class... Args>
const shared_ptr<T>& postconstruct(Args && ... args)
{
@@ -83,7 +83,7 @@
}
return _sp;
}
-#else
+#else // !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
template<typename A1>
const shared_ptr<T>& postconstruct(const A1 &a1) const
{
@@ -191,7 +191,7 @@
}
return _sp;
}
-#endif // else defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
+#endif // !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
private:
friend class boost::signals2::deconstruct_access;
postconstructor_invoker(const shared_ptr<T> & sp):
@@ -292,7 +292,7 @@
}
-#if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
// Variadic templates, rvalue reference
@@ -480,7 +480,7 @@
return deconstruct_access::deconstruct<T>();
}
-#if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
// Variadic templates, rvalue reference
Modified: branches/release/boost/signals2/detail/result_type_wrapper.hpp
==============================================================================
--- branches/release/boost/signals2/detail/result_type_wrapper.hpp (original)
+++ branches/release/boost/signals2/detail/result_type_wrapper.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -40,6 +40,31 @@
typedef void_type type;
};
#endif
+
+ // specialization deals with possible void return from combiners
+ template<typename R> class combiner_invoker
+ {
+ public:
+ typedef R result_type;
+ template<typename Combiner, typename InputIterator>
+ result_type operator()(Combiner &combiner,
+ InputIterator first, InputIterator last) const
+ {
+ return combiner(first, last);
+ }
+ };
+ template<> class combiner_invoker<void>
+ {
+ public:
+ typedef result_type_wrapper<void>::type result_type;
+ template<typename Combiner, typename InputIterator>
+ result_type operator()(Combiner &combiner,
+ InputIterator first, InputIterator last) const
+ {
+ combiner(first, last);
+ return result_type();
+ }
+ };
} // end namespace detail
} // end namespace signals2
} // end namespace boost
Modified: branches/release/boost/signals2/detail/signal_template.hpp
==============================================================================
--- branches/release/boost/signals2/detail/signal_template.hpp (original)
+++ branches/release/boost/signals2/detail/signal_template.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -13,30 +13,12 @@
// This file is included iteratively, and should not be protected from multiple inclusion
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
-#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME BOOST_PP_CAT(signal, BOOST_SIGNALS2_NUM_ARGS)
-#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME)
-#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME, _impl)
-
-// typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
-#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL \
- BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Combiner = optional_last_value<R>, \
- typename Group = int, \
- typename GroupCompare = std::less<Group>, \
- typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Mutex = signals2::mutex
-// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
-#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL \
- BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS), \
- typename Combiner, \
- typename Group, \
- typename GroupCompare, \
- typename SlotFunction, \
- typename ExtendedSlotFunction, \
- typename Mutex
// R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex
#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION \
BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS), \
@@ -48,28 +30,16 @@
{
namespace detail
{
-// typename T1, typename T2, ..., typename TN
-#define BOOST_SIGNALS2_MISC_TEMPLATE_DECL \
- BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(BOOST_SIGNALS2_NUM_ARGS), typename T)
-// Tn & argn
-#define BOOST_SIGNALS2_FULL_REF_ARG(z, n, data) \
- BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
-// T1 & arg1, T2 & arg2, ..., Tn & argn
-#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) \
- BOOST_PP_ENUM(arity, BOOST_SIGNALS2_FULL_REF_ARG, ~)
-
// wrapper around an signalN::extended_slot_function which binds the
// connection argument so it looks like a normal
// signalN::slot_function
-// bound_extended_slot_functionN
-#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N BOOST_PP_CAT(bound_extended_slot_function, BOOST_SIGNALS2_NUM_ARGS)
template<typename ExtendedSlotFunction>
- class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N
+ class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)
{
public:
typedef typename result_type_wrapper<typename ExtendedSlotFunction::result_type>::type result_type;
- BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(const ExtendedSlotFunction &fun):
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)(const ExtendedSlotFunction &fun):
_fun(fun), _connection(new connection)
{}
void set_connection(const connection &conn)
@@ -78,23 +48,23 @@
}
#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
#endif // BOOST_SIGNALS2_NUM_ARGS > 0
result_type operator()(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
{
typename ExtendedSlotFunction::result_type *resolver = 0;
- return m_invoke(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)
- BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) resolver);
+ return m_invoke(resolver BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
// const overload
#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
#endif // BOOST_SIGNALS2_NUM_ARGS > 0
result_type operator()(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
{
typename ExtendedSlotFunction::result_type *resolver = 0;
- return m_invoke(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)
- BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) resolver);
+ return m_invoke(resolver BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
template<typename T>
bool operator==(const T &other) const
@@ -102,40 +72,42 @@
return _fun == other;
}
private:
- BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N()
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)()
{}
-#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
-#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) ...)
+ template<typename T BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type m_invoke(T* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
{
- return _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ return _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) const void*)
+ result_type m_invoke(void* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS))
{
- _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
return result_type();
}
// const overloads
-#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
-#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) ...) const
+ template<typename T BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type m_invoke(T* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
{
- return _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ return _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
#if BOOST_SIGNALS2_NUM_ARGS > 0
- template<BOOST_SIGNALS2_MISC_TEMPLATE_DECL>
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
#endif // BOOST_SIGNALS2_NUM_ARGS > 0
- result_type m_invoke(BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS) BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) const void*) const
+ result_type m_invoke(void* BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
{
- _fun(*_connection BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ _fun(*_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
return result_type();
}
@@ -144,40 +116,42 @@
boost::shared_ptr<connection> _connection;
};
-#undef BOOST_SIGNALS2_MISC_TEMPLATE_DECL
-#undef BOOST_SIGNALS2_FULL_REF_ARG
-#undef BOOST_SIGNALS2_FULL_REF_ARGS
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
{
public:
typedef SlotFunction slot_function_type;
// typedef slotN<Signature, SlotFunction> slot_type;
- typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
+ typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
slot_function_type> slot_type;
typedef ExtendedSlotFunction extended_slot_function_type;
- // typedef slotN<R, const connection &, T1, T2, ..., TN, extended_slot_function_type> extended_slot_type;
- typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(BOOST_SIGNALS2_NUM_ARGS))<
- BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
- extended_slot_function_type> extended_slot_type;
+ // typedef slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type> extended_slot_type;
+ typedef BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(BOOST_SIGNALS2_NUM_ARGS) extended_slot_type;
+ typedef typename nonvoid<typename slot_function_type::result_type>::type nonvoid_slot_result_type;
private:
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
class slot_invoker;
+#else // BOOST_NO_VARIADIC_TEMPLATES
+ typedef variadic_slot_invoker<nonvoid_slot_result_type, Args...> slot_invoker;
+#endif // BOOST_NO_VARIADIC_TEMPLATES
typedef typename group_key<Group>::type group_key_type;
typedef shared_ptr<connection_body<group_key_type, slot_type, Mutex> > connection_body_type;
typedef grouped_list<Group, GroupCompare, connection_body_type> connection_list_type;
- typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N<extended_slot_function_type>
+ typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)<extended_slot_function_type>
bound_extended_slot_function_type;
public:
- typedef typename nonvoid<typename slot_function_type::result_type>::type slot_result_type;
typedef Combiner combiner_type;
- typedef typename combiner_type::result_type result_type;
+ typedef typename result_type_wrapper<typename combiner_type::result_type>::type result_type;
typedef Group group_type;
typedef GroupCompare group_compare_type;
typedef typename detail::slot_call_iterator_t<slot_invoker,
typename connection_list_type::iterator, connection_body<group_key_type, slot_type, Mutex> > slot_call_iterator;
- BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(const combiner_type &combiner,
+ BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner,
const group_compare_type &group_compare):
_shared_state(new invocation_state(connection_list_type(group_compare), combiner)),
_garbage_collector_it(_shared_state->connection_bodies().end())
@@ -261,10 +235,9 @@
during invocation. */
local_state = _shared_state;
}
- slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, \
- (BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)), );
- slot_call_iterator_cache<slot_result_type, slot_invoker> cache(invoker);
- return local_state->combiner()(
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ slot_call_iterator_cache<nonvoid_slot_result_type, slot_invoker> cache(invoker);
+ return detail::combiner_invoker<typename combiner_type::result_type>()(local_state->combiner(),
slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
slot_call_iterator(local_state->connection_bodies().end(), local_state->connection_bodies().end(), cache));
}
@@ -282,10 +255,9 @@
during invocation. */
local_state = _shared_state;
}
- slot_invoker invoker BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, \
- (BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS)), );
- slot_call_iterator_cache<slot_result_type, slot_invoker> cache(invoker);
- return local_state->combiner()(
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ slot_call_iterator_cache<nonvoid_slot_result_type, slot_invoker> cache(invoker);
+ return detail::combiner_invoker<typename combiner_type::result_type>()(local_state->combiner(),
slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
slot_call_iterator(local_state->connection_bodies().end(), local_state->connection_bodies().end(), cache));
}
@@ -331,12 +303,21 @@
typedef Mutex mutex_type;
// slot_invoker is passed to slot_call_iterator_t to run slots
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
class slot_invoker
{
public:
- typedef slot_result_type result_type;
+ typedef nonvoid_slot_result_type result_type;
+// typename add_reference<Tn>::type argn
+#define BOOST_SIGNALS2_ADD_REF_ARG(z, n, data) \
+ typename add_reference<BOOST_PP_CAT(T, BOOST_PP_INC(n))>::type \
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// typename add_reference<T1>::type arg1, typename add_reference<T2>::type arg2, ..., typename add_reference<Tn>::type argn
+#define BOOST_SIGNALS2_ADD_REF_ARGS(arity) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_ADD_REF_ARG, ~)
+ slot_invoker(BOOST_SIGNALS2_ADD_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
+#undef BOOST_SIGNALS2_ADD_REF_ARGS
- slot_invoker(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
// argn ( argn ) ,
#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
BOOST_PP_CAT(arg, n) ( BOOST_PP_CAT(arg, n) )
@@ -350,12 +331,12 @@
return m_invoke(connectionBody,
resolver);
}
-// Tn argn;
-#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, Signature) \
- BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~);
- BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
-#undef BOOST_SIGNALS2_MISC_STATEMENT
private:
+#define BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT(z, n, data) \
+ BOOST_SIGNALS2_ADD_REF_ARG(z, n, data) ;
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT, ~)
+#undef BOOST_SIGNALS2_ADD_REF_ARG_STATEMENT
+#undef BOOST_SIGNALS2_ADD_REF_ARG
result_type m_invoke(const connection_body_type &connectionBody,
const void_type *) const
{
@@ -367,6 +348,7 @@
return connectionBody->slot.slot_function()(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
};
+#endif // BOOST_NO_VARIADIC_TEMPLATES
// a struct used to optimize (minimize) the number of shared_ptrs that need to be created
// inside operator()
class invocation_state
@@ -530,30 +512,43 @@
mutable mutex_type _mutex;
};
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME;
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
}
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL>
- class BOOST_SIGNALS2_SIGNAL_CLASS_NAME: public signal_base
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION: public signal_base,
+ public detail::BOOST_SIGNALS2_STD_FUNCTIONAL_BASE
+ (typename detail::result_type_wrapper<typename Combiner::result_type>::type)
{
- typedef detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> impl_class;
+ typedef detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> impl_class;
public:
- typedef detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
- friend class detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>;
+ typedef detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
+ friend class detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>;
typedef SlotFunction slot_function_type;
// typedef slotN<Signature, SlotFunction> slot_type;
typedef typename impl_class::slot_type slot_type;
typedef typename impl_class::extended_slot_function_type extended_slot_function_type;
typedef typename impl_class::extended_slot_type extended_slot_type;
- typedef typename impl_class::slot_result_type slot_result_type;
+ typedef typename slot_function_type::result_type slot_result_type;
typedef Combiner combiner_type;
- typedef typename combiner_type::result_type result_type;
+ typedef typename impl_class::result_type result_type;
typedef Group group_type;
typedef GroupCompare group_compare_type;
typedef typename impl_class::slot_call_iterator
slot_call_iterator;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
+
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
// typedef Tn argn_type;
#define BOOST_SIGNALS2_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);
@@ -565,13 +560,31 @@
typedef arg1_type first_argument_type;
typedef arg2_type second_argument_type;
#endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
- BOOST_SIGNALS2_SIGNAL_CLASS_NAME(const combiner_type &combiner = combiner_type(),
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner = combiner_type(),
const group_compare_type &group_compare = group_compare_type()):
_pimpl(new impl_class(combiner, group_compare))
{};
- virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME()
+ virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)()
{
disconnect_all_slots();
}
@@ -643,56 +656,50 @@
namespace detail
{
// wrapper class for storing other signals as slots with automatic lifetime tracking
- template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL>
- class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
{
public:
- typedef SlotFunction slot_function_type;
- typedef typename nonvoid<typename slot_function_type::result_type>::type slot_result_type;
- typedef typename BOOST_SIGNALS2_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>::result_type
+ typedef typename BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>::result_type
result_type;
- BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(const BOOST_SIGNALS2_SIGNAL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>
+ BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ (const BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>
&signal):
_weak_pimpl(signal._pimpl)
{}
result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
{
- shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
shared_pimpl(_weak_pimpl.lock());
if(shared_pimpl == 0) boost::throw_exception(expired_slot());
return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
{
- shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
shared_pimpl(_weak_pimpl.lock());
if(shared_pimpl == 0) boost::throw_exception(expired_slot());
return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
}
private:
- boost::weak_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
- _weak_pimpl;
- };
-
- template<unsigned arity, typename Signature, typename Combiner,
- typename Group, typename GroupCompare, typename SlotFunction,
- typename ExtendedSlotFunction, typename Mutex>
- class signalN;
- // partial template specialization
- template<typename Signature, typename Combiner, typename Group,
- typename GroupCompare, typename SlotFunction,
- typename ExtendedSlotFunction, typename Mutex>
- class signalN<BOOST_SIGNALS2_NUM_ARGS, Signature, Combiner, Group,
- GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>
- {
- public:
- typedef BOOST_SIGNALS2_SIGNAL_CLASS_NAME<
- BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
- Combiner, Group,
- GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> type;
+ boost::weak_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> > _weak_pimpl;
};
+#ifndef BOOST_NO_VARIADIC_TEMPLATES
+ template<int arity, typename Signature>
+ class extended_signature: public variadic_extended_signature<Signature>
+ {};
+#else // BOOST_NO_VARIADIC_TEMPLATES
template<int arity, typename Signature>
class extended_signature;
// partial template specialization
@@ -708,21 +715,35 @@
// typename function_traits<Signature>::argn_type)
#define BOOST_SIGNALS2_EXT_SIGNATURE(arity, Signature) \
typename function_traits<Signature>::result_type ( \
- const boost::signals2::connection & BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) \
+ const boost::signals2::connection & BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) \
BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature) )
typedef function<BOOST_SIGNALS2_EXT_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature)> function_type;
#undef BOOST_SIGNALS2_EXT_SIGNATURE
};
+ template<unsigned arity, typename Signature, typename Combiner,
+ typename Group, typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN;
+ // partial template specialization
+ template<typename Signature, typename Combiner, typename Group,
+ typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN<BOOST_SIGNALS2_NUM_ARGS, Signature, Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>
+ {
+ public:
+ typedef BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<
+ BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
+ Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> type;
+ };
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
} // namespace detail
} // namespace signals2
} // namespace boost
#undef BOOST_SIGNALS2_NUM_ARGS
-#undef BOOST_SIGNALS2_SIGNAL_CLASS_NAME
-#undef BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME
-#undef BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME
-#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL
-#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL
#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION
-#undef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N
Modified: branches/release/boost/signals2/detail/signals_common.hpp
==============================================================================
--- branches/release/boost/signals2/detail/signals_common.hpp (original)
+++ branches/release/boost/signals2/detail/signals_common.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -15,7 +15,7 @@
#include <boost/mpl/if.hpp>
#include <boost/ref.hpp>
#include <boost/signals2/signal_base.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/is_base_of.hpp>
namespace boost {
namespace signals2 {
@@ -42,6 +42,34 @@
reference_tag,
signal_or_value>::type type;
};
+
+ // Get the slot so that it can be copied
+ template<typename F>
+ typename F::weak_signal_type
+ 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, reference_tag)
+ { return f; }
+
+ template<typename F>
+ const F&
+ 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 get_slot_tag<F>::type
+ tag_type(const F&)
+ {
+ typedef typename get_slot_tag<F>::type
+ the_tag_type;
+ the_tag_type tag = the_tag_type();
+ return tag;
+ }
} // end namespace detail
} // end namespace signals2
} // end namespace boost
Modified: branches/release/boost/signals2/detail/signals_common_macros.hpp
==============================================================================
--- branches/release/boost/signals2/detail/signals_common_macros.hpp (original)
+++ branches/release/boost/signals2/detail/signals_common_macros.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,10 +11,20 @@
#ifndef BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
#define BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
+#include <boost/config.hpp>
+
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
#ifndef BOOST_SIGNALS2_MAX_ARGS
#define BOOST_SIGNALS2_MAX_ARGS 9
#endif
+// signaln
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(signal, arity)
+// weak_signaln
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity))
+// signaln_impl
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity), _impl)
// argn
#define BOOST_SIGNALS2_SIGNATURE_ARG_NAME(z, n, data) BOOST_PP_CAT(arg, BOOST_PP_INC(n))
// Tn argn
@@ -25,30 +35,48 @@
BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_FULL_ARG, ~)
// arg1, arg2, ..., argn
#define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_ARG_NAME, ~)
+// T1, T2, ..., TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
+// R (T1, T2, ..., TN)
+#define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) \
+ R ( BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) )
// typename prefixR, typename prefixT1, typename prefixT2, ..., typename prefixTN
#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) \
typename BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) \
BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
// typename R, typename T1, typename T2, ..., typename TN
#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity,)
+// typename prefixT1, typename prefixT2, ..., typename prefixTN
+#define BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity, prefix) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
+// typename T1, typename T2, ..., typename TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity,)
// prefixR, prefixT1, prefixT2, ..., prefixTN
#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) \
BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), BOOST_PP_CAT(prefix, T))
// R, T1, T2, ..., TN
#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) \
BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity,)
-// functionN<R, T1, T2, ..., TN>
-#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(function, arity)<\
+// boost::functionN<R, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, arity)<\
BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) >
// R, const boost::signals2::connection&, T1, T2, ..., TN
#define BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) \
R, const boost::signals2::connection& BOOST_PP_COMMA_IF(arity) \
BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
-// functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
-#define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(function, BOOST_PP_INC(arity))<\
+// boost::functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, BOOST_PP_INC(arity))<\
BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) >
// slotN
#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) BOOST_PP_CAT(slot, arity)
+// slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type>
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) \
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(arity))< \
+ BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity), \
+ extended_slot_function_type>
+// bound_extended_slot_functionN
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) BOOST_PP_CAT(bound_extended_slot_function, arity)
// typename function_traits<Signature>::argn_type
#define BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE(z, n, Signature) \
BOOST_PP_CAT(BOOST_PP_CAT(typename function_traits<Signature>::arg, BOOST_PP_INC(n)), _type)
@@ -60,5 +88,116 @@
#define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) \
typename function_traits<Signature>::result_type \
BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature)
+// prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG(z, n, prefix) \
+ BOOST_PP_CAT(BOOST_PP_CAT(prefix, T), BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// prefixT1 & arg1, prefixT2 & arg2, ..., prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity, prefix) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG, prefix)
+// T1 & arg1, T2 & arg2, ..., Tn & argn
+#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity,)
+// preprocessed_arg_typeN
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(arity) BOOST_PP_CAT(preprocessed_arg_type, arity)
+
+// typename R, typename T1, typename T2, ..., typename TN, typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner = optional_last_value<R>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(arity), \
+ typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity), \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity)
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
+
+#define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) std_functional_base
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) BOOST_PP_COMMA_IF(arity)
+
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) signal
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) weak_signal
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) signal_impl
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) typename Signature
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) Args...
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) R (Args...)
+#define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) R (Args...)
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) typename ... Args
+#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) Args & ... args
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) slot<R (const connection &, Args...), extended_slot_function_type>
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) bound_extended_slot_function
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) boost::function<Signature>
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) typename prefixSignature
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) prefixSignature
+#define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) Args ... args
+#define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) args...
+#define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) Signature
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
+
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename SlotFunction, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION \
+ <R (Args...), SlotFunction>
+
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ typename Signature, \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ typename Signature, \
+ typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = boost::function<Signature>, \
+ typename ExtendedSlotFunction = typename detail::variadic_extended_signature<Signature>::function_type, \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION <\
+ R (Args...), \
+ Combiner, \
+ Group, \
+ GroupCompare, \
+ SlotFunction, \
+ ExtendedSlotFunction, \
+ Mutex>
+
+#define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) \
+ std_functional_base<result_type , Args...>
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) ,
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
#endif // BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
Modified: branches/release/boost/signals2/detail/slot_call_iterator.hpp
==============================================================================
--- branches/release/boost/signals2/detail/slot_call_iterator.hpp (original)
+++ branches/release/boost/signals2/detail/slot_call_iterator.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -21,7 +21,6 @@
#include <boost/signals2/slot_base.hpp>
#include <boost/signals2/detail/stack_vector.hpp>
#include <boost/signals2/detail/unique_lock.hpp>
-#include <boost/type_traits.hpp>
#include <boost/weak_ptr.hpp>
namespace boost {
Modified: branches/release/boost/signals2/detail/slot_template.hpp
==============================================================================
--- branches/release/boost/signals2/detail/slot_template.hpp (original)
+++ branches/release/boost/signals2/detail/slot_template.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,7 +11,12 @@
// This file is included iteratively, and should not be protected from multiple inclusion
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
+
namespace boost
{
@@ -22,7 +27,12 @@
// slot class template.
template<BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS),
typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(BOOST_SIGNALS2_NUM_ARGS)>
- class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS): public slot_base
+ class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+ : public slot_base, public detail::BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(R)
+
{
public:
template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
@@ -30,6 +40,10 @@
typedef SlotFunction slot_function_type;
typedef R result_type;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
+
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+
// typedef Tn argn_type;
#define BOOST_SIGNALS2_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);
@@ -41,35 +55,47 @@
typedef arg1_type first_argument_type;
typedef arg2_type second_argument_type;
#endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
template<typename F>
BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const F& f)
{
init_slot_function(f);
}
// copy constructors
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS, Other), OtherSlotFunction> &other_slot):
slot_base(other_slot), _slot_function(other_slot._slot_function)
{
}
+#endif
template<typename Signature, typename OtherSlotFunction>
BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const slot<Signature, OtherSlotFunction> &other_slot):
slot_base(other_slot), _slot_function(other_slot._slot_function)
{
}
// bind syntactic sugar
-// template<typename Func, typename ArgType0, typename ArgType1, ..., typename ArgTypen-1> slotN(...
-#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR(z, n, data) \
- template<typename Func, BOOST_PP_ENUM_PARAMS(n, typename ArgType)> \
- BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const Func &func, BOOST_PP_ENUM(n, BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL, ~)) \
- { \
- init_slot_function(bind(func, BOOST_PP_ENUM_PARAMS(n, arg))); \
- }
- BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR, ~)
-#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR
+ BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS
// invocation
R operator()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
{
@@ -116,6 +142,7 @@
SlotFunction _slot_function;
};
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
namespace detail
{
template<unsigned arity, typename Signature, typename SlotFunction>
@@ -130,6 +157,7 @@
SlotFunction> type;
};
}
+#endif
} // end namespace signals2
} // end namespace boost
Modified: branches/release/boost/signals2/detail/tracked_objects_visitor.hpp
==============================================================================
--- branches/release/boost/signals2/detail/tracked_objects_visitor.hpp (original)
+++ branches/release/boost/signals2/detail/tracked_objects_visitor.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -17,7 +17,9 @@
#include <boost/signals2/detail/signals_common.hpp>
#include <boost/signals2/slot_base.hpp>
#include <boost/signals2/trackable.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
#include <boost/utility/addressof.hpp>
namespace boost
Modified: branches/release/boost/signals2/last_value.hpp
==============================================================================
--- branches/release/boost/signals2/last_value.hpp (original)
+++ branches/release/boost/signals2/last_value.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -12,7 +12,6 @@
#define BOOST_SIGNALS2_LAST_VALUE_HPP
#include <boost/optional.hpp>
-#include <boost/signals2/detail/result_type_wrapper.hpp>
#include <boost/throw_exception.hpp>
#include <stdexcept>
@@ -59,7 +58,7 @@
template<>
class last_value<void> {
public:
- typedef detail::result_type_wrapper<void>::type result_type;
+ typedef void result_type;
template<typename InputIterator>
result_type operator()(InputIterator first, InputIterator last) const
{
@@ -72,7 +71,7 @@
catch(const expired_slot &) {}
++first;
}
- return result_type();
+ return;
}
};
} // namespace signals2
Modified: branches/release/boost/signals2/optional_last_value.hpp
==============================================================================
--- branches/release/boost/signals2/optional_last_value.hpp (original)
+++ branches/release/boost/signals2/optional_last_value.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -12,7 +12,6 @@
#define BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
#include <boost/optional.hpp>
-#include <boost/signals2/detail/result_type_wrapper.hpp>
namespace boost {
namespace signals2 {
@@ -45,7 +44,7 @@
class optional_last_value<void>
{
public:
- typedef detail::result_type_wrapper<void>::type result_type;
+ typedef void result_type;
template<typename InputIterator>
result_type operator()(InputIterator first, InputIterator last) const
{
@@ -58,7 +57,7 @@
catch(const expired_slot &) {}
++first;
}
- return result_type();
+ return;
}
};
} // namespace signals2
Modified: branches/release/boost/signals2/signal_base.hpp
==============================================================================
--- branches/release/boost/signals2/signal_base.hpp (original)
+++ branches/release/boost/signals2/signal_base.hpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -12,6 +12,7 @@
#define BOOST_SIGNALS2_SIGNAL_BASE_HPP
#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
namespace boost {
namespace signals2 {
Modified: branches/release/libs/signals2/doc/examples.xml
==============================================================================
--- branches/release/libs/signals2/doc/examples.xml (original)
+++ branches/release/libs/signals2/doc/examples.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,8 +11,8 @@
<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.examples">
<title>Example programs</title>
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<section id="signals2.examples.misc">
<title>Miscellaneous Tutorial Examples</title>
Modified: branches/release/libs/signals2/doc/faq.xml
==============================================================================
--- branches/release/libs/signals2/doc/faq.xml (original)
+++ branches/release/libs/signals2/doc/faq.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,8 +11,8 @@
<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.faq">
<title>Frequently Asked Questions</title>
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<qandaset>
<qandaentry>
@@ -40,8 +40,8 @@
with signal invocation, you will need to use automatic connection management.
That is, the objects will need to be owned by
<classname>shared_ptr</classname> and passed to the slot's
- <methodname alt="slotN::track">track</methodname>() method before the slot is connected.
- The <classname>trackable</classname> scheme of automatic connection management
+ <methodname alt="signals2::slot::track">track</methodname>() method before the slot is connected.
+ The <classname>signals2::trackable</classname> scheme of automatic connection management
is NOT thread-safe, and is only provided to ease porting of single-threaded
code from Boost.Signals to Boost.Signals2.
</para>
Modified: branches/release/libs/signals2/doc/porting.xml
==============================================================================
--- branches/release/libs/signals2/doc/porting.xml (original)
+++ branches/release/libs/signals2/doc/porting.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -7,221 +7,283 @@
Distributed under 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)
-->
-<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.porting">
- <title>Porting from Boost.Signals to Boost.Signals2</title>
-
- <using-namespace name="boost"/>
+<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.api_changes">
+ <title>Signals2 API Changes</title>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
+ <section id="signals2.porting">
+ <title>Porting from Boost.Signals to Boost.Signals2</title>
+ <para>The changes made to the Boost.Signals2 API compared to the original Boost.Signals
+ library are summarized below. We also provide some notes on
+ dealing with each change while porting existing Boost.Signals code to Boost.Signals2.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>The namespace <code>boost::signals</code> has been replaced by <code>boost::signals2</code>
+ to avoid conflict with the original Boost.Signals implementation, as well as the Qt "signals" macro.
+ All the Boost.Signals2 classes are inside the <code>boost::signals2</code> namespace,
+ unlike the original Boost.Signals which has some classes in the <code>boost</code>
+ namespace in addition to its own <code>boost::signals</code> namespace.
+ </para>
+ <para>
+ The Boost.Signals2 header files are contained in the
+ <code>boost/signals2/</code> subdirectory instead of the <code>boost/signals</code>
+ subdirectory used by the original Boost.Signals. Furthermore, all the headers except
+ for the convenience header <code>boost/signals2.hpp</code> are inside the
+ <code>boost/signals2/</code> subdirectory, unlike the original Boost.Signals which
+ keeps a few headers in the parent <code>boost/</code> directory
+ in addition to its own <code>boost/signals/</code> subdirectory.
+ </para>
+ <para>
+ For example, the <code>signal</code> class is now
+ in the <code>boost::signals2</code> namespace instead of the
+ <code>boost</code> namespace,
+ and it's header file is now at <code>boost/signals2/signal.hpp</code> instead of
+ <code>boost/signal.hpp</code>.
+ </para>
+ <para>
+ While porting, only trivial changes to <code>#include</code> directives
+ and namespace qualifications should be required to deal with these changes.
+ Furthermore, the new namespace and header locations for Boost.Signals2
+ allow it to coexist in the same program with the original Boost.Signals library,
+ and porting can be performed piecemeal.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Automatic connection management is now achieved through the use of
+ <classname>shared_ptr</classname>/<classname>weak_ptr</classname>
+ and <methodname>signals2::slot::track</methodname>(), as described in the
+ <link linkend="signals2.tutorial.connection-management">tutorial</link>.
+ However, the old (thread-unsafe) Boost.Signals scheme of automatic connection management
+ is still supported via the <classname>boost::signals2::trackable</classname> class.
+ </para>
+ <para>
+ If you do not intend to make your program multi-threaded, the easiest porting path is to simply replace
+ your uses of <classname>boost::signals::trackable</classname> as a base class with
+ <classname>boost::signals2::trackable</classname>. Boost.Signals2 uses the same
+ <functionname>boost::visit_each</functionname> mechanism to discover
+ <code>trackable</code> objects
+ as used by the original Boost.Signals library.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Support for postconstructors (and predestructors) on objects managed by <classname>shared_ptr</classname>
+ has been added with
+ the <functionname>deconstruct</functionname> factory function.
+ This was motivated by the importance of
+ <code>shared_ptr</code> for the new connection tracking scheme, and the
+ inability to obtain a <code>shared_ptr</code> to an object in its constructor.
+ The use of <functionname>deconstruct</functionname> is described in the
+ <link linkend="signals2.tutorial.deconstruct">tutorial</link>.
+ </para>
+ <para>
+ The use of <functionname>deconstruct</functionname> is in no way required,
+ it is only provided in the hope
+ it may be useful. You may wish to use it if you are porting code where
+ a class creates connections to its own member functions in its constructor,
+ and you also
+ wish to use the new automatic connection management scheme. You could then
+ move the connection creation from the constructor to to the an
+ <code>adl_postconstruct</code> function, where
+ a reference to the owning <classname>shared_ptr</classname> is available for
+ passing to <methodname>signals2::slot::track</methodname>.
+ The <functionname>deconstruct</functionname> function would be used create objects
+ of the class and run their associated <code>adl_postconstruct</code> function.
+ You can enforce use of <functionname>deconstruct</functionname> by
+ making the class' constructors private and declaring
+ <classname>deconstruct_access</classname> a friend.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <classname>signals2::slot</classname> class takes a new <code>Signature</code> template parameter,
+ is useable as a function object, and has some additional features to support the
+ new Boost.Signals2 automatic connection management scheme.
+ </para>
+ <para>
+ The changes to the slot class should generally not cause any porting difficulties,
+ especially if you are using the <classname>boost::signals2::trackable</classname>
+ compatibility class mentioned above. If you are converting your code over to
+ use the new automatic connection management scheme, you will need to
+ employ some of the new slot features, as described in the
+ <link linkend="signals2.tutorial.connection-management">tutorial</link>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <classname>optional_last_value</classname> class has replaced <code>last_value</code>
+ as the default combiner for signals.
+ </para>
+ <para>
+ The <classname>signals2::last_value</classname> combiner is still provided, although its
+ behavior is slightly changed in that it
+ throws an exception when no slots are connected on signal invocation, instead of
+ always requiring at least one slot to be connected (except for its void specialization
+ which never required any slots to be connected).
+ </para>
+ <para>
+ If you are porting signals which have a <code>void</code> return type in their signature
+ and they use the default combiner, there are no changes required. If you are
+ using the default combiner with a non-void return type and care about the
+ value returned from signal invocation, you will have to take into account that
+ <classname>optional_last_value</classname> returns a
+ <classname>boost::optional</classname> instead of a plain value. One simple
+ way to deal with this is to use <code>boost::optional::operator*()</code> to access the
+ value wrapped inside the returned <classname>boost::optional</classname>.
+ </para>
+ <para>
+ Alternatively, you could do a port by specifying the <code>Combiner</code> template parameter
+ for your <code>signals2::signal</code> to be <classname>signals2::last_value</classname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <classname>signals2::signal</classname> class has an additional typedef
+ <classname>signals2::signal::extended_slot_type</classname>
+ and new <methodname>signals2::signal::connect_extended</methodname>()
+ methods. These allow connection of slots
+ which take an additional <classname>signals2::connection</classname> argument, giving them thread-safe
+ access to their signal/slot connection when they are invoked. There is also a
+ new <code>ExtendedSlotFunction</code> template parameter for specifying the underlying slot function
+ type for the new extended slots.
+ </para>
+ <para>
+ These additions should have no effect on porting unless you are also converting
+ your program from a single threaded program into a multi-threaded one. In that case,
+ if you have slots which need access to their <classname>signals2::connection</classname>
+ to the signal invoking them (for example to block or disconnect their connection)
+ you may wish to connect the slots with
+ <methodname>signals2::signal::connect_extended</methodname>().
+ This also requires adding an additional connection argument to the slot.
+ More information on how and why to use extended slots is available
+ in the <link linkend="signals2.tutorial.extended-slot-type">tutorial</link>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <classname>signals2::signal</classname> class has a new <code>Mutex</code> template parameter for specifying
+ the mutex type used internally by the signal and its connections.
+ </para>
+ <para>
+ The <code>Mutex</code> template parameter can be left to its default value of
+ <classname>boost::signals2::mutex</classname> and should have little effect on porting.
+ However, if you have a single-threaded program and are
+ concerned about incuring a performance overhead from unneeded mutex locking, you may
+ wish to use a different mutex for your signals such as <classname>dummy_mutex</classname>.
+ See the <link linkend="signals2.tutorial.signal-mutex-template-parameter">tutorial</link>
+ for more information on the <code>Mutex</code> parameter.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The <code>signal::combiner()</code> method, which formerly returned a reference to the
+ signal's combiner has been replaced by <methodname>signals2::signal::combiner</methodname>
+ (which now returns the combiner by value) and <methodname>signals2::signal::set_combiner</methodname>.
+ </para>
+ <para>
+ During porting it should be straightforward to replace uses of the old reference-returning
+ <code>signal::combiner()</code>
+ function with the new "by-value" <methodname>signals2::signal::combiner</methodname>
+ and <methodname>signals2::signal::set_combiner</methodname> functions.
+ However, you will need to inspect each call of the <code>combiner</code> method in your code
+ to determine if your program logic has been broken by the changed
+ return type.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Connections no longer have <code>block()</code> and <code>unblock()</code> methods. Blocking
+ of connections is now accomplished by creating <classname>shared_connection_block</classname> objects,
+ which provide RAII-style blocking.
+ </para>
+ <para>
+ If you have existing Boost.Signals code that blocks, for example:
+ </para>
+ <programlisting>
+ namespace bs = boost::signals;
- <para>The changes made to the Boost.Signals2 API compared to the original Boost.Signals
- library are summarized below. We also provide some notes on
- dealing with each change while porting existing Boost.Signals code to Boost.Signals2.
- </para>
- <itemizedlist>
- <listitem>
- <para>The namespace <code>boost::signals</code> has been replaced by <code>boost::signals2</code>
- to avoid conflict with the original Boost.Signals implementation, as well as the Qt "signals" macro.
- All the Boost.Signals2 classes are inside the <code>boost::signals2</code> namespace,
- unlike the original Boost.Signals which has some classes in the <code>boost</code>
- namespace in addition to its own <code>boost::signals</code> namespace.
- </para>
- <para>
- The Boost.Signals2 header files are contained in the
- <code>boost/signals2/</code> subdirectory instead of the <code>boost/signals</code>
- subdirectory used by the original Boost.Signals. Furthermore, all the headers except
- for the convenience header <code>boost/signals2.hpp</code> are inside the
- <code>boost/signals2/</code> subdirectory, unlike the original Boost.Signals which
- keeps a few headers in the parent <code>boost/</code> directory
- in addition to its own <code>boost/signals/</code> subdirectory.
- </para>
- <para>
- For example, the <code>signal</code> class is now
- in the <code>boost::signals2</code> namespace instead of the
- <code>boost</code> namespace,
- and it's header file is now at <code>boost/signals2/signal.hpp</code> instead of
- <code>boost/signal.hpp</code>.
- </para>
- <para>
- While porting, only trivial changes to <code>#include</code> directives
- and namespace qualifications should be required to deal with these changes.
- Furthermore, the new namespace and header locations for Boost.Signals2
- allow it to coexist in the same program with the original Boost.Signals library,
- and porting can be performed piecemeal.
- </para>
- </listitem>
- <listitem>
- <para>
- Automatic connection management is now achieved through the use of
- <classname>shared_ptr</classname>/<classname>weak_ptr</classname>
- and <methodname alt="slotN::track">slot::track</methodname>(), as described in the
- <link linkend="signals2.tutorial.connection-management">tutorial</link>.
- However, the old (thread-unsafe) Boost.Signals scheme of automatic connection management
- is still supported via the <classname>boost::signals2::trackable</classname> class.
- </para>
- <para>
- If you do not intend to make your program multi-threaded, the easiest porting path is to simply replace
- your uses of <classname>boost::signals::trackable</classname> as a base class with
- <classname>boost::signals2::trackable</classname>. Boost.Signals2 uses the same
- <functionname>boost::visit_each</functionname> mechanism to discover
- <classname>trackable</classname> objects
- as used by the original Boost.Signals library.
- </para>
- </listitem>
- <listitem>
- <para>Support for postconstructors (and predestructors) on objects managed by <classname>shared_ptr</classname>
- has been added with
- the <functionname>deconstruct</functionname> factory function.
- This was motivated by the importance of
- <code>shared_ptr</code> for the new connection tracking scheme, and the
- inability to obtain a <code>shared_ptr</code> to an object in its constructor.
- The use of <functionname>deconstruct</functionname> is described in the
- <link linkend="signals2.tutorial.deconstruct">tutorial</link>.
- </para>
- <para>
- The use of <functionname>deconstruct</functionname> is in no way required,
- it is only provided in the hope
- it may be useful. You may wish to use it if you are porting code where
- a class creates connections to its own member functions in its constructor,
- and you also
- wish to use the new automatic connection management scheme. You could then
- move the connection creation from the constructor to to the an
- <code>adl_postconstruct</code> function, where
- a reference to the owning <classname>shared_ptr</classname> is available for
- passing to <methodname alt="slotN::track">slot::track</methodname>.
- The <functionname>deconstruct</functionname> function would be used create objects
- of the class and run their associated <code>adl_postconstruct</code> function.
- You can enforce use of <functionname>deconstruct</functionname> by
- making the class' constructors private and declaring
- <classname>deconstruct_access</classname> a friend.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>slot</classname> class takes a new <code>Signature</code> template parameter,
- is useable as a function object, and has some additional features to support the
- new Boost.Signals2 automatic connection management scheme.
- </para>
- <para>
- The changes to the slot class should generally not cause any porting difficulties,
- especially if you are using the <classname>boost::signals2::trackable</classname>
- compatibility class mentioned above. If you are converting your code over to
- use the new automatic connection management scheme, you will need to
- employ some of the new slot features, as described in the
- <link linkend="signals2.tutorial.connection-management">tutorial</link>.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>optional_last_value</classname> class has replaced <classname>last_value</classname>
- as the default combiner for signals.
- </para>
- <para>
- The <classname>last_value</classname> combiner is still provided, although its
- behavior is slightly changed in that it
- throws an exception when no slots are connected on signal invocation, instead of
- always requiring at least one slot to be connected (except for its void specialization
- which never required any slots to be connected).
- </para>
- <para>
- If you are porting signals which have a <code>void</code> return type in their signature
- and they use the default combiner, there are no changes required. If you are
- using the default combiner with a non-void return type and care about the
- value returned from signal invocation, you will have to take into account that
- <classname>optional_last_value</classname> returns a
- <classname>boost::optional</classname> instead of a plain value. One simple
- way to deal with this is to use <code>boost::optional::operator*()</code> to access the
- value wrapped inside the returned <classname>boost::optional</classname>.
- </para>
- <para>
- Alternatively, you could do a port by specifying the <code>Combiner</code> template parameter
- for your <code>signals2::signal</code> to be <classname>last_value</classname>.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>signal</classname> class has an additional typedef
- <classname alt="signalN::extended_slot_type">signal::extended_slot_type</classname>
- and new <methodname alt="signalN::connect_extended">signal::connect_extended</methodname>()
- methods. These allow connection of slots
- which take an additional <classname>connection</classname> argument, giving them thread-safe
- access to their signal/slot connection when they are invoked. There is also a
- new <code>ExtendedSlotFunction</code> template parameter for specifying the underlying slot function
- type for the new extended slots.
- </para>
- <para>
- These additions should have no effect on porting unless you are also converting
- your program from a single threaded program into a multi-threaded one. In that case,
- if you have slots which need access to their <classname>connection</classname>
- to the signal invoking them (for example to block or disconnect their connection)
- you may wish to connect the slots with
- <methodname alt="signalN::connect_extended">signal::connect_extended</methodname>().
- This also requires adding an additional connection argument to the slot.
- More information on how and why to use extended slots is available
- in the <link linkend="signals2.tutorial.extended-slot-type">tutorial</link>.
- </para>
- </listitem>
- <listitem>
- <para>
- The <classname>signal</classname> class has a new <code>Mutex</code> template parameter for specifying
- the mutex type used internally by the signal and its connections.
- </para>
- <para>
- The <code>Mutex</code> template parameter can be left to its default value of
- <classname>boost::signals2::mutex</classname> and should have little effect on porting.
- However, if you have a single-threaded program and are
- concerned about incuring a performance overhead from unneeded mutex locking, you may
- wish to use a different mutex for your signals such as <classname>dummy_mutex</classname>.
- See the <link linkend="signals2.tutorial.signal-mutex-template-parameter">tutorial</link>
- for more information on the <code>Mutex</code> parameter.
- </para>
- </listitem>
- <listitem>
- <para>The <code>signal::combiner()</code> method, which formerly returned a reference to the
- signal's combiner has been replaced by <methodname alt="signalN::combiner">signal::combiner</methodname>
- (which now returns the combiner by value) and <methodname alt="signalN::set_combiner">signal::set_combiner</methodname>.
- </para>
- <para>
- During porting it should be straightforward to replace uses of the old reference-returning
- <code>signal::combiner()</code>
- function with the new "by-value" <methodname alt="signalN::combiner">signal::combiner</methodname>
- and <methodname alt="signalN::set_combiner">signal::set_combiner</methodname> functions.
- However, you will need to inspect each call of the <code>combiner</code> method in your code
- to determine if your program logic has been broken by the changed
- return type.
- </para>
- </listitem>
- <listitem>
- <para>Connections no longer have <code>block()</code> and <code>unblock()</code> methods. Blocking
- of connections is now accomplished by creating <classname>shared_connection_block</classname> objects,
- which provide RAII-style blocking.
- </para>
- <para>
- If you have existing Boost.Signals code that blocks, for example:
- </para>
- <programlisting>
-namespace bs = boost::signals;
-
-bs::connection my_connection;
-//...
+ bs::connection my_connection;
+ //...
-my_connection.block();
-do_something();
-my_connection.unblock();
-</programlisting>
- <para>
- then the version ported to Boost.Signals2 would look like:
- </para>
- <programlisting>
-namespace bs2 = boost::signals2;
+ my_connection.block();
+ do_something();
+ my_connection.unblock();
+ </programlisting>
+ <para>
+ then the version ported to Boost.Signals2 would look like:
+ </para>
+ <programlisting>
+ namespace bs2 = boost::signals2;
-bs2::connection my_connection;
-//...
+ bs2::connection my_connection;
+ //...
-{
- bs2::shared_connection_block blocker(my_connection);
- do_something();
-} // blocker goes out of scope here and releases its block on my_connection
-</programlisting>
- </listitem>
- </itemizedlist>
+ {
+ bs2::shared_connection_block blocker(my_connection);
+ do_something();
+ } // blocker goes out of scope here and releases its block on my_connection
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="signals2.api_history">
+ <title>Signals2 API Development</title>
+ <section id="signals2.api_history.1-40">
+ <title>Version 1.40</title>
+ <para>
+ Version 1.40 adds a few new features to the <classname>shared_connection_block</classname>
+ class to make it more flexible:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <classname>shared_connection_block</classname> is now default constructible.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ A <classname>shared_connection_block</classname> may now be constructed without
+ immediately blocking its connection.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <methodname>shared_connection_block::connection</methodname>() query has been
+ added, to provide access to the <code>shared_connection_block</code>s associated
+ connection.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>Version 1.40 also introduces a variadic templates implementation of
+ Signals2, which is used when Boost detects compiler support for variadic templates
+ (variadic templates are a new feature of C++0x).
+ This change is mostly transparent to the user, however it does introduce a few
+ visible tweaks to the interface as described in the following.
+ </para>
+ <para>
+ The following library features are
+ deprecated, and are only available if your compiler is NOT using
+ variadic templates (i.e. BOOST_NO_VARIADIC_TEMPLATES is defined
+ by Boost.Config).
+ <itemizedlist>
+ <listitem>
+ <para>
+ The "portable syntax" signal and slot classes, i.e. signals2::signal0, signal1, etc.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The arg1_type, arg2_type, etc. member typedefs in the <classname>signals2::signal</classname> and
+ <classname>signals2::slot</classname> classes. They are replaced by the
+ template member classes <classname>signals2::signal::arg</classname> and
+ <classname>signals2::slot::arg</classname>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section id="signals2.api_history.1-39">
+ <title>Version 1.39</title>
+ <para>Version 1.39 is the first release of Boost to include the Signals2 library.</para>
+ </section>
+ </section>
</section>
Modified: branches/release/libs/signals2/doc/rationale.xml
==============================================================================
--- branches/release/libs/signals2/doc/rationale.xml (original)
+++ branches/release/libs/signals2/doc/rationale.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,9 +11,9 @@
<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.rationale">
<title>Design Rationale</title>
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
- <using-class name="boost::signals2::signalN"/>
+ <using-namespace name="boost"/>
+ <using-class name="boost::signals2::signal"/>
<section>
<title>User-level Connection Management</title>
@@ -21,11 +21,11 @@
<para> Users need to have fine control over the connection of
signals to slots and their eventual disconnection. The primary approach
taken by Boost.Signals2 is to return a
- <code><classname>connection</classname></code> object that enables
+ <code><classname>signals2::connection</classname></code> object that enables
connected/disconnected query, manual disconnection, and an
- automatic disconnection on destruction mode (<classname>scoped_connection</classname>).
+ automatic disconnection on destruction mode (<classname>signals2::scoped_connection</classname>).
In addition, two other interfaces are supported by the
- <methodname alt="signalN::disconnect">signal::disconnect</methodname> overloaded method:</para>
+ <methodname alt="signal::disconnect">signal::disconnect</methodname> overloaded method:</para>
<itemizedlist>
<listitem>
@@ -71,7 +71,7 @@
<para> This type of interface is supported in Boost.Signals2
via the slot grouping mechanism, and the overload of
- <methodname alt="signalN::disconnect">signal::disconnect</methodname>
+ <methodname alt="signal::disconnect">signal::disconnect</methodname>
which takes an argument of the signal's <code>Group</code> type.</para>
</listitem>
</itemizedlist>
@@ -112,7 +112,7 @@
</para>
<para>The new connection management scheme has the advantage of being
non-intrusive. Objects of any type may be tracked using the
- <classname>shared_ptr/weak_ptr</classname> scheme. The old
+ <classname>shared_ptr</classname>/<classname>weak_ptr</classname> scheme. The old
<code><classname>boost::signals::trackable</classname></code>
scheme requires the tracked objects to be derived from the <code>trackable</code>
base class, which is not always practical when interacting
@@ -296,7 +296,7 @@
<code>+=</code> operation: should it be a reference to the
signal itself, to enable <code>sig += slot1 += slot2</code>,
or should it return a
- <code><classname>connection</classname></code> for the
+ <code><classname>signals2::connection</classname></code> for the
newly-created signal/slot connection?</para>
</listitem>
@@ -327,9 +327,7 @@
<classname>boost::signals2::mutex</classname> is simply that the <classname>boost::mutex</classname>
class provided by the Boost.Thread library currently requires linking to libboost_thread.
The <classname>boost::signals2::mutex</classname> class allows Signals2 to remain
- a header-only library. In the future, <classname>boost::signals2::mutex</classname>
- will probably be turned into a typedef to <classname>std::mutex</classname> when
- compiling in C++0x mode. You may still choose to use <classname>boost::mutex</classname>
+ a header-only library. You may still choose to use <classname>boost::mutex</classname>
if you wish, by specifying it as the <code>Mutex</code> template type for your signals.
</para>
<para>
Modified: branches/release/libs/signals2/doc/reference/connection.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/connection.xml (original)
+++ branches/release/libs/signals2/doc/reference/connection.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -16,7 +16,7 @@
<purpose>Query/disconnect a signal-slot connection.</purpose>
<description>
- <para>The <classname>connection</classname> class represents
+ <para>The <classname>signals2::connection</classname> class represents
a connection between a Signal and a Slot. It is a
lightweight object that has the ability to query whether the
signal and slot are currently connected, and to disconnect
@@ -43,7 +43,7 @@
<constructor>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<effects><para><computeroutput>this</computeroutput> references
@@ -55,7 +55,7 @@
<copy-assignment>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<effects><para><computeroutput>this</computeroutput> references
@@ -104,7 +104,7 @@
<method name="swap">
<type>void</type>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<effects><para>Swaps the connections referenced in
<computeroutput>this</computeroutput> and
@@ -118,7 +118,7 @@
<method name="operator==" cv="const">
<type>bool</type>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<returns><para><computeroutput>true</computeroutput> if
@@ -134,7 +134,7 @@
<method name="operator!=" cv="const">
<type>bool</type>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<returns><para><computeroutput>!(*this == other)</computeroutput></para></returns>
@@ -145,7 +145,7 @@
<method name="operator<" cv="const">
<type>bool</type>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<returns><para><computeroutput>true</computeroutput> if the
@@ -165,10 +165,10 @@
<function name="swap">
<type>void</type>
<parameter name="x">
- <paramtype><classname>connection</classname>&</paramtype>
+ <paramtype><classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<parameter name="y">
- <paramtype><classname>connection</classname>&</paramtype>
+ <paramtype><classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<effects><para><computeroutput>x.swap(y)</computeroutput></para></effects>
@@ -179,7 +179,7 @@
<class name="scoped_connection">
<inherit access="public">
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
</inherit>
<purpose>Limits a signal-slot connection lifetime to a particular scope.</purpose>
@@ -196,7 +196,7 @@
</constructor>
<constructor>
<parameter name="other">
- <paramtype>const <classname>connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::connection">connection</classname>&</paramtype>
</parameter>
<effects><para><computeroutput>this</computeroutput> references
@@ -233,7 +233,7 @@
</postconditions>
</method>
<method name="release">
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
<effects>
<para>
Releases the connection so it will not be disconnected by the <code>scoped_connection</code>
@@ -245,7 +245,7 @@
<para><code><methodname alt="connection::connected">connected</methodname>() == false</code></para>
</postconditions>
<returns>
- <para>A <classname>connection</classname> object referencing the connection which was
+ <para>A <classname alt="signals2::connection">connection</classname> object referencing the connection which was
released by the <code>scoped_connection</code>.
</para>
</returns>
@@ -255,29 +255,29 @@
<access name="private">
<constructor>
<parameter name="other">
- <paramtype>const <classname>scoped_connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::scoped_connection">scoped_connection</classname>&</paramtype>
</parameter>
<description>
- <para>The scoped_connection class is not copyable. It may only be constructed from a <classname>connection</classname> object.</para>
+ <para>The scoped_connection class is not copyable. It may only be constructed from a <classname alt="signals2::connection">connection</classname> object.</para>
</description>
</constructor>
<copy-assignment>
<parameter name="rhs">
- <paramtype>const <classname>scoped_connection</classname>&</paramtype>
+ <paramtype>const <classname alt="signals2::scoped_connection">scoped_connection</classname>&</paramtype>
</parameter>
<description>
- <para>The scoped_connection class is not copyable. It may only be assigned from a <classname>connection</classname> object.</para>
+ <para>The scoped_connection class is not copyable. It may only be assigned from a <classname alt="signals2::connection">connection</classname> object.</para>
</description>
</copy-assignment>
</access>
<description>
- <para>A <classname>connection</classname> which automatically disconnects on destruction.</para>
+ <para>A <classname alt="signals2::connection">connection</classname> which automatically disconnects on destruction.</para>
<section>
<title>Thread Safety</title>
<para>The methods of the <code>scoped_connection</code> class (including those
inherited from its base <code>connection</code> class) are thread-safe with the exception
- of <methodname>connection::swap</methodname>, <methodname>release</methodname>, and
- the assignment operator A <code>scoped_connection</code> object
+ of <methodname>signals2::connection::swap</methodname>, <methodname>release</methodname>, and
+ the assignment operator. A <code>scoped_connection</code> object
should not be accessed concurrently when any of these operations is in progress.
However, it is always safe to access a different <code>connection</code> object
in another thread, even if it references the same underlying signal-slot connection.
Modified: branches/release/libs/signals2/doc/reference/deconstruct.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/deconstruct.xml (original)
+++ branches/release/libs/signals2/doc/reference/deconstruct.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/deconstruct.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<namespace name="boost">
<namespace name="signals2">
<overloaded-function name="deconstruct">
Modified: branches/release/libs/signals2/doc/reference/dummy_mutex.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/dummy_mutex.xml (original)
+++ branches/release/libs/signals2/doc/reference/dummy_mutex.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/dummy_mutex.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<namespace name="boost">
<namespace name="signals2">
<class name="dummy_mutex">
Modified: branches/release/libs/signals2/doc/reference/last_value.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/last_value.xml (original)
+++ branches/release/libs/signals2/doc/reference/last_value.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -61,7 +61,7 @@
<purpose>Evaluate an InputIterator sequence.</purpose>
<typedef name="result_type">
- <type><emphasis>unspecified</emphasis></type>
+ <type>void</type>
</typedef>
<method-group name="invocation">
@@ -79,6 +79,9 @@
<effects><para>Attempts to dereference every iterator in the sequence <computeroutput>[first, last)</computeroutput>.
</para></effects>
+ <throws>
+ <para>Unlike the non-void versions of <code>last_value</code>, the void specialization does not throw.</para>
+ </throws>
</method>
</method-group>
</class-specialization>
@@ -86,7 +89,7 @@
<class name="no_slots_error">
<inherit access="public"><classname>std::exception</classname></inherit>
<purpose>Indicates a combiner was unable to synthesize a return value.</purpose>
- <description>The <code>no_slots_error</code> exception may be thrown by <classname>last_value</classname>
+ <description>The <code>no_slots_error</code> exception may be thrown by <classname>signals2::last_value</classname>
when it is run but unable to obtain any results from its input iterators.
</description>
<method name="what" cv="const" specifiers="virtual">
Modified: branches/release/libs/signals2/doc/reference/mutex.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/mutex.xml (original)
+++ branches/release/libs/signals2/doc/reference/mutex.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/mutex.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<namespace name="boost">
<namespace name="signals2">
<class name="mutex">
@@ -34,9 +34,9 @@
<classname>boost::mutex</classname> class instead as the mutex type for your signals.
</para>
<para>
- You may wish to use a thread-unsafe signal in a multi-threaded program, if
+ You may wish to use a thread-unsafe signal, if
the signal is only used by a single thread. In that case, you may prefer to
- use the <classname>dummy_mutex</classname> class as the <code>Mutex</code>
+ use the <classname>signals2::dummy_mutex</classname> class as the <code>Mutex</code>
template type for your signal.
</para>
</description>
Modified: branches/release/libs/signals2/doc/reference/optional_last_value.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/optional_last_value.xml (original)
+++ branches/release/libs/signals2/doc/reference/optional_last_value.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -23,7 +23,7 @@
<para>
<code>optional_last_value</code> is the default Combiner template type for signals in the
Boost.Signals2 library. The advantage of <code>optional_last_value</code> over
- <classname>last_value</classname> is that <code>optional_last_value</code>
+ <classname>signals2::last_value</classname> is that <code>optional_last_value</code>
can return an empty <classname>boost::optional</classname>. rather
than throwing an exception, when
its <code>InputIterator</code> sequence is empty.
@@ -66,17 +66,17 @@
<purpose>Evaluate an InputIterator sequence.</purpose>
<description>
- <para>This specialization of <classname>optional_last_value</classname> is provided
+ <para>This specialization of <classname>signals2::optional_last_value</classname> is provided
to cope with the fact that there is no such thing as an
<code><classname>optional</classname><void></code>, which
<classname>optional_last_value</classname> would otherwise try to
- use as its <code>result_type</code>. Therefore,
- this specialization leaves the <code>result_type</code> unspecified.
+ use as its <code>result_type</code>. This specialization
+ instead sets the <code>result_type</code> to be <code>void</code>.
</para>
</description>
<typedef name="result_type">
- <type><emphasis>unspecified</emphasis></type>
+ <type>void</type>
</typedef>
<method-group name="invocation">
Modified: branches/release/libs/signals2/doc/reference/shared_connection_block.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/shared_connection_block.xml (original)
+++ branches/release/libs/signals2/doc/reference/shared_connection_block.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/shared_connection_block.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<using-class name="boost::signals2::connection"/>
<namespace name="boost">
<namespace name="signals2">
@@ -26,7 +26,7 @@
its block when it is destroyed or its
<methodname>unblock</methodname> method is called.</para>
<para>A <code>shared_connection_block</code> is safe to use even
- after the <classname>connection</classname> object it was constructed
+ after the <classname>signals2::connection</classname> object it was constructed
from has been destroyed, or the connection it references has been
disconnected.</para>
<para>
@@ -138,4 +138,4 @@
</class>
</namespace>
</namespace>
-</header>
\ No newline at end of file
+</header>
Modified: branches/release/libs/signals2/doc/reference/signal_header.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/signal_header.xml (original)
+++ branches/release/libs/signals2/doc/reference/signal_header.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -9,23 +9,21 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/signal.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<namespace name="boost">
<namespace name="signals2">
<enum name="connect_position">
<enumvalue name="at_front"/>
<enumvalue name="at_back"/>
</enum>
- <class name="signalN">
+ <class name="signal">
<template>
- <template-type-parameter name="R"/>
- <template-type-parameter name="T1"/>
- <template-type-parameter name="T2"/>
- <template-varargs/>
- <template-type-parameter name="TN"/>
+ <template-type-parameter name="Signature">
+ <purpose>Function type R (T1, T2, ..., TN)</purpose>
+ </template-type-parameter>
<template-type-parameter name="Combiner">
- <default><classname>optional_last_value</classname><R></default>
+ <default><classname>boost::signals2::optional_last_value</classname><R></default>
</template-type-parameter>
<template-type-parameter name="Group">
<default>int</default>
@@ -34,31 +32,29 @@
<default><classname>std::less</classname><Group></default>
</template-type-parameter>
<template-type-parameter name="SlotFunction">
- <default><classname>functionN</classname><R, T1, T2, ..., TN></default>
+ <default><classname>boost::function</classname><Signature></default>
</template-type-parameter>
<template-type-parameter name="ExtendedSlotFunction">
- <default><classname>functionN</classname><R, const <classname>connection</classname> &, T1, T2, ..., TN></default>
+ <default><classname>boost::function</classname><R (const <classname alt="signals2::connection">connection</classname> &, T1, T2, ..., TN)></default>
</template-type-parameter>
<template-type-parameter name="Mutex">
- <default><classname>mutex</classname></default>
+ <default><classname>boost::signals2::mutex</classname></default>
</template-type-parameter>
</template>
<inherit access="public">
- <type><classname>signal_base</classname></type>
+ <type><classname>boost::signals2::signal_base</classname></type>
</inherit>
- <purpose>Set of safe multicast callback types.</purpose>
+ <purpose>Safe multicast callback.</purpose>
<description>
- <para>The class template <classname>signalN</classname> covers
- several related classes signal0, signal1, signal2, etc.,
- where the number suffix describes the number of function
- parameters the signal and its connected slots will
- take. Instead of enumerating all classes, a single pattern
- <classname>signalN</classname> will be described, where N
- represents the number of function parameters.</para>
+ <para>
+ See the <link linkend="signals2.tutorial">tutorial</link>
+ for more information on how to use the signal class.
+ </para>
</description>
+ <typedef name="signature_type"><type>Signature</type></typedef>
<typedef name="result_type">
<type>typename Combiner::result_type</type>
</typedef>
@@ -67,54 +63,66 @@
<typedef name="group_compare_type"><type>GroupCompare</type></typedef>
<typedef name="slot_function_type"><type>SlotFunction</type></typedef>
<typedef name="slot_type">
- <type>typename <classname>slotN</classname><R, T1, T2, ..., TN, SlotFunction></type>
+ <type>typename <classname>signals2::slot</classname><Signature, SlotFunction></type>
</typedef>
<typedef name="extended_slot_function_type"><type>ExtendedSlotFunction</type></typedef>
<typedef name="extended_slot_type">
- <type>typename <classname>slotN</classname><R, const <classname>connection</classname> &, T1, ..., TN, ExtendedSlotFunction></type>
+ <type>typename <classname>signals2::slot</classname><R (const <classname alt="signals2::connection">connection</classname> &, T1, ..., TN), ExtendedSlotFunction></type>
<description>
<para>Slots of the <code>extended_slot_type</code> may be connected to the signal using the
<methodname>connect_extended</methodname> methods. The <code>extended_slot_type</code>
- has an additional <classname>connection</classname> argument in its signature,
+ has an additional <classname>signals2::connection</classname> argument in its signature,
which gives slot functions access to their connection to the signal
invoking them.
</para>
</description>
</typedef>
<typedef name="slot_result_type">
- <type><emphasis>implementation-detail</emphasis></type>
+ <type>typename SlotFunction::result_type</type>
<description>
<para>
This is the type returned when dereferencing the input iterators passed to the signal's
- combiner. It is usually <code>slot_function_type::result_type</code> unless that
- type is <code>void</code>, in which case <code>slot_result_type</code> is
- unspecified.
+ combiner.
</para>
</description>
</typedef>
<typedef name="slot_call_iterator">
<type><emphasis>unspecified</emphasis></type>
+ <description>
+ <para>
+ The input iterator type passed to the combiner when the signal is invoked.
+ </para>
+ </description>
</typedef>
<typedef name="argument_type">
<type>T1</type>
- <purpose>If N == 1</purpose>
+ <purpose>Exists iff iff arity == 1</purpose>
</typedef>
<typedef name="first_argument_type">
<type>T1</type>
- <purpose>If N == 2</purpose>
+ <purpose>Exists iff iff arity == 2</purpose>
</typedef>
<typedef name="second_argument_type">
<type>T2</type>
- <purpose>If N == 2</purpose>
+ <purpose>Exists iff iff arity == 2</purpose>
</typedef>
- <typedef name="arg1_type"><type>T1</type></typedef>
- <typedef name="arg2_type"><type>T2</type></typedef>
- <typedef name="..."><type/></typedef>
- <typedef name="argN_type"><type>TN</type></typedef>
+
+ <class name="arg">
+ <template>
+ <template-nontype-parameter name="n">
+ <type>unsigned</type>
+ </template-nontype-parameter>
+ </template>
+ <typedef name="type">
+ <type>Tn</type>
+ <purpose>The type of the <classname alt="signals2::signal">signal</classname>'s (n+1)th argument</purpose>
+ </typedef>
+ </class>
<static-constant name="arity">
<type>int</type>
<default>N</default>
+ <purpose>The number of arguments taken by the signal.</purpose>
</static-constant>
<constructor>
@@ -139,7 +147,7 @@
<method-group name="connection management">
<overloaded-method name="connect">
<signature>
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
<parameter name="slot">
<paramtype>const slot_type&</paramtype>
</parameter>
@@ -150,7 +158,7 @@
</signature>
<signature>
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
<parameter name="group">
<paramtype>const group_type&</paramtype>
</parameter>
@@ -177,7 +185,7 @@
slots.</para></effects>
<returns><para>A
- <computeroutput><classname>connection</classname></computeroutput>
+ <computeroutput><classname>signals2::connection</classname></computeroutput>
object that references the newly-created connection between
the signal and the slot; if the slot is inactive, returns a
disconnected connection.</para></returns>
@@ -197,7 +205,7 @@
</overloaded-method>
<overloaded-method name="connect_extended">
<signature>
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
<parameter name="slot">
<paramtype>const extended_slot_type&</paramtype>
</parameter>
@@ -208,7 +216,7 @@
</signature>
<signature>
- <type><classname>connection</classname></type>
+ <type><classname alt="signals2::connection">connection</classname></type>
<parameter name="group">
<paramtype>const group_type&</paramtype>
</parameter>
@@ -225,7 +233,7 @@
The <code>connect_extended</code> methods work the same as the <methodname>connect</methodname>
methods, except they take slots of type <classname>extended_slot_type</classname>.
This is useful if a slot needs to access the connection between it and the
- signal invoking it, for example if it wishes to disconnect or block the connection.
+ signal invoking it, for example if it wishes to disconnect or block its own connection.
</para>
</description>
</overloaded-method>
@@ -254,9 +262,9 @@
are disconnected.
</para>
<para>Note, the <code>slot_func</code>
- argument should not be an actual <classname alt="slotN">signals2::slot</classname>
+ argument should not be an actual <classname>signals2::slot</classname>
object (which does not even support <code>operator==</code>), but rather
- the functor you wrapped inside a <classname alt="slotN">signals2::slot</classname>
+ the functor you wrapped inside a <classname>signals2::slot</classname>
when you initially made the connection.
</para></effects>
@@ -326,18 +334,18 @@
<overloaded-method name="operator()">
<signature>
<type>result_type</type>
- <parameter name="a1"><paramtype>arg1_type</paramtype></parameter>
- <parameter name="a2"><paramtype>arg2_type</paramtype></parameter>
+ <parameter name="a1"><paramtype>arg<0>::type</paramtype></parameter>
+ <parameter name="a2"><paramtype>arg<1>::type</paramtype></parameter>
<parameter><paramtype>...</paramtype></parameter>
- <parameter name="aN"><paramtype>argN_type</paramtype></parameter>
+ <parameter name="aN"><paramtype>arg<N-1>::type</paramtype></parameter>
</signature>
<signature cv="const">
<type>result_type</type>
- <parameter name="a1"><paramtype>arg1_type</paramtype></parameter>
- <parameter name="a2"><paramtype>arg2_type</paramtype></parameter>
+ <parameter name="a1"><paramtype>arg<0>::type</paramtype></parameter>
+ <parameter name="a2"><paramtype>arg<1>::type</paramtype></parameter>
<parameter><paramtype>...</paramtype></parameter>
- <parameter name="aN"><paramtype>argN_type</paramtype></parameter>
+ <parameter name="aN"><paramtype>arg<N-1>::type</paramtype></parameter>
</signature>
<effects><para>Invokes the combiner with a
@@ -369,7 +377,7 @@
non-<computeroutput>const</computeroutput> version will
invoke the combiner as
non-<computeroutput>const</computeroutput>.</para>
- </notes>
+ </notes>
</overloaded-method>
</method-group>
@@ -390,73 +398,6 @@
</method>
</method-group>
</class>
-
- <class name="signal">
- <template>
- <template-type-parameter name="Signature">
- <purpose>Function type R (T1, T2, ..., TN)</purpose>
- </template-type-parameter>
- <template-type-parameter name="Combiner">
- <default><classname>optional_last_value</classname><R></default>
- </template-type-parameter>
- <template-type-parameter name="Group">
- <default>int</default>
- </template-type-parameter>
- <template-type-parameter name="GroupCompare">
- <default><classname>std::less</classname><Group></default>
- </template-type-parameter>
- <template-type-parameter name="SlotFunction">
- <default><classname>function</classname><Signature></default>
- </template-type-parameter>
- <template-type-parameter name="ExtendedSlotFunction">
- <default><classname>function</classname><R (const <classname>connection</classname> &, T1, T2, ..., TN)></default>
- </template-type-parameter>
- <template-type-parameter name="Mutex">
- <default><classname>mutex</classname></default>
- </template-type-parameter>
- </template>
-
- <inherit access="public">
- <type><classname>signalN</classname><R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex></type>
- </inherit>
- <purpose>Safe multicast callback.</purpose>
-
- <description>
- <para>Class template <classname>signal</classname> is a thin
- wrapper around the numbered class templates <classname
- alt="signalN">signal0</classname>, <classname
- alt="signalN">signal1</classname>, etc. It accepts a function
- type with N arguments instead of N separate arguments, and
- derives from the appropriate <classname>signalN</classname>
- instantiation.</para>
-
- <para>All functionality of this class template is in its base
- class <classname>signalN</classname>.</para>
- <para>
- The large number of template parameters for the <code>signal</code> class
- can be an inconvenience. The
- the <classname>signal_type</classname> metafunction is provided to
- overcome this problem. It uses the Boost.Parameter library
- to permit specification of the <code>signal</code> class' template type parameters
- as named parameters.
- </para>
- </description>
-
- <constructor>
- <parameter name="combiner">
- <paramtype>const combiner_type&</paramtype>
- <default>combiner_type()</default>
- </parameter>
- <parameter name="compare">
- <paramtype>const group_compare_type&</paramtype>
- <default>group_compare_type()</default>
- </parameter>
-
- <effects><para>Initializes the base class with the given combiner
- and comparison objects.</para></effects>
- </constructor>
- <typedef name="signature_type"><type>Signature</type></typedef>
- </class>
</namespace>
</namespace>
</header>
Modified: branches/release/libs/signals2/doc/reference/slot.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/slot.xml (original)
+++ branches/release/libs/signals2/doc/reference/slot.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -9,36 +9,41 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/slot.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
- <using-class name="boost::signals2::signalN"/>
+ <using-namespace name="boost"/>
+ <using-class name="boost::signals2::signal"/>
<using-class name="boost::signals2::slot_base"/>
<namespace name="boost">
<namespace name="signals2">
- <class name="slotN">
+ <class name="slot">
<template>
- <template-type-parameter name="R"/>
- <template-type-parameter name="T1"/>
- <template-type-parameter name="T2"/>
- <template-varargs/>
- <template-type-parameter name="TN"/>
+ <template-type-parameter name="Signature">
+ <purpose>Function type R (T1, T2, ..., TN)</purpose>
+ </template-type-parameter>
<template-type-parameter name="SlotFunction">
- <default><classname>functionN</classname><R, T1, T2, ..., TN></default>
+ <default><classname>boost::function</classname><R (T1, T2, ..., TN)></default>
</template-type-parameter>
</template>
<inherit access="public">
- <type><classname>slot_base</classname></type>
+ <type><classname>boost::signals2::slot_base</classname></type>
</inherit>
<purpose>Pass slots as function arguments, and associate tracked objects with a slot.</purpose>
<description>
- <para>The class template <classname>slotN</classname> covers
- several related classes slot0, slot1, slot2, etc.,
- where the number suffix describes the number of function
- parameters the slot will
- take. Instead of enumerating all classes, a single pattern
- <classname>slotN</classname> will be described, where N
- represents the number of function parameters.</para>
+ <para>A slot consists of a polymorphic function wrapper (<classname>boost::function</classname> by default)
+ plus a container of <code>weak_ptr</code>s which identify the slot's "tracked objects". If any of the
+ tracked objects expire, the slot will automatically disable itself. That is, the slot's function
+ call operator will throw an exception instead of forwarding the function call to the slot's
+ polymorphic function wrapper. Additionally, a slot will automatically lock all the tracked objects
+ as <code>shared_ptr</code> during invocation, to prevent any of them from expiring while
+ the polymorphic function wrapper is being run.
+ </para>
+ <para>
+ The slot constructor will search for <classname>signals2::signal</classname> and
+ <classname>signals2::trackable</classname> inside incoming function objects and
+ automatically track them. It does so by applying a visitor
+ to the incoming functors with <functionname>boost::visit_each</functionname>.
+ </para>
</description>
<typedef name="result_type">
@@ -46,30 +51,42 @@
</typedef>
<typedef name="argument_type">
<type>T1</type>
- <purpose>If N == 1</purpose>
+ <purpose>Exists iff arity == 1</purpose>
</typedef>
<typedef name="first_argument_type">
<type>T1</type>
- <purpose>If N == 2</purpose>
+ <purpose>Exists iff arity == 2</purpose>
</typedef>
<typedef name="second_argument_type">
<type>T2</type>
- <purpose>If N == 2</purpose>
+ <purpose>Exists iff arity == 2</purpose>
+ </typedef>
+ <typedef name="signature_type">
+ <type>Signature</type>
</typedef>
- <typedef name="arg1_type"><type>T1</type></typedef>
- <typedef name="arg2_type"><type>T2</type></typedef>
- <typedef name="..."><type/></typedef>
- <typedef name="argN_type"><type>TN</type></typedef>
<typedef name="slot_function_type">
<type>SlotFunction</type>
</typedef>
+ <class name="arg">
+ <template>
+ <template-nontype-parameter name="n">
+ <type>unsigned</type>
+ </template-nontype-parameter>
+ </template>
+ <typedef name="type">
+ <type>Tn</type>
+ <purpose>The type of the <classname alt="signals2::slot">slot</classname>'s (n+1)th argument</purpose>
+ </typedef>
+ </class>
+
<static-constant name="arity">
<type>int</type>
<default>N</default>
+ <purpose>The number of arguments taken by the slot.</purpose>
</static-constant>
- <constructor>
+ <constructor>
<template>
<template-type-parameter name="Slot"/>
</template>
@@ -86,7 +103,7 @@
constructed.
</para>
<para>In this special case where the template type parameter <code>Slot</code> is
- a compatible <classname>signal</classname> or <classname>signalN</classname> type,
+ a compatible <classname>signals2::signal</classname> type,
the signal will automatically be added to the slot's tracked object list.
Otherwise, the slot's tracked object list is initially empty.
</para>
@@ -94,25 +111,6 @@
</constructor>
<constructor>
<template>
- <template-type-parameter name="OtherR"/>
- <template-type-parameter name="OtherT1"/>
- <template-type-parameter name="OtherT2"/>
- <template-varargs/>
- <template-type-parameter name="OtherTN"/>
- <template-type-parameter name="OtherSlotFunction"/>
- </template>
-
- <parameter name="other_slot">
- <paramtype>const slotN<OtherR, OtherT1, OtherT2, ..., OtherTN, OtherSlotFunction> &</paramtype>
- </parameter>
-
- <effects>
- <para>Initializes <code>this</code> with a copy of
- <code>other_slot</code>'s <code>SlotFunction</code> object and tracked object list.
- </para></effects>
- </constructor>
- <constructor>
- <template>
<template-type-parameter name="OtherSignature"/>
<template-type-parameter name="OtherSlotFunction"/>
</template>
@@ -154,7 +152,7 @@
<effects>
<para>Syntactic sugar for <code>bind()</code> when the constructor is passed more than
one argument. As if:
- <code>slotN(boost::bind(f, a1, a2, ..., aN))</code>
+ <code>slot(boost::bind(f, a1, a2, ..., aN))</code>
</para></effects>
</constructor>
@@ -162,18 +160,18 @@
<overloaded-method name="operator()">
<signature>
<type>result_type</type>
- <parameter name="a1"><paramtype>arg1_type</paramtype></parameter>
- <parameter name="a2"><paramtype>arg2_type</paramtype></parameter>
+ <parameter name="a1"><paramtype>arg<0>::type</paramtype></parameter>
+ <parameter name="a2"><paramtype>arg<1>::_type</paramtype></parameter>
<parameter><paramtype>...</paramtype></parameter>
- <parameter name="aN"><paramtype>argN_type</paramtype></parameter>
+ <parameter name="aN"><paramtype>arg<N-1>::type</paramtype></parameter>
</signature>
<signature cv="const">
<type>result_type</type>
- <parameter name="a1"><paramtype>arg1_type</paramtype></parameter>
- <parameter name="a2"><paramtype>arg2_type</paramtype></parameter>
+ <parameter name="a1"><paramtype>arg<0>::type</paramtype></parameter>
+ <parameter name="a2"><paramtype>arg<1>::_type</paramtype></parameter>
<parameter><paramtype>...</paramtype></parameter>
- <parameter name="aN"><paramtype>argN_type</paramtype></parameter>
+ <parameter name="aN"><paramtype>arg<N-1>::type</paramtype></parameter>
</signature>
<effects><para>Calls the slot's <code>SlotFunction</code> object.
@@ -196,28 +194,28 @@
<method-group name="tracking">
<overloaded-method name="track">
<signature>
- <type>slotN &</type>
+ <type>slot &</type>
<parameter name="tracked_object">
<paramtype>const weak_ptr<void> &</paramtype>
</parameter>
</signature>
<signature>
- <type>slotN &</type>
+ <type>slot &</type>
<parameter name="tracked_signal">
- <paramtype>const <classname>signal_base</classname> &</paramtype>
+ <paramtype>const <classname>signals2::signal_base</classname> &</paramtype>
</parameter>
</signature>
<signature>
- <type>slotN &</type>
+ <type>slot &</type>
<parameter name="tracked_slot">
- <paramtype>const <classname>slot_base</classname> &</paramtype>
+ <paramtype>const <classname>signals2::slot_base</classname> &</paramtype>
</parameter>
</signature>
<effects>
<para>
Adds object(s) to the slot's tracked object list. Should any of the
tracked objects expire, then subsequent attempts to call the slot's <code>operator()</code>
- or <code>lock()</code> methods will throw an <classname>expired_slot</classname> exception.
+ or <code>lock()</code> methods will throw an <classname>signals2::expired_slot</classname> exception.
</para>
<para>When tracking a signal, a <classname>shared_ptr</classname>
internal to the signal class is used for tracking. The signal does not
@@ -246,78 +244,6 @@
</overloaded-method>
</method-group>
</class>
-
- <class name="slot">
- <template>
- <template-type-parameter name="Signature">
- <purpose>Function type R (T1, T2, ..., TN)</purpose>
- </template-type-parameter>
- <template-type-parameter name="SlotFunction">
- <default><classname>function</classname><Signature></default>
- </template-type-parameter>
- </template>
-
- <inherit access="public"><classname>slotN</classname><R, T1, T2, ..., TN, SlotFunction></inherit>
- <purpose>Pass slots as function arguments, and associate tracked objects with a slot.</purpose>
-
- <description>
- <para>Class template <classname>slot</classname> is a thin
- wrapper around the numbered class templates <classname
- alt="slotN">slot0</classname>, <classname
- alt="slotN">slot1</classname>, etc. It accepts a function
- type with N arguments instead of N separate arguments, and
- derives from the appropriate <classname>slotN</classname>
- instantiation.</para>
-
- <para>All functionality of this class template is in its base
- class <classname>slotN</classname>.</para>
- </description>
-
- <constructor>
- <template>
- <template-type-parameter name="F"/>
- </template>
-
- <parameter name="f">
- <paramtype>const F &</paramtype>
- </parameter>
-
- <effects>
- <para>Passes argument to the base type <classname>slotN</classname> constructor.</para>
- </effects>
- </constructor>
- <constructor>
- <template>
- <template-type-parameter name="Func"/>
- <template-type-parameter name="Arg1"/>
- <template-type-parameter name="Arg2"/>
- <template-varargs/>
- <template-type-parameter name="ArgN"/>
- </template>
-
- <parameter name="f">
- <paramtype>const Func &</paramtype>
- </parameter>
- <parameter name="a1">
- <paramtype>const Arg1 &</paramtype>
- </parameter>
- <parameter name="a2">
- <paramtype>const Arg2 &</paramtype>
- </parameter>
- <parameter>
- <paramtype>...</paramtype>
- </parameter>
- <parameter name="aN">
- <paramtype>const ArgN &</paramtype>
- </parameter>
-
- <effects>
- <para>Syntactic sugar for <code>bind()</code> when the constructor is passed more than
- one argument. As if:
- <code>slot(boost::bind(f, a1, a2, ..., aN))</code>
- </para></effects>
- </constructor>
- </class>
</namespace>
</namespace>
</header>
Modified: branches/release/libs/signals2/doc/reference/slot_base.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/slot_base.xml (original)
+++ branches/release/libs/signals2/doc/reference/slot_base.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<header name="boost/signals2/slot_base.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<namespace name="boost">
<namespace name="signals2">
<class name="slot_base">
@@ -55,4 +55,4 @@
</class>
</namespace>
</namespace>
-</header>
\ No newline at end of file
+</header>
Modified: branches/release/libs/signals2/doc/reference/trackable.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/trackable.xml (original)
+++ branches/release/libs/signals2/doc/reference/trackable.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -20,9 +20,9 @@
for new code. The <code>trackable</code> class is not thread-safe
since <code>trackable</code> objects disconnect their associated
connections in the <code>trackable</code> destructor.
- The <code>trackable</code> destructor is not run until
+ Since the <code>trackable</code> destructor is not run until
after the destructors of any derived classes have completed,
- which leaves a window where a partially destructed
+ that leaves open a window where a partially destructed
object can still have active connections.
</para>
@@ -30,7 +30,7 @@
The preferred method of automatic connection management
with Boost.Signals2 is to manage the lifetime of
tracked objects with <code>shared_ptr</code>s and
- to use the <methodname alt="slotN::track">slot::track</methodname>
+ to use the <methodname>signals2::slot::track</methodname>
method to track their lifetimes.</para>
<para>The <code>trackable</code> class provides automatic
Modified: branches/release/libs/signals2/doc/tests.xml
==============================================================================
--- branches/release/libs/signals2/doc/tests.xml (original)
+++ branches/release/libs/signals2/doc/tests.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -21,7 +21,7 @@
<run-test filename="dead_slot_test.cpp">
<lib>../../../libs/test/build/boost_test_exec_monitor</lib>
<purpose>
-<para>Ensure that calling <methodname alt="boost::signals2::signalN::connect">connect</methodname> with a slot
+<para>Ensure that calling <methodname alt="boost::signals2::signal::connect">connect</methodname> with a slot
that has already expired does not actually
connect to the slot.</para>
</purpose>
@@ -53,26 +53,12 @@
to make sure they are fixed and stay fixed.</para></purpose>
</run-test>
- <run-test filename="signal_n_test.cpp">
- <lib>../../../libs/test/build/boost_test_exec_monitor</lib>
- <purpose>
-<para>Basic test of signal/slot connections and invocation using the
-<classname>boost::signals2::signalN</classname> class templates.</para>
- </purpose>
- </run-test>
-
<run-test filename="signal_test.cpp">
<lib>../../../libs/test/build/boost_test_exec_monitor</lib>
<purpose>
<para>Basic test of signal/slot connections and invocation using the
<classname>boost::signals2::signal</classname> class template.</para>
</purpose>
- <if-fails>
-<para>The <classname>boost::signals2::signal</classname> class template may not
-be usable on your compiler. However, the
-<classname>boost::signals2::signalN</classname> class templates may still be
-usable.</para>
- </if-fails>
</run-test>
<run-test filename="track_test.cpp">
Modified: branches/release/libs/signals2/doc/thread_safety.xml
==============================================================================
--- branches/release/libs/signals2/doc/thread_safety.xml (original)
+++ branches/release/libs/signals2/doc/thread_safety.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -10,8 +10,8 @@
<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.thread-safety">
<title>Thread-Safety</title>
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
+ <using-namespace name="boost"/>
<section>
<title>Introduction</title>
@@ -24,7 +24,7 @@
relying on <classname>shared_ptr</classname> and <classname>weak_ptr</classname>,
as described in the <link linkend="signals2.tutorial.connection-management">tutorial</link>.
The second change was the introduction of a <code>Mutex</code> template type
- parameter to the <classname>signal</classname> class. This section details how
+ parameter to the <classname alt="signals2::signal">signal</classname> class. This section details how
the library employs these changes to provide thread-safety, and
the limits of the provided thread-safety.
</para>
@@ -42,7 +42,7 @@
signal's methods are called. The mutex is usually held until the
method completes, however there is one major exception to this rule. When
a signal is invoked by calling
- <methodname alt="signalN::operator()">signal::operator()</methodname>,
+ <methodname alt="signal::operator()">signal::operator()</methodname>,
the invocation first acquires a lock on the signal's mutex. Then
it obtains a handle to the signal's slot list and combiner. Next
it releases the signal's mutex, before invoking the combiner to
@@ -112,7 +112,7 @@
Future signal invocations will receive a handle to the newly created deep
copy of the slot list, and the old slot list will be destroyed once it
is no longer in use. Similarly, if you change a signal's combiner with
- <methodname alt="signalN::set_combiner">signal::set_combiner</methodname>
+ <methodname alt="signal::set_combiner">signal::set_combiner</methodname>
while a signal invocation is running concurrently, the concurrent
signal invocation will continue to use the old combiner undisturbed,
while future signal invocations will receive a handle to the new combiner.
@@ -175,7 +175,7 @@
objects are copies and refer to the same underlying connection.
</para>
<para>
- The <classname alt="slotN">slot</classname> class has no internal mutex locking
+ The <classname>signals2::slot</classname> class has no internal mutex locking
built into it. It is expected that slot objects will be created then
connected to a signal in a single thread. Once they have been copied into
a signal's slot list, they are protected by the mutex associated with
Modified: branches/release/libs/signals2/doc/tutorial.xml
==============================================================================
--- branches/release/libs/signals2/doc/tutorial.xml (original)
+++ branches/release/libs/signals2/doc/tutorial.xml 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -11,10 +11,10 @@
<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.tutorial">
<title>Tutorial</title>
- <using-namespace name="boost"/>
<using-namespace name="boost::signals2"/>
- <using-class name="boost::signals2::signalN"/>
- <using-class name="boost::signals2::slotN"/>
+ <using-namespace name="boost"/>
+ <using-class name="boost::signals2::signal"/>
+ <using-class name="boost::signals2::slot"/>
<section>
<title>How to Read this Tutorial</title>
@@ -36,19 +36,6 @@
will not need to read the <emphasis>Advanced</emphasis> sections.</para>
</section>
-<section><title>Compatibility Note</title>
-
-<para>Boost.Signals2 has two syntactical forms: the preferred form and
-the compatibility form. The preferred form fits more closely with the
-C++ language and reduces the number of separate template parameters
-that need to be considered, often improving readability; however, the
-preferred form is not supported on all platforms due to compiler
-bugs. Users of Boost.Function, please note
-that the preferred syntactic form in Signals2 is equivalent to that of
-Function's preferred syntactic form.</para>
-
-</section>
-
<section><title>Hello, World! (Beginner)</title>
<para>The following example writes "Hello, World!" using signals and
slots. First, we create a signal <code>sig</code>, a signal that
@@ -60,36 +47,8 @@
World!".</para>
<programlisting><xi:include href="hello_world_def_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting><xi:include href="hello_world_single_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
-</entry>
-<entry>
-<programlisting> // Signal with no arguments and a void return value
- boost::signals2::signal0<void> sig;
-
- // Connect a HelloWorld slot
- HelloWorld hello;
- sig.connect(hello);
-
- // Call all of the slots
- sig();
-</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
</section>
<section><title>Calling Multiple Slots</title>
@@ -110,33 +69,8 @@
<code>void</code> return value. This time, we connect both a
<code>hello</code> and a <code>world</code> slot to the same
signal, and when we call the signal both slots will be called.</para>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting><xi:include href="hello_world_multi_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
- </entry>
- <entry>
-<programlisting> boost::signals2::signal0<void> sig;
-
- sig.connect(Hello());
- sig.connect(World());
-
- sig();
-</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
<para>By default, slots are pushed onto the back of the slot list,
so the output of this program will be as expected:</para>
<programlisting>
@@ -155,31 +89,8 @@
<code>connect</code> call that specifies the group. Group values
are, by default, <code>int</code>s, and are ordered by the integer
< relation. Here's how we construct Hello, World:</para>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting><xi:include href="hello_world_ordered_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
-</entry>
- <entry>
-<programlisting> boost::signals2::signal0<void> sig;
-
- sig.connect(1, World()); // connect with group 1
- sig.connect(0, Hello()); // connect with group 0</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
<para>Invoking the signal will correctly print "Hello, World!", because the
<code>Hello</code> object is in group 0, which precedes group 1 where
the <code>World</code> object resides. The group
@@ -191,7 +102,7 @@
placed at the front or back of the slot list (by passing
<code>boost::signals2::at_front</code> or <code>boost::signals2::at_back</code>
as the last parameter to <code><methodname
-alt="boost::signals2::signalN::connect">connect</methodname></code>, respectively),
+alt="boost::signals2::signal::connect">connect</methodname></code>, respectively),
and default to the end of the list. When
a group is specified, the final <code>at_front</code> or <code>at_back</code>
parameter describes where the slot
@@ -227,36 +138,8 @@
these values.</para>
<programlisting><xi:include href="slot_arguments_slot_defs_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting><xi:include href="slot_arguments_main_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
-</entry>
-<entry>
-<programlisting> boost::signals2::signal2<void, float, float> sig;
-
- sig.connect(&print_args);
- sig.connect(&print_sum);
- sig.connect(&print_product);
- sig.connect(&print_difference);
- sig.connect(&print_quotient);
-
- sig(5, 3);</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
<para>This program will print out the following:</para>
<programlisting>The arguments are 5 and 3
The sum is 8
@@ -290,26 +173,7 @@
return a value based on these results to be printed:</para>
<programlisting><xi:include href="signal_return_value_slot_defs_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting>boost::signals2::signal<float (float, float)> sig;</programlisting>
-</entry>
-<entry>
-<programlisting>boost::signals2::signal2<float, float, float> sig;</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
<programlisting><xi:include href="signal_return_value_main_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
@@ -339,33 +203,10 @@
<para>We actually use this new function object type by installing it
as a combiner for our signal. The combiner template argument
follows the signal's calling signature:</para>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting>
<classname>boost::signals2::signal</classname><float (float x, float y),
maximum<float> > sig;
</programlisting>
-</entry>
-<entry>
-<programlisting>
-<classname alt="boost::signals2::signalN">boost::signals2::signal2</classname><float, float, float,
- maximum<float> > sig;
-</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
<para>Now we can connect slots that perform arithmetic functions and
use the signal:</para>
<programlisting><xi:include href="custom_combiners_maximum_usage_code_snippet.xml"
@@ -382,30 +223,9 @@
<para>
Again, we can create a signal with this new combiner:
</para>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting>
<classname>boost::signals2::signal</classname><float (float, float),
aggregate_values<std::vector<float> > > sig;</programlisting>
-</entry>
-<entry>
-<programlisting>
-<classname alt="boost::signals2::signalN">boost::signals2::signal2</classname><float, float, float,
- aggregate_values<std::vector<float> > > sig;</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
<programlisting><xi:include href="custom_combiners_aggregate_values_usage_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
<para>The output of this program will contain 15, 8, 1.6667, and 2. It
@@ -457,7 +277,7 @@
when a slot should no longer be connected.</para>
<para>The entry point for managing connections explicitly is the
<code><classname>boost::signals2::connection</classname></code> class. The
-<code><classname>connection</classname></code> class uniquely represents the connection
+<code>connection</code> class uniquely represents the connection
between a particular signal and a particular slot. The
<code><methodname alt="connection::connected">connected</methodname>()</code> method checks if the signal and slot are
still connected, and the <code><methodname alt="connection::disconnect">disconnect()</methodname></code> method
@@ -502,7 +322,7 @@
<para>
Note, attempts to initialize a scoped_connection with the assignment syntax
will fail due to it being noncopyable. Either the explicit initialization syntax
- or default construction followed by assignment from a <classname>connection</classname>
+ or default construction followed by assignment from a <classname>signals2::connection</classname>
will work:
</para>
<programlisting>
@@ -521,34 +341,14 @@
<section><title>Disconnecting Equivalent Slots (Intermediate)</title>
<para>One can disconnect slots that are equivalent to a given function
object using a form of the
-<code><methodname alt="signalN::disconnect">signal::disconnect</methodname></code> method, so long as
+<code><methodname>signal::disconnect</methodname></code> method, so long as
the type of the function object has an accessible <code>==</code>
operator. For instance:
</para>
<programlisting><xi:include href="disconnect_by_slot_def_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting><classname>boost::signals2::signal</classname><void ()> sig;</programlisting>
-</entry>
-<entry>
-<programlisting><classname alt="boost::signals2::signalN">boost::signals2::signal0</classname><void> sig;</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
</section>
<programlisting><xi:include href="disconnect_by_slot_usage_code_snippet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"/></programlisting>
@@ -561,36 +361,12 @@
where clients connect to a news provider that then sends news to
all connected clients as information arrives. The news delivery
service may be constructed like this: </para>
- <informaltable>
- <tgroup cols="2" align="left">
- <thead>
- <row>
- <entry>Preferred syntax</entry>
- <entry>Portable syntax</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
<programlisting>
class NewsItem { /* ... */ };
typedef boost::signals2::signal<void (const NewsItem&)> signal_type;
signal_type deliverNews;
</programlisting>
-</entry>
-<entry>
-<programlisting>
-class NewsItem { /* ... */ };
-
-typedef boost::signals2::signal1<void, const NewsItem&> signal_type;
-signal_type deliverNews;
-</programlisting>
-</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
<para>Clients that wish to receive news updates need only connect a
function object that can receive news items to the
@@ -621,14 +397,14 @@
<code>deliverNews</code> knows about? Most likely, a segmentation
fault will occur. However, with Boost.Signals2 one may track any object
which is managed by a shared_ptr, by using
-<methodname alt="boost::signals2::slotN::track">slot::track</methodname>. A slot will automatically
+<methodname alt="boost::signals2::slot::track">slot::track</methodname>. A slot will automatically
disconnect when any of its tracked objects expire. In
addition, Boost.Signals2 will ensure that no tracked object expires
while the slot it is associated with is in mid-execution. It does so by creating
temporary shared_ptr copies of the slot's tracked objects before executing it.
To track <code>NewsMessageArea</code>, we use a shared_ptr to manage
its lifetime, and pass the shared_ptr to the slot via its
-<methodname alt="boost::signals2::slotN::track">slot::track</methodname>
+<methodname alt="boost::signals2::slot::track">slot::track</methodname>
method before connecting it,
e.g.:</para>
<programlisting>
@@ -640,7 +416,7 @@
</programlisting>
<para>
Note there is no explicit call to bind() needed in the above example. If the
- <classname alt="slotN">slot</classname> constructor is passed more than one
+ <classname>signals2::slot</classname> constructor is passed more than one
argument, it will automatically pass all the arguments to <code>bind</code> and use the
returned function object.
</para>
@@ -650,7 +426,7 @@
<code>newsMessageArea</code> itself, a copy of the <code>shared_ptr</code> would
have been bound into the slot function, preventing the <code>shared_ptr</code>
from expiring. However, the use of
- <methodname alt="boost::signals2::slotN::track">slot::track</methodname>
+ <methodname alt="boost::signals2::slot::track">slot::track</methodname>
implies we wish to allow the tracked object to expire, and automatically
disconnect the connection when this occurs.
</para>
@@ -807,10 +583,10 @@
</para>
<para>
For a slot to disconnect (or block) its invoking connection, it must have
- access to a <classname>connection</classname> object which references
+ access to a <classname>signals2::connection</classname> object which references
the invoking signal-slot connection. The difficulty is,
- the <classname>connection</classname> object is returned by the
- <methodname alt="signalN::connect">signal::connect</methodname>
+ the <code>connection</code> object is returned by the
+ <methodname>signal::connect</methodname>
method, and therefore is not available until after the slot is
already connected to the signal. This can be particularly troublesome
in a multi-threaded environment where the signal may be invoked
@@ -818,20 +594,20 @@
</para>
<para>
Therefore, the signal classes provide
- <methodname alt="signalN::connect_extended">signal::connect_extended</methodname>
+ <methodname>signal::connect_extended</methodname>
methods, which allow slots which take an extra argument to be connected to a signal.
- The extra argument is a <classname>connection</classname> object which refers
+ The extra argument is a <classname>signals2::connection</classname> object which refers
to the signal-slot connection currently invoking the slot.
- <methodname alt="signalN::connect_extended">signal::connect_extended</methodname>
+ <methodname>signal::connect_extended</methodname>
uses slots of the type given by the
- <classname alt="signalN::extended_slot_type">signal::extended_slot_type</classname>
+ <classname>signal::extended_slot_type</classname>
typedef.
</para>
<para>
The examples section includes an
<link linkend="signals2.examples.tutorial.extended_slot">extended_slot</link>
program which demonstrates the syntax for using
- <methodname alt="signalN::connect_extended">signal::connect_extended</methodname>.
+ <methodname>signal::connect_extended</methodname>.
</para>
</section>
@@ -839,7 +615,7 @@
<title>Changing the <code>Mutex</code> Type of a Signal (Advanced).</title>
<para>
For most cases the default type of <classname>boost::signals2::mutex</classname> for
- a <classname>signal</classname>'s <code>Mutex</code> template type parameter should
+ a <classname>signals2::signal</classname>'s <code>Mutex</code> template type parameter should
be fine. If you wish to use an alternate mutex type, it must be default-constructible
and fulfill the <code>Lockable</code> concept defined by the Boost.Thread library.
That is, it must have <code>lock()</code> and <code>unlock()</code> methods
@@ -847,18 +623,18 @@
but this library does not require try locking).
</para>
<para>
- The Boost.Signals2 library provides one alternate mutex class for use with <classname>signal</classname>:
+ The Boost.Signals2 library provides one alternate mutex class for use with <code>signal</code>:
<classname>boost::signals2::dummy_mutex</classname>. This is a fake mutex for
use in single-threaded programs, where locking a real mutex would be useless
- overhead. Other mutex types you could use with <classname>signal</classname> include
- <classname>boost::mutex</classname> and the <code>std::mutex</code> from
+ overhead. Other mutex types you could use with <code>signal</code> include
+ <classname>boost::mutex</classname>, or the <code>std::mutex</code> from
C++0x.
</para>
<para>
Changing a signal's <code>Mutex</code> template type parameter can be tedious, due to
the large number of template parameters which precede it. The
<classname>signal_type</classname> metafunction is particularly useful in this case,
- since it enables named template type parameters for the <classname>signal</classname>
+ since it enables named template type parameters for the <classname>signals2::signal</classname>
class. For example, to declare a signal which takes an <code>int</code> as
an argument and uses a <classname>boost::signals2::dummy_mutex</classname>
for its <code>Mutex</code> types, you could write:
Modified: branches/release/libs/signals2/test/connection_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/connection_test.cpp (original)
+++ branches/release/libs/signals2/test/connection_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -14,7 +14,7 @@
namespace bs2 = boost::signals2;
-typedef bs2::signal0<void> sig_type;
+typedef bs2::signal<void ()> sig_type;
void myslot()
{}
Modified: branches/release/libs/signals2/test/dead_slot_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/dead_slot_test.cpp (original)
+++ branches/release/libs/signals2/test/dead_slot_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -12,7 +12,7 @@
#include <boost/signals2.hpp>
#include <boost/bind.hpp>
-typedef boost::signals2::signal1<int, int> sig_type;
+typedef boost::signals2::signal<int (int)> sig_type;
class with_constant {
public:
Modified: branches/release/libs/signals2/test/deletion_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/deletion_test.cpp (original)
+++ branches/release/libs/signals2/test/deletion_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -40,7 +40,7 @@
static void
test_remove_self()
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1));
@@ -115,7 +115,7 @@
static void
test_remove_prior()
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1, 0));
@@ -154,7 +154,7 @@
static void
test_remove_after()
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
connections[0] = s0.connect(remove_connection(0, 1));
connections[1] = s0.connect(remove_connection(1));
@@ -193,7 +193,7 @@
static void
test_bloodbath()
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
connections[0] = s0.connect(remove_connection(0, 1));
connections[1] = s0.connect(remove_connection(1, 1));
@@ -214,7 +214,7 @@
static void
test_disconnect_equal()
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
connections[0] = s0.connect(remove_connection(0));
connections[1] = s0.connect(remove_connection(1));
Modified: branches/release/libs/signals2/test/ordering_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/ordering_test.cpp (original)
+++ branches/release/libs/signals2/test/ordering_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -68,7 +68,7 @@
std::vector<int> sortedValues;
- boost::signals2::signal0<void> sig;
+ boost::signals2::signal<void ()> sig;
sig.connect(write_ungrouped1());
for (int i = 0; i < 100; ++i) {
#ifdef BOOST_NO_STDC_NAMESPACE
Modified: branches/release/libs/signals2/test/regression_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/regression_test.cpp (original)
+++ branches/release/libs/signals2/test/regression_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -13,7 +13,7 @@
#include <boost/test/minimal.hpp>
#include <boost/signals2.hpp>
-typedef boost::signals2::signal0<void> sig0_type;
+typedef boost::signals2::signal<void ()> sig0_type;
// combiner that returns the number of slots invoked
struct slot_counter {
@@ -64,7 +64,7 @@
/* 2008-03-10: we weren't disconnecting old connection in scoped_connection assignment operator */
void scoped_connection_test()
{
- typedef boost::signals2::signal0<void, slot_counter> signal_type;
+ typedef boost::signals2::signal<void (), slot_counter> signal_type;
signal_type sig;
{
boost::signals2::scoped_connection conn(sig.connect(&my_slot));
Modified: branches/release/libs/signals2/test/shared_connection_block_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/shared_connection_block_test.cpp (original)
+++ branches/release/libs/signals2/test/shared_connection_block_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -33,7 +33,7 @@
int test_main(int, char* [])
{
- boost::signals2::signal0<void> s0;
+ boost::signals2::signal<void ()> s0;
for(unsigned i = 0; i < connections.size(); ++i)
{
Modified: branches/release/libs/signals2/test/signal_n_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/signal_n_test.cpp (original)
+++ branches/release/libs/signals2/test/signal_n_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -7,9 +7,18 @@
// For more information, see http://www.boost.org
+#include <boost/config.hpp>
+#include <boost/test/minimal.hpp>
+
+#ifndef BOOST_NO_VARIADIC_TEMPLATES
+int test_main(int, char* [])
+{
+ return 0;
+}
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
#include <boost/optional.hpp>
#include <boost/ref.hpp>
-#include <boost/test/minimal.hpp>
#include <boost/signals2.hpp>
#include <functional>
@@ -290,3 +299,5 @@
test_extended_slot<int>();
return 0;
}
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
Modified: branches/release/libs/signals2/test/signal_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/signal_test.cpp (original)
+++ branches/release/libs/signals2/test/signal_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -1,6 +1,9 @@
// Boost.Signals library
-// Copyright Douglas Gregor 2001-2003. Use, modification and
+// Copyright Frank Mori Hess 2008-2009.
+// 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)
@@ -12,6 +15,7 @@
#include <boost/signals2.hpp>
#include <functional>
#include <iostream>
+#include <typeinfo>
template<typename T>
struct max_or_default {
@@ -215,6 +219,52 @@
}
}
+void increment_arg(int &value)
+{
+ ++value;
+}
+
+static void
+test_reference_args()
+{
+ typedef boost::signals2::signal<void (int &)> signal_type;
+ signal_type s1;
+
+ s1.connect(&increment_arg);
+ int value = 0;
+ s1(value);
+ BOOST_CHECK(value == 1);
+}
+
+static void
+test_typedefs_etc()
+{
+ typedef boost::signals2::signal<int (double, long)> signal_type;
+ typedef signal_type::slot_type slot_type;
+
+ BOOST_CHECK(typeid(signal_type::slot_result_type) == typeid(int));
+ BOOST_CHECK(typeid(signal_type::result_type) == typeid(boost::optional<int>));
+ BOOST_CHECK(typeid(signal_type::arg<0>::type) == typeid(double));
+ BOOST_CHECK(typeid(signal_type::arg<1>::type) == typeid(long));
+ BOOST_CHECK(typeid(signal_type::arg<0>::type) == typeid(signal_type::first_argument_type));
+ BOOST_CHECK(typeid(signal_type::arg<1>::type) == typeid(signal_type::second_argument_type));
+ BOOST_CHECK(typeid(signal_type::signature_type) == typeid(int (double, long)));
+ BOOST_CHECK(signal_type::arity == 2);
+
+ BOOST_CHECK(typeid(slot_type::result_type) == typeid(signal_type::slot_result_type));
+ BOOST_CHECK(typeid(slot_type::arg<0>::type) == typeid(signal_type::arg<0>::type));
+ BOOST_CHECK(typeid(slot_type::arg<1>::type) == typeid(signal_type::arg<1>::type));
+ BOOST_CHECK(typeid(slot_type::arg<0>::type) == typeid(slot_type::first_argument_type));
+ BOOST_CHECK(typeid(slot_type::arg<1>::type) == typeid(slot_type::second_argument_type));
+ BOOST_CHECK(typeid(slot_type::signature_type) == typeid(signal_type::signature_type));
+ BOOST_CHECK(slot_type::arity == signal_type::arity);
+
+ typedef boost::signals2::signal<void (short)> unary_signal_type;
+ BOOST_CHECK(typeid(unary_signal_type::slot_result_type) == typeid(void));
+ BOOST_CHECK(typeid(unary_signal_type::argument_type) == typeid(short));
+ BOOST_CHECK(typeid(unary_signal_type::slot_type::argument_type) == typeid(short));
+}
+
int
test_main(int, char* [])
{
@@ -223,6 +273,7 @@
test_signal_signal_connect();
test_extended_slot<void>();
test_extended_slot<int>();
-
+ test_reference_args();
+ test_typedefs_etc();
return 0;
}
Modified: branches/release/libs/signals2/test/signals_vs_signals2_benchmark.cpp
==============================================================================
--- branches/release/libs/signals2/test/signals_vs_signals2_benchmark.cpp (original)
+++ branches/release/libs/signals2/test/signals_vs_signals2_benchmark.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -135,6 +135,7 @@
int main(int argc, const char **argv)
{
+ std::cout << "\n";
{
std::cout << "boost::signals2::signal, ";
benchmark_invocation<new_signal_type>(1);
@@ -144,6 +145,7 @@
benchmark_invocation<old_signal_type>(1);
}
+ std::cout << "\n";
{
std::cout << "boost::signals2::signal, ";
benchmark_invocation<new_signal_type>(10);
@@ -153,12 +155,15 @@
benchmark_invocation<old_signal_type>(10);
}
+ std::cout << "\n";
benchmark_new_tracked_invocation(1);
benchmark_old_tracked_invocation(1);
+ std::cout << "\n";
benchmark_new_tracked_invocation(10);
benchmark_old_tracked_invocation(10);
+ std::cout << "\n";
{
std::cout << "boost::signals2::signal, ";
benchmark_connect_disconnect<new_signal_type>();
Modified: branches/release/libs/signals2/test/slot_compile_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/slot_compile_test.cpp (original)
+++ branches/release/libs/signals2/test/slot_compile_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -23,6 +23,5 @@
int test_main(int, char*[])
{
boost::signals2::slot<void (void)> sl0(&myslot);
- boost::signals2::slot1<int, int> sl2(&myslot2);
return 0;
}
Modified: branches/release/libs/signals2/test/track_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/track_test.cpp (original)
+++ branches/release/libs/signals2/test/track_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -47,13 +47,12 @@
static int myfunc(int i, double z)
{
- std::cout << __FUNCTION__ << ": i is " << i << " and z is " << z << std::endl;
return i;
}
int test_main(int, char*[])
{
- typedef boost::signals2::signal1<int, int, max_or_default<int> > sig_type;
+ typedef boost::signals2::signal<int (int), max_or_default<int> > sig_type;
sig_type s1;
boost::signals2::connection connection;
Modified: branches/release/libs/signals2/test/trackable_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/trackable_test.cpp (original)
+++ branches/release/libs/signals2/test/trackable_test.cpp 2009-06-02 10:18:22 EDT (Tue, 02 Jun 2009)
@@ -47,7 +47,7 @@
int test_main(int, char*[])
{
- typedef boost::signals2::signal1<int, int, max_or_default<int> > sig_type;
+ typedef boost::signals2::signal<int (int), max_or_default<int> > sig_type;
sig_type s1;
// Test auto-disconnection
@@ -65,7 +65,7 @@
BOOST_CHECK(s1(5) == 5);
}
BOOST_CHECK(s1(5) == 0);
-
+
// Test multiple arg slot constructor
{
short_lived shorty;
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