|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53358 - in branches/phoenix_v3: . boost/graph boost/signals2 boost/signals2/detail libs/graph/doc libs/signals2/test
From: eric_at_[hidden]
Date: 2009-05-28 15:22:38
Author: eric_niebler
Date: 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
New Revision: 53358
URL: http://svn.boost.org/trac/boost/changeset/53358
Log:
Merged revisions 53349,53353-53356 via svnmerge from
https://svn.boost.org/svn/boost/trunk
........
r53349 | jewillco | 2009-05-28 10:17:49 -0700 (Thu, 28 May 2009) | 1 line
Added more changes from Michael Hansen
........
r53353 | fmhess | 2009-05-28 11:37:40 -0700 (Thu, 28 May 2009) | 3 lines
Use BOOST_NO_VARIADIC_TEMPLATES instead of BOOST_HAS_VARIADIC_TMPL, etc.
........
r53354 | fmhess | 2009-05-28 11:45:22 -0700 (Thu, 28 May 2009) | 2 lines
Tweaked #include directives a little.
........
r53355 | fmhess | 2009-05-28 11:49:27 -0700 (Thu, 28 May 2009) | 9 lines
Added variadic signal/slot implementations used when
BOOST_NO_VARIADIC_TEMPLATES is not defined. The
signal0, signal1, etc classes are not available when using
the variadic implementations, I plan to mark them as
deprecated. Also the arg1_type, arg2_type member typedefs
are not available and are replaced with a "arg" member
template class. Documentation updates to follow.
........
r53356 | fmhess | 2009-05-28 12:00:01 -0700 (Thu, 28 May 2009) | 3 lines
Added some files I forgot to add with changeset [53355]
........
Added:
branches/phoenix_v3/boost/signals2/detail/preprocessed_arg_type.hpp
- copied unchanged from r53356, /trunk/boost/signals2/detail/preprocessed_arg_type.hpp
branches/phoenix_v3/boost/signals2/detail/preprocessed_arg_type_template.hpp
- copied unchanged from r53356, /trunk/boost/signals2/detail/preprocessed_arg_type_template.hpp
branches/phoenix_v3/boost/signals2/detail/replace_slot_function.hpp
- copied unchanged from r53356, /trunk/boost/signals2/detail/replace_slot_function.hpp
branches/phoenix_v3/boost/signals2/detail/variadic_arg_type.hpp
- copied unchanged from r53356, /trunk/boost/signals2/detail/variadic_arg_type.hpp
branches/phoenix_v3/boost/signals2/detail/variadic_slot_invoker.hpp
- copied unchanged from r53356, /trunk/boost/signals2/detail/variadic_slot_invoker.hpp
branches/phoenix_v3/boost/signals2/preprocessed_signal.hpp
- copied unchanged from r53356, /trunk/boost/signals2/preprocessed_signal.hpp
branches/phoenix_v3/boost/signals2/preprocessed_slot.hpp
- copied unchanged from r53356, /trunk/boost/signals2/preprocessed_slot.hpp
branches/phoenix_v3/boost/signals2/signal.hpp
- copied unchanged from r53356, /trunk/boost/signals2/signal.hpp
branches/phoenix_v3/boost/signals2/slot.hpp
- copied unchanged from r53356, /trunk/boost/signals2/slot.hpp
branches/phoenix_v3/boost/signals2/variadic_signal.hpp
- copied unchanged from r53356, /trunk/boost/signals2/variadic_signal.hpp
branches/phoenix_v3/boost/signals2/variadic_slot.hpp
- copied unchanged from r53356, /trunk/boost/signals2/variadic_slot.hpp
Properties modified:
branches/phoenix_v3/ (props changed)
Text files modified:
branches/phoenix_v3/boost/graph/dijkstra_shortest_paths_no_color_map.hpp | 90 +++++++-------
branches/phoenix_v3/boost/signals2/connection.hpp | 1
branches/phoenix_v3/boost/signals2/deconstruct.hpp | 12
branches/phoenix_v3/boost/signals2/detail/signal_template.hpp | 257 ++++++++++++++++++++-------------------
branches/phoenix_v3/boost/signals2/detail/signals_common.hpp | 30 ++++
branches/phoenix_v3/boost/signals2/detail/signals_common_macros.hpp | 138 ++++++++++++++++++++
branches/phoenix_v3/boost/signals2/detail/slot_call_iterator.hpp | 1
branches/phoenix_v3/boost/signals2/detail/slot_template.hpp | 45 +++++-
branches/phoenix_v3/boost/signals2/detail/tracked_objects_visitor.hpp | 4
branches/phoenix_v3/boost/signals2/signal_base.hpp | 1
branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths.html | 4
branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths_no_color_map.html | 21 +-
branches/phoenix_v3/libs/signals2/test/connection_test.cpp | 2
branches/phoenix_v3/libs/signals2/test/dead_slot_test.cpp | 2
branches/phoenix_v3/libs/signals2/test/deletion_test.cpp | 10
branches/phoenix_v3/libs/signals2/test/ordering_test.cpp | 2
branches/phoenix_v3/libs/signals2/test/regression_test.cpp | 4
branches/phoenix_v3/libs/signals2/test/shared_connection_block_test.cpp | 2
branches/phoenix_v3/libs/signals2/test/signal_n_test.cpp | 13 +
branches/phoenix_v3/libs/signals2/test/signal_test.cpp | 22 +++
branches/phoenix_v3/libs/signals2/test/slot_compile_test.cpp | 1
branches/phoenix_v3/libs/signals2/test/track_test.cpp | 2
branches/phoenix_v3/libs/signals2/test/trackable_test.cpp | 4
23 files changed, 446 insertions(+), 222 deletions(-)
Modified: branches/phoenix_v3/boost/graph/dijkstra_shortest_paths_no_color_map.hpp
==============================================================================
--- branches/phoenix_v3/boost/graph/dijkstra_shortest_paths_no_color_map.hpp (original)
+++ branches/phoenix_v3/boost/graph/dijkstra_shortest_paths_no_color_map.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
@@ -20,46 +20,6 @@
namespace boost {
- // Full init version
- template <typename Graph, typename DijkstraVisitor,
- typename PredecessorMap, typename DistanceMap,
- typename WeightMap, typename VertexIndexMap,
- typename DistanceCompare, typename DistanceWeightCombine,
- typename DistanceInfinity, typename DistanceZero>
- void dijkstra_shortest_paths_no_color_map
- (const Graph& graph,
- typename graph_traits<Graph>::vertex_descriptor start_vertex,
- PredecessorMap predecessor_map,
- DistanceMap distance_map,
- WeightMap weight_map,
- VertexIndexMap index_map,
- DistanceCompare distance_compare,
- DistanceWeightCombine distance_weight_combine,
- DistanceInfinity distance_infinity,
- DistanceZero distance_zero,
- DijkstraVisitor visitor)
- {
- // Initialize vertices
- BGL_FORALL_VERTICES_T(current_vertex, graph, Graph) {
- visitor.initialize_vertex(current_vertex, graph);
-
- // Default all distances to infinity
- put(distance_map, current_vertex, distance_infinity);
-
- // Default all vertex predecessors to the vertex itself
- put(predecessor_map, current_vertex, current_vertex);
- }
-
- // Set distance for start_vertex to zero
- put(distance_map, start_vertex, distance_zero);
-
- // Pass everything on to the no_init version
- dijkstra_shortest_paths_no_color_map_no_init(graph,
- start_vertex, predecessor_map, distance_map, weight_map,
- index_map, distance_compare, distance_weight_combine,
- distance_infinity, distance_zero, visitor);
- }
-
// No init version
template <typename Graph, typename DijkstraVisitor,
typename PredecessorMap, typename DistanceMap,
@@ -88,13 +48,13 @@
distance_indirect_compare(distance_map, distance_compare);
// Choose vertex queue type
- #if BOOST_GRAPH_DIJKSTRA_USE_RELAXED_HEAP
+#if BOOST_GRAPH_DIJKSTRA_USE_RELAXED_HEAP
typedef relaxed_heap<Vertex, DistanceIndirectCompare, VertexIndexMap>
VertexQueue;
VertexQueue vertex_queue(num_vertices(graph),
distance_indirect_compare,
index_map);
- #else
+#else
// Default - use d-ary heap (d = 4)
typedef
detail::vertex_property_map_generator<Graph, VertexIndexMap, std::size_t>
@@ -109,7 +69,7 @@
IndexInHeapMapHelper::build(graph, index_map,
index_in_heap_map_holder);
VertexQueue vertex_queue(distance_map, index_in_heap, distance_compare);
- #endif
+#endif
// Add vertex to the queue
vertex_queue.push(start_vertex);
@@ -147,7 +107,7 @@
Distance neighbor_vertex_distance = get(distance_map, neighbor_vertex);
bool is_neighbor_undiscovered =
!distance_compare(neighbor_vertex_distance, distance_infinity);
-
+
// Attempt to relax the edge
bool was_edge_relaxed = relax(current_edge, graph, weight_map,
predecessor_map, distance_map,
@@ -170,6 +130,46 @@
} // end while queue not empty
}
+ // Full init version
+ template <typename Graph, typename DijkstraVisitor,
+ typename PredecessorMap, typename DistanceMap,
+ typename WeightMap, typename VertexIndexMap,
+ typename DistanceCompare, typename DistanceWeightCombine,
+ typename DistanceInfinity, typename DistanceZero>
+ void dijkstra_shortest_paths_no_color_map
+ (const Graph& graph,
+ typename graph_traits<Graph>::vertex_descriptor start_vertex,
+ PredecessorMap predecessor_map,
+ DistanceMap distance_map,
+ WeightMap weight_map,
+ VertexIndexMap index_map,
+ DistanceCompare distance_compare,
+ DistanceWeightCombine distance_weight_combine,
+ DistanceInfinity distance_infinity,
+ DistanceZero distance_zero,
+ DijkstraVisitor visitor)
+ {
+ // Initialize vertices
+ BGL_FORALL_VERTICES_T(current_vertex, graph, Graph) {
+ visitor.initialize_vertex(current_vertex, graph);
+
+ // Default all distances to infinity
+ put(distance_map, current_vertex, distance_infinity);
+
+ // Default all vertex predecessors to the vertex itself
+ put(predecessor_map, current_vertex, current_vertex);
+ }
+
+ // Set distance for start_vertex to zero
+ put(distance_map, start_vertex, distance_zero);
+
+ // Pass everything on to the no_init version
+ dijkstra_shortest_paths_no_color_map_no_init(graph,
+ start_vertex, predecessor_map, distance_map, weight_map,
+ index_map, distance_compare, distance_weight_combine,
+ distance_infinity, distance_zero, visitor);
+ }
+
namespace detail {
// Handle defaults for PredecessorMap, DistanceCompare,
@@ -233,7 +233,7 @@
dijkstra_shortest_paths_no_color_map
(const Graph& graph,
typename graph_traits<Graph>::vertex_descriptor start_vertex,
- const bgl_named_params<Param,Tag,Rest>& params)
+ const bgl_named_params<Param, Tag, Rest>& params)
{
// Default for edge weight and vertex index map is to ask for them
// from the graph. Default for the visitor is null_visitor.
Modified: branches/phoenix_v3/boost/signals2/connection.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/connection.hpp (original)
+++ branches/phoenix_v3/boost/signals2/connection.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/boost/signals2/deconstruct.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/deconstruct.hpp (original)
+++ branches/phoenix_v3/boost/signals2/deconstruct.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/boost/signals2/detail/signal_template.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/signal_template.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/signal_template.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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,32 +116,34 @@
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 slot_result_type;
private:
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
class slot_invoker;
+#else // BOOST_NO_VARIADIC_TEMPLATES
+ typedef variadic_slot_invoker<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 Group group_type;
@@ -177,7 +151,7 @@
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,8 +235,7 @@
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_invoker invoker = slot_invoker(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_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
@@ -282,8 +255,7 @@
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_invoker invoker = slot_invoker(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_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
@@ -331,12 +303,12 @@
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;
-
- slot_invoker(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_IF(BOOST_SIGNALS2_NUM_ARGS, :, )
+ slot_invoker(BOOST_SIGNALS2_FULL_REF_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 +322,12 @@
return m_invoke(connectionBody,
resolver);
}
-// Tn argn;
+ private:
+// 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_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:
result_type m_invoke(const connection_body_type &connectionBody,
const void_type *) const
{
@@ -367,6 +339,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,17 +503,24 @@
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
{
- 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;
@@ -554,6 +534,9 @@
typedef GroupCompare group_compare_type;
typedef typename impl_class::slot_call_iterator
slot_call_iterator;
+
+#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 +548,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 = detail::vararg_count<Args...>::value);
+
+#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 +644,52 @@
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 +705,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/phoenix_v3/boost/signals2/detail/signals_common.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/signals_common.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/signals_common.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/boost/signals2/detail/signals_common_macros.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/signals_common_macros.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/signals_common_macros.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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,45 @@
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)
// 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 +85,110 @@
#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_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_SIGNATURE_TEMPLATE_INSTANTIATION(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_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) R (Args...)
+#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_PP_COMMA_IF(arity) ,
+
+#endif // BOOST_NO_VARIADIC_TEMPLATES
#endif // BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
Modified: branches/phoenix_v3/boost/signals2/detail/slot_call_iterator.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/slot_call_iterator.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/slot_call_iterator.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/boost/signals2/detail/slot_template.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/slot_template.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/slot_template.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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,11 @@
// 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:
template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
@@ -30,6 +39,8 @@
typedef SlotFunction slot_function_type;
typedef R result_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 +52,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 = detail::vararg_count<Args...>::value);
+
+#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(boost::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 +139,7 @@
SlotFunction _slot_function;
};
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
namespace detail
{
template<unsigned arity, typename Signature, typename SlotFunction>
@@ -130,6 +154,7 @@
SlotFunction> type;
};
}
+#endif
} // end namespace signals2
} // end namespace boost
Modified: branches/phoenix_v3/boost/signals2/detail/tracked_objects_visitor.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/detail/tracked_objects_visitor.hpp (original)
+++ branches/phoenix_v3/boost/signals2/detail/tracked_objects_visitor.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/boost/signals2/signal_base.hpp
==============================================================================
--- branches/phoenix_v3/boost/signals2/signal_base.hpp (original)
+++ branches/phoenix_v3/boost/signals2/signal_base.hpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths.html
==============================================================================
--- branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths.html (original)
+++ branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths.html 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
@@ -19,8 +19,6 @@
<TT>dijkstra_shortest_paths</TT>
</H1>
-<p>See also dijkstra_shortest_paths_no_color_map
-
<P>
<PRE>
<i>// named parameter version</i>
@@ -431,6 +429,8 @@
<TT>example/dijkstra-example.cpp</TT></a> for an example of using Dijkstra's
algorithm.
+<H3>See also</H3> dijkstra_shortest_paths_no_color_map for a version of dijkstra's shortest path that does not use a color map.
+
<H3>Notes</H3>
<a name="1">[1]</a>
Modified: branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths_no_color_map.html
==============================================================================
--- branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths_no_color_map.html (original)
+++ branches/phoenix_v3/libs/graph/doc/dijkstra_shortest_paths_no_color_map.html 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
@@ -19,8 +19,6 @@
<TT>dijkstra_shortest_paths_no_color_map</TT>
</H1>
-<p>See also dijkstra_shortest_paths
-
<P>
<PRE>
<i>// named parameter version</i>
@@ -71,6 +69,10 @@
</P>
<P>
+ <tt>dijkstra_shortest_paths_no_color_map</tt> differs from the original <tt>dijkstra_shortest_paths</tt> algorithm by not using a color map to identify vertices as discovered or undiscovered. Instead, this is done with the distance map: a vertex <i>u</i> such that <i>distance_compare(distance_map[u], distance_infinity) == false</i> is considered to be undiscovered.
+</P>
+
+<P>
There are two main options for obtaining output from the
<tt>dijkstra_shortest_paths_no_color_map()</tt> function. If you provide a
distance property map through the <tt>distance_map()</tt> parameter
@@ -82,7 +84,7 @@
either the source or a vertex unreachable from the source). In
addition to these two options, the user can provide their own
custom-made visitor that takes actions during any of the
-algorithm's event points.</P>
+algorithm's event points [4].</P>
<P>
Dijkstra's algorithm finds all the shortest paths from the source
@@ -100,12 +102,6 @@
the top of the priority queue. The algorithm finishes when the
priority queue is empty.
</P>
-<P>
-The algorithm uses the distance map to keep
-track of which set each vertex is in. Vertices with a non-infinite distance are in
-<i>S</i>. Vertices with an infinite distance are in <i>V-S</i> and have
-not yet been discovered.
-</P>
<p>
The following is the pseudo-code for Dijkstra's single-source shortest
paths algorithm. <i>w</i> is the edge weight, <i>d</i> is the distance label,
@@ -193,7 +189,7 @@
IN: <tt>weight_map(WeightMap weight_map)</tt>
<blockquote>
The weight or ``length'' of each edge in the graph. The weights
- must all be non-negative and non-infinite. The algorithm will throw a
+ must all be non-negative and non-infinite [3]. The algorithm will throw a
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
exception is one of the edges is negative.
The type <tt>WeightMap</tt> must be a model of
@@ -366,6 +362,8 @@
See <a href="../example/dijkstra-no-color-map-example.cpp">
<TT>example/dijkstra-no-color-map-example.cpp</TT></a> for an example of using Dijkstra's algorithm.
+<H3>See also</H3> dijkstra_shortest_paths for a version of dijkstra's shortest path that uses a color map.
+
<H3>Notes</H3>
<p>Based on the documentation for dijkstra_shortest_paths.
@@ -385,6 +383,9 @@
<p><a name="3">[3]</a>
The algorithm will not work correctly if any of the edge weights are equal to infinity since the infinite distance value is used to determine if a vertex has been discovered.
+
+<p><a name="4">[4]</a>
+ Calls to the visitor events occur in the same order as <tt>dijkstra_shortest_paths</tt> (i.e. <i>discover_vertex(u)</i> will always be called after <i>examine_vertex(u)</i> for an undiscovered vertex <i>u</i>). However, the vertices of the graph given to <i>dijkstra_shortest_paths_no_color_map</i> will <b>not</b> necessarily be visited in the same order as <i>dijkstra_shortest_paths</i>.
<br>
<HR>
Modified: branches/phoenix_v3/libs/signals2/test/connection_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/connection_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/connection_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/dead_slot_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/dead_slot_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/dead_slot_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/deletion_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/deletion_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/deletion_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/ordering_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/ordering_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/ordering_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/regression_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/regression_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/regression_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/shared_connection_block_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/shared_connection_block_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/shared_connection_block_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/signal_n_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/signal_n_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/signal_n_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/signal_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/signal_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/signal_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
@@ -226,7 +226,7 @@
static void
test_reference_args()
{
- typedef boost::signals2::signal<void (int &value)> signal_type;
+ typedef boost::signals2::signal<void (int &)> signal_type;
signal_type s1;
s1.connect(&increment_arg);
@@ -235,6 +235,24 @@
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(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(slot_type::arity == signal_type::arity);
+}
+
int
test_main(int, char* [])
{
@@ -244,6 +262,6 @@
test_extended_slot<void>();
test_extended_slot<int>();
test_reference_args();
-
+ test_typedefs_etc();
return 0;
}
Modified: branches/phoenix_v3/libs/signals2/test/slot_compile_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/slot_compile_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/slot_compile_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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/phoenix_v3/libs/signals2/test/track_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/track_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/track_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 2009)
@@ -53,7 +53,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;
boost::signals2::connection connection;
Modified: branches/phoenix_v3/libs/signals2/test/trackable_test.cpp
==============================================================================
--- branches/phoenix_v3/libs/signals2/test/trackable_test.cpp (original)
+++ branches/phoenix_v3/libs/signals2/test/trackable_test.cpp 2009-05-28 15:22:34 EDT (Thu, 28 May 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