|
Boost-Commit : |
From: stipe_at_[hidden]
Date: 2007-11-07 14:26:54
Author: srajko
Date: 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
New Revision: 40905
URL: http://svn.boost.org/trac/boost/changeset/40905
Log:
move to signals, change to functors rather than MPL metafunctions
Added:
sandbox/SOC/2007/signals/boost/dataflow/signals/
- copied from r39907, /sandbox/SOC/2007/signals/boost/dataflow/signal/
sandbox/SOC/2007/signals/boost/dataflow/signals/component/
- copied from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/component/
sandbox/SOC/2007/signals/boost/dataflow/signals/connection/
- copied from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/connection/
sandbox/SOC/2007/signals/boost/dataflow/signals/connection.hpp
- copied, changed from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/connection.hpp
sandbox/SOC/2007/signals/boost/dataflow/signals/detail/
- copied from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/detail/
sandbox/SOC/2007/signals/boost/dataflow/signals/support.hpp
- copied, changed from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/support.hpp
sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example_components.hpp
- copied, changed from r40538, /sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp
Removed:
sandbox/SOC/2007/signals/boost/dataflow/signal/
Text files modified:
sandbox/SOC/2007/signals/boost/dataflow/connection/group.hpp | 41 +--------
sandbox/SOC/2007/signals/boost/dataflow/connection/port_map.hpp | 29 +++---
sandbox/SOC/2007/signals/boost/dataflow/phoenix/connection/iterator_relative.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/applicator.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/chain.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/condition.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_modifier.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_templated.hpp | 10 +-
sandbox/SOC/2007/signals/boost/dataflow/signals/component/counter.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/generic_template.hpp | 6
sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited_templated.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter_base.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/function.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/instantiator.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/junction.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/modifier.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/multiplexer.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/mutex.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_receiver.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_sender.hpp | 6
sandbox/SOC/2007/signals/boost/dataflow/signals/component/storage.hpp | 15 +--
sandbox/SOC/2007/signals/boost/dataflow/signals/component/timed_generator.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/connection.hpp | 6
sandbox/SOC/2007/signals/boost/dataflow/signals/connection/detail/bind_object.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signals/connection/operators.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/connection/slot_selector.hpp | 21 ++--
sandbox/SOC/2007/signals/boost/dataflow/signals/detail/unfused_typed_class.hpp | 2
sandbox/SOC/2007/signals/boost/dataflow/signals/support.hpp | 28 ++----
sandbox/SOC/2007/signals/boost/dataflow/support/binary_operation.hpp | 24 +----
sandbox/SOC/2007/signals/boost/dataflow/support/component_operation.hpp | 29 +++---
sandbox/SOC/2007/signals/boost/dataflow/support/invocable.hpp | 24 ++---
sandbox/SOC/2007/signals/boost/dataflow/support/keyed_port.hpp | 58 ++++++-------
sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp | 40 +++++----
sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp | 54 +++++++-----
sandbox/SOC/2007/signals/boost/dataflow/support/unary_operation.hpp | 26 ++---
sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj | 8 +
sandbox/SOC/2007/signals/libs/dataflow/doc/Jamfile.v2 | 6
sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk | 35 +++++---
sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk | 57 +++++++++++--
sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk | 55 ++++++++++--
sandbox/SOC/2007/signals/libs/dataflow/doc/introduction.qbk | 30 ++++--
sandbox/SOC/2007/signals/libs/dataflow/doc/port_concepts.qbk | 25 ++++-
sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk | 29 ++++--
sandbox/SOC/2007/signals/libs/dataflow/doc/signals.qbk | 2
sandbox/SOC/2007/signals/libs/dataflow/doc/signals/components.qbk | 47 ++++-------
sandbox/SOC/2007/signals/libs/dataflow/doc/signals/concepts.qbk | 129 +++++++++++++++++++------------
sandbox/SOC/2007/signals/libs/dataflow/doc/signals/connections.qbk | 162 ++++++---------------------------------
sandbox/SOC/2007/signals/libs/dataflow/doc/signals/introduction.qbk | 109 ++++++++++++++++++++++++--
sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp | 144 +++++++++++++++++-----------------
sandbox/SOC/2007/signals/libs/dataflow/example/signals/Jamfile.v2 | 4
sandbox/SOC/2007/signals/libs/dataflow/example/signals/intro_example.cpp | 6
sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_distributed_example.cpp | 77 ++++++------------
sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp | 58 +++----------
sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example_components.hpp | 40 ---------
sandbox/SOC/2007/signals/libs/dataflow/example/timing_example.cpp | 4
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_bind_object.cpp | 2
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp | 33 +++++--
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp | 8
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp | 6
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connections.cpp | 36 ++++----
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_counter.cpp | 4
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp | 16 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp | 8
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp | 14 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp | 14 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp | 10 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp | 10 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp | 10 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multiplexer.cpp | 10 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp | 14 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp | 21 +++-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_result_of_defined.cpp | 10 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp | 12 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp | 14 +-
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp | 26 ++++-
sandbox/SOC/2007/signals/libs/dataflow/test/test_binary_op.cpp | 27 ++----
sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp | 9 -
sandbox/SOC/2007/signals/libs/dataflow/test/test_keyed_port.cpp | 18 +--
sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp | 12 +-
sandbox/SOC/2007/signals/libs/dataflow/test/test_unary_op.cpp | 9 -
83 files changed, 919 insertions(+), 942 deletions(-)
Modified: sandbox/SOC/2007/signals/boost/dataflow/connection/group.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/connection/group.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/connection/group.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -97,41 +97,14 @@
> >::type >
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(const Producer &producer, const Consumer &consumer)
{
- static void call(const Producer &producer, const Consumer &consumer)
- {
- typedef boost::fusion::vector<const Producer&, const Consumer&>
- zip_type;
- boost::fusion::zip_view<zip_type>
- zip(zip_type(producer, consumer));
- boost::fusion::for_each(zip, detail::zip_connect());
- }
- static void call(const Producer &producer, Consumer &consumer)
- {
- typedef boost::fusion::vector<const Producer&, Consumer&>
- zip_type;
- boost::fusion::zip_view<zip_type>
- zip(zip_type(producer, consumer));
- boost::fusion::for_each(zip, detail::zip_connect());
- }
- static void call(Producer &producer, const Consumer &consumer)
- {
- typedef boost::fusion::vector<Producer&, const Consumer&>
- zip_type;
- boost::fusion::zip_view<zip_type>
- zip(zip_type(producer, consumer));
- boost::fusion::for_each(zip, detail::zip_connect());
- }
- static void call(Producer &producer, Consumer &consumer)
- {
- typedef boost::fusion::vector<Producer&, Consumer&>
- zip_type;
- boost::fusion::zip_view<zip_type>
- zip(zip_type(producer, consumer));
- boost::fusion::for_each(zip, detail::zip_connect());
- }
- };
+ typedef boost::fusion::vector<const Producer&, const Consumer&>
+ zip_type;
+ boost::fusion::zip_view<zip_type>
+ zip(zip_type(producer, consumer));
+ boost::fusion::for_each(zip, detail::zip_connect());
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/connection/port_map.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/connection/port_map.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/connection/port_map.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -66,22 +66,25 @@
template<typename Mechanism, typename PortCategory, typename KeyTag>
struct get_keyed_port_impl<fusion_map_port<Mechanism, PortCategory>, KeyTag>
{
- template<typename KeyedPort, typename Key>
- struct apply
+ template<typename Args> struct result;
+
+ template<typename F, typename KeyedPort, typename Key>
+ struct result<F(KeyedPort &, Key &)>
{
typedef typename boost::fusion::result_of::at_key<
- typename KeyedPort::map_type,
- KeyTag
- >::type type;
-
- static type
- call(KeyedPort &port, Key &)
- {
- return boost::fusion::at_key<
- KeyTag
- >(port.map());
- }
+ typename KeyedPort::map_type,
+ KeyTag
+ >::type type;
};
+
+ template<typename KeyedPort, typename Key>
+ typename result<get_keyed_port_impl(KeyedPort &, Key &)>::type
+ operator()(KeyedPort &port, Key &)
+ {
+ return boost::fusion::at_key<
+ KeyTag
+ >(port.map());
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/phoenix/connection/iterator_relative.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/phoenix/connection/iterator_relative.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/phoenix/connection/iterator_relative.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -33,7 +33,7 @@
{
return boost::dataflow::extension::phoenix::template get_value<
typename boost::dataflow::producer_category_of<T>::type>
- ::template apply<T>::call(t);
+ ()(t);
}
};
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/applicator.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/applicator.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/applicator.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,12 +8,12 @@
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS applicator
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/applicator.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/applicator.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Member
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME member
#define SIGNAL_NETWORK_GENERIC_TYPENAME2 Application
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
#define SIGNAL_NETWORK_APPLICATOR_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/chain.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/chain.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/chain.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,8 +6,8 @@
#ifndef SIGNAL_NETWORK_CHAIN_HPP
#define SIGNAL_NETWORK_CHAIN_HPP
-#include <boost/dataflow/signal/component/filter_base.hpp>
-#include <boost/dataflow/signal/component/detail/unfused_inherited.hpp>
+#include <boost/dataflow/signals/component/filter_base.hpp>
+#include <boost/dataflow/signals/component/detail/unfused_inherited.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/fusion/functional/adapter/fused.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/condition.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/condition.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/condition.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef SIGNAL_NETWORK_CONDITION_HPP
#define SIGNAL_NETWORK_CONDITION_HPP
-#include <boost/dataflow/signal/component/applicator.hpp>
+#include <boost/dataflow/signals/component/applicator.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/conditional.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -7,12 +7,12 @@
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS conditional
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/conditional.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/conditional.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Member
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME member
#define SIGNAL_NETWORK_GENERIC_TYPENAME2 Condition
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
#define SIGNAL_NETWORK_CONDITIONAL_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_modifier.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/conditional_modifier.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_modifier.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,11 +8,11 @@
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS conditional_modifier
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/conditional_modifier.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/conditional_modifier.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Modification
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME modification
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
#define SIGNAL_NETWORK_CONDITIONAL_MODIFIER_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_templated.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/conditional_templated.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/conditional_templated.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,19 +3,19 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef SIGNAL_NETWORK_CONDITIONA_TEMPLATED_HPP
+#ifndef SIGNAL_NETWORK_CONDITIONAL_TEMPLATED_HPP
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS conditional_templated
#define SIGNAL_NETWORK_GENERIC_USE_TEMPLATED
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/conditional_templated.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/conditional_templated.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Member
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME member
#define SIGNAL_NETWORK_GENERIC_TYPENAME2 Condition
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
-#define SIGNAL_NETWORK_CONDITIONA_TEMPLATED_HPP
+#define SIGNAL_NETWORK_CONDITIONAL_TEMPLATED_HPP
#else // SIGNAL_NETWORK_GENERIC_CLASS
@@ -44,6 +44,6 @@
return typename base_type::signal_type::result_type();
}
-#endif // SIGNAL_NETWORK_CONDITIONA_TEMPLATED_HPP
+#endif // SIGNAL_NETWORK_CONDITIONAL_TEMPLATED_HPP
#endif // SIGNAL_NETWORK_MULTIPLEXER_HPP
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/counter.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/counter.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/counter.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef SIGNAL_NETWORK_COUNTER_HPP
#define SIGNAL_NETWORK_COUNTER_HPP
-#include <boost/dataflow/signal/component/applicator.hpp>
+#include <boost/dataflow/signals/component/applicator.hpp>
#include <boost/type_traits/remove_volatile.hpp>
namespace boost { namespace signals {
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/generic_template.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/detail/generic_template.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/generic_template.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -5,13 +5,13 @@
#ifdef SIGNAL_NETWORK_GENERIC_CLASS
-#include <boost/dataflow/signal/component/filter.hpp>
+#include <boost/dataflow/signals/component/filter.hpp>
#ifndef SIGNAL_NETWORK_GENERIC_USE_TEMPLATED
-#include <boost/dataflow/signal/component/detail/unfused_inherited.hpp>
+#include <boost/dataflow/signals/component/detail/unfused_inherited.hpp>
#define SIGNAL_NETWORK_GENERIC_UNFUSED_BASE unfused_inherited
#else
-#include <boost/dataflow/signal/component/detail/unfused_inherited_templated.hpp>
+#include <boost/dataflow/signals/component/detail/unfused_inherited_templated.hpp>
#define SIGNAL_NETWORK_GENERIC_UNFUSED_BASE unfused_inherited_templated
#endif
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/detail/unfused_inherited.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -42,7 +42,7 @@
//----- ---- --- -- - - - -
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signal/component/detail/unfused_inherited.hpp>))
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signals/component/detail/unfused_inherited.hpp>))
#include BOOST_PP_ITERATE()
}}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited_templated.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/detail/unfused_inherited_templated.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/detail/unfused_inherited_templated.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -42,7 +42,7 @@
//----- ---- --- -- - - - -
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signal/component/detail/unfused_inherited_templated.hpp>))
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signals/component/detail/unfused_inherited_templated.hpp>))
#include BOOST_PP_ITERATE()
}}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,7 +8,7 @@
#ifndef SIGNAL_NETWORK_FILTER_HPP
#define SIGNAL_NETWORK_FILTER_HPP
-#include <boost/dataflow/signal/component/filter_base.hpp>
+#include <boost/dataflow/signals/component/filter_base.hpp>
#include <boost/fusion/functional/adapter/fused.hpp>
#include <boost/fusion/include/as_vector.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter_base.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter_base.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/filter_base.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef SIGNAL_NETWORK_FILTER_BASE_HPP
#define SIGNAL_NETWORK_FILTER_BASE_HPP
-#include <boost/dataflow/signal/support.hpp>
+#include <boost/dataflow/signals/support.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/utility/enable_if.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/function.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/function.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/function.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,8 +6,8 @@
#ifndef SIGNAL_NETWORK_FUNCTION_HPP
#define SIGNAL_NETWORK_FUNCTION_HPP
-#include <boost/dataflow/signal/component/modifier.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
+#include <boost/dataflow/signals/component/modifier.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
#include <boost/function.hpp>
namespace boost { namespace signals {
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/instantiator.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/instantiator.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/instantiator.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,13 +8,13 @@
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS instantiator
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/instantiator.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/instantiator.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Member
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME member
#define SIGNAL_NETWORK_GENERIC_TYPENAME2 Instantiation
#define SIGNAL_NETWORK_GENERIC_STANDARD_RESULT
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
#define SIGNAL_NETWORK_INSTANTIATOR_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/junction.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/junction.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/junction.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef SIGNAL_NETWORK_JUNCTION_HPP
#define SIGNAL_NETWORK_JUNCTION_HPP
-#include <boost/dataflow/signal/component/conditional.hpp>
+#include <boost/dataflow/signals/component/conditional.hpp>
namespace boost { namespace signals {
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/modifier.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/modifier.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/modifier.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,12 +8,12 @@
#ifndef SIGNAL_NETWORK_GENERIC_CLASS
#define SIGNAL_NETWORK_GENERIC_CLASS modifier
-#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signal/component/modifier.hpp>
+#define SIGNAL_NETWORK_GENERIC_FILE <boost/dataflow/signals/component/modifier.hpp>
#define SIGNAL_NETWORK_GENERIC_TYPENAME Modification
#define SIGNAL_NETWORK_GENERIC_MEMBERNAME modification
#define SIGNAL_NETWORK_GENERIC_STANDARD_RESULT
-#include <boost/dataflow/signal/component/detail/generic_template.hpp>
+#include <boost/dataflow/signals/component/detail/generic_template.hpp>
#define SIGNAL_NETWORK_MODIFIER_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/multiplexer.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/multiplexer.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/multiplexer.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -7,8 +7,8 @@
#define SIGNAL_NETWORK_MULTIPLEXER_HPP
#include <boost/dataflow/connection/port_map.hpp>
-#include <boost/dataflow/signal/component/conditional_templated.hpp>
-#include <boost/dataflow/signal/connection/slot_selector.hpp>
+#include <boost/dataflow/signals/component/conditional_templated.hpp>
+#include <boost/dataflow/signals/connection/slot_selector.hpp>
#include <boost/fusion/container/map.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/mutex.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/mutex.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/mutex.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef SIGNAL_NETWORK_MUTEX_HPP
#define SIGNAL_NETWORK_MUTEX_HPP
-#include <boost/dataflow/signal/component/instantiator.hpp>
+#include <boost/dataflow/signals/component/instantiator.hpp>
#include <boost/thread/mutex.hpp>
namespace boost { namespace signals {
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_receiver.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_receiver.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_receiver.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,8 +8,8 @@
#ifndef SIGNAL_NETWORK_SOCKET_RECEIVER_HPP
#define SIGNAL_NETWORK_SOCKET_RECEIVER_HPP
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/detail/serialize_fusion_vector.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/detail/serialize_fusion_vector.hpp>
#include <sstream>
#include <boost/asio.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_sender.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_sender.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/socket_sender.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -8,9 +8,9 @@
#ifndef SIGNAL_NETWORK_SOCKET_SENDER_HPP
#define SIGNAL_NETWORK_SOCKET_SENDER_HPP
-#include <boost/dataflow/signal/component/detail/unfused_inherited.hpp>
-#include <boost/dataflow/signal/component/detail/serialize_fusion_vector.hpp>
-#include <boost/dataflow/signal/component/filter.hpp>
+#include <boost/dataflow/signals/component/detail/unfused_inherited.hpp>
+#include <boost/dataflow/signals/component/detail/serialize_fusion_vector.hpp>
+#include <boost/dataflow/signals/component/filter.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/asio.hpp>
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/storage.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/storage.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/storage.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,9 +6,9 @@
#ifndef BOOST_DATAFLOW_SIGNALS_COMPONENT_STORAGE_HPP
#define BOOST_DATAFLOW_SIGNALS_COMPONENT_STORAGE_HPP
-#include <boost/dataflow/signal/component/conditional_modifier.hpp>
-#include <boost/dataflow/signal/component/detail/storable.hpp>
-#include <boost/dataflow/signal/connection/slot_selector.hpp>
+#include <boost/dataflow/signals/component/conditional_modifier.hpp>
+#include <boost/dataflow/signals/component/detail/storable.hpp>
+#include <boost/dataflow/signals/connection/slot_selector.hpp>
#include <boost/dataflow/connection/port_map.hpp>
#include <boost/fusion/container/vector.hpp>
@@ -203,13 +203,10 @@
struct component_operation_impl<operations::invoke, boost::signals::storage_component_traits>
{
template<typename Invocable>
- struct apply
+ void operator()(Invocable &invocable)
{
- static void call(Invocable &invocable)
- {
- invocable.send();
- }
- };
+ invocable.send();
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/component/timed_generator.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/component/timed_generator.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/component/timed_generator.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -1,7 +1,7 @@
#ifndef SIGNAL_NETWORK_TIMED_GENERATOR_HPP
#define SIGNAL_NETWORK_TIMED_GENERATOR_HPP
-#include <boost/dataflow/signal/component/storage.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/condition.hpp>
Copied: sandbox/SOC/2007/signals/boost/dataflow/signals/connection.hpp (from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/connection.hpp)
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/connection.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/connection.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,8 +6,8 @@
#ifndef SIGNAL_NETWORK_CONNECTION_HPP
#define SIGNAL_NETWORK_CONNECTION_HPP
-#include <boost/dataflow/signal/support.hpp>
-#include <boost/dataflow/signal/connection/operators.hpp>
-#include <boost/dataflow/signal/connection/slot_selector.hpp>
+#include <boost/dataflow/signals/support.hpp>
+#include <boost/dataflow/signals/connection/operators.hpp>
+#include <boost/dataflow/signals/connection/slot_selector.hpp>
#endif
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/connection/detail/bind_object.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/connection/detail/bind_object.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/connection/detail/bind_object.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#if !defined(SIGNAL_NETWORK_BIND_OBJECT_HPP)
#if !defined(BOOST_PP_IS_ITERATING)
-#include <boost/dataflow/signal/connection/detail/slot_type.hpp>
+#include <boost/dataflow/signals/connection/detail/slot_type.hpp>
#include <boost/function_types/function_arity.hpp>
#include <boost/preprocessor/iterate.hpp>
@@ -27,7 +27,7 @@
struct bind_object : public bind_object_impl<Signature, T, boost::function_types::function_arity<Signature>::value>
{};
-# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,9,<boost/dataflow/signal/connection/detail/bind_object.hpp>))
+# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,9,<boost/dataflow/signals/connection/detail/bind_object.hpp>))
# include BOOST_PP_ITERATE()
} // namespace detail
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/connection/operators.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/connection/operators.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/connection/operators.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,7 +6,7 @@
#ifndef BOOST_DATAFLOW_SIGNALS_CONNECTION_OPERATORS_HPP
#define BOOST_DATAFLOW_SIGNALS_CONNECTION_OPERATORS_HPP
-#include <boost/dataflow/signal/support.hpp>
+#include <boost/dataflow/signals/support.hpp>
namespace boost { namespace signals {
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/connection/slot_selector.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/connection/slot_selector.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -10,9 +10,9 @@
#ifndef SIGNAL_NETWORK_SLOT_SELECTOR_HPP
#define SIGNAL_NETWORK_SLOT_SELECTOR_HPP
-#include <boost/dataflow/signal/connection/detail/bind_object.hpp>
-#include <boost/dataflow/signal/support.hpp>
-#include <boost/dataflow/signal/component/filter_base.hpp>
+#include <boost/dataflow/signals/connection/detail/bind_object.hpp>
+#include <boost/dataflow/signals/support.hpp>
+#include <boost/dataflow/signals/component/filter_base.hpp>
namespace boost { namespace dataflow { namespace signals {
@@ -72,17 +72,14 @@
struct get_keyed_port_impl<
signals::slot_selector_consumer, signals::producer<Signature> >
{
+ typedef const boost::function<Signature> result_type;
+
template<typename Consumer, typename Producer>
- struct apply
+ result_type operator()(Consumer &consumer, Producer &)
{
- typedef const boost::function<Signature> type;
-
- static type call(Consumer &consumer, Producer &)
- {
- return boost::signals::detail::bind_object<Signature, typename Consumer::class_type>()
- (static_cast<typename boost::signals::detail::slot_type<Signature, typename Consumer::class_type>::type>(consumer.func), consumer.object);
- }
- };
+ return boost::signals::detail::bind_object<Signature, typename Consumer::class_type>()
+ (static_cast<typename boost::signals::detail::slot_type<Signature, typename Consumer::class_type>::type>(consumer.func), consumer.object);
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signals/detail/unfused_typed_class.hpp
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/detail/unfused_typed_class.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/detail/unfused_typed_class.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -44,7 +44,7 @@
//----- ---- --- -- - - - -
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signal/detail/unfused_typed_class.hpp>))
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY, <boost/dataflow/signals/detail/unfused_typed_class.hpp>))
#include BOOST_PP_ITERATE()
}}
Copied: sandbox/SOC/2007/signals/boost/dataflow/signals/support.hpp (from r40904, /sandbox/SOC/2007/signals/boost/dataflow/signal/support.hpp)
==============================================================================
--- /sandbox/SOC/2007/signals/boost/dataflow/signal/support.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signals/support.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -7,7 +7,7 @@
#define SIGNAL_NETWORK_SIGNAL_SUPPORT_HPP
#include <boost/dataflow/support.hpp>
-#include <boost/dataflow/signal/connection/detail/bind_object.hpp>
+#include <boost/dataflow/signals/connection/detail/bind_object.hpp>
#include <boost/signal.hpp>
@@ -21,7 +21,7 @@
struct producer
: public port_traits<mechanism, ports::producer, concepts::port>
{
- typedef T produced_signature_type;
+ typedef T signature_type;
};
struct call_consumer
@@ -32,7 +32,7 @@
struct consumer
: public port_traits<mechanism, ports::consumer, concepts::port>
{
- typedef T consumed_signature_type;
+ typedef T signature_type;
};
} // namespace signals
@@ -54,16 +54,13 @@
template<typename Signature>
struct get_keyed_port_impl<signals::call_consumer, signals::producer<Signature> >
{
+ typedef const boost::function<Signature> result_type;
+
template<typename ConsumerPort, typename ProducerPort>
- struct apply
+ result_type operator()(ConsumerPort &consumer, ProducerPort &)
{
- typedef const boost::function<Signature> type;
-
- static type call(ConsumerPort &consumer, ProducerPort &)
- {
- return boost::signals::detail::bind_object<Signature, ConsumerPort>()
- (static_cast<typename boost::signals::detail::slot_type<Signature, ConsumerPort>::type>(&ConsumerPort::operator()), consumer);
- };
+ return boost::signals::detail::bind_object<Signature, ConsumerPort>()
+ (static_cast<typename boost::signals::detail::slot_type<Signature, ConsumerPort>::type>(&ConsumerPort::operator()), consumer);
};
};
@@ -71,13 +68,10 @@
struct binary_operation_impl<operations::connect, signals::producer<T>, signals::consumer<T> >
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- producer.connect(consumer);
- }
- };
+ producer.connect(consumer);
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/binary_operation.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/binary_operation.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/binary_operation.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -27,15 +27,12 @@
struct binary_operation_impl
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- // Error: binary_operation_impl has not been implemented
- // for ProducerTag and ConsumerTag.
- BOOST_STATIC_ASSERT(sizeof(Producer)==0);
- }
- };
+ // Error: binary_operation_impl has not been implemented
+ // for ProducerTag and ConsumerTag.
+ BOOST_STATIC_ASSERT(sizeof(Producer)==0);
+ }
};
}
@@ -49,15 +46,8 @@
Operation,
typename port_traits_of<Mechanism, ports::producer, ProducerNoCV>::type,
typename port_traits_of<Mechanism, ports::consumer, ConsumerNoCV>::type>
- ::template apply<
- typename boost::remove_reference<
- typename get_port_result_type<Mechanism, ports::producer, Producer>::type
- >::type,
- typename boost::remove_reference<
- typename get_port_result_type<Mechanism, ports::consumer, Consumer>::type
- >::type
- >::call(get_port<Mechanism, ports::producer>(producer),
- get_port<Mechanism, ports::consumer>(consumer));
+ ()(get_port<Mechanism, ports::producer>(producer),
+ get_port<Mechanism, ports::consumer>(consumer));
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/component_operation.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/component_operation.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/component_operation.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -27,21 +27,18 @@
template<typename Operation, typename ComponentTraits, typename Enable=void>
struct component_operation_impl
{
- template<typename Component>
- struct apply
+ struct detail
{
- struct detail
- {
- typedef void not_specialized;
- };
-
- static void call(Component &)
- {
- // Error: component_operation_impl Operation has not been
- // implemented for ComponentTraits.
- BOOST_STATIC_ASSERT(sizeof(Component)==0);
- }
+ typedef void not_specialized;
};
+
+ template<typename Component>
+ void operator()(Component &)
+ {
+ // Error: component_operation_impl Operation has not been
+ // implemented for ComponentTraits.
+ BOOST_STATIC_ASSERT(sizeof(Component)==0);
+ }
};
}
@@ -58,18 +55,18 @@
typename extension::component_operation_impl<
Operation,
typename component_traits_of<Mechanism, Component>::type
- >::template apply<Component>::detail::not_specialized
+ >::detail::not_specialized
>::type
>
: public mpl::false_ {};
template<typename Operation, typename Mechanism, typename Component>
-void component_operation(Component &producer)
+void component_operation(Component &component)
{
extension::component_operation_impl<
Operation,
typename component_traits_of<Mechanism, Component>::type
- >::template apply<Component>::call(producer);
+ >()(component);
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/invocable.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/invocable.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/invocable.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -43,27 +43,21 @@
struct invoke_impl
{
template<typename Invocable>
- struct apply
+ void operator()(Invocable &)
{
- static void call(Invocable &)
- {
- // Error: invoke_impl has not been implemented for InvocableTag.
- BOOST_STATIC_ASSERT(sizeof(Invocable)==0);
- }
- };
+ // Error: invoke_impl has not been implemented for InvocableTag.
+ BOOST_STATIC_ASSERT(sizeof(Invocable)==0);
+ }
};
template<>
struct invoke_impl<boost::dataflow::functor_invocable>
{
template<typename Invocable>
- struct apply
+ void operator()(Invocable &invocable)
{
- static void call(Invocable &invocable)
- {
- invocable();
- }
- };
+ invocable();
+ }
};
}
@@ -72,7 +66,7 @@
invoke(Invocable &invocable)
{
extension::invoke_impl<typename invocable_category_of<Invocable>::type>
- ::template apply<Invocable>::call(invocable);
+ ()(invocable);
}
template<typename Invocable>
@@ -80,7 +74,7 @@
invoke(const Invocable &invocable)
{
extension::invoke_impl<typename invocable_category_of<Invocable>::type>
- ::template apply<const Invocable>::call(invocable);
+ ()(invocable);
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/keyed_port.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/keyed_port.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/keyed_port.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -25,29 +25,29 @@
template<typename KeyedPortTag, typename KeyPortTag>
struct get_keyed_port_impl
{
+ typedef void result_type;
+
template<typename KeyedPort, typename Key>
- struct apply
+ void operator()(KeyedPort &, Key &)
{
- typedef void type;
- static void call(KeyedPort &, Key &)
- {
- // Error: get_keyed_port_impl has not been implemented
- // for KeyedPortTag and KeyPort.
- BOOST_STATIC_ASSERT(sizeof(KeyedPort)==0);
- }
- };
+ // Error: get_keyed_port_impl has not been implemented
+ // for KeyedPortTag and KeyPort.
+ BOOST_STATIC_ASSERT(sizeof(KeyedPort)==0);
+ }
};
}
template<typename Mechanism, typename PortCategory, typename T1, typename T2>
-typename extension::get_keyed_port_impl<
- typename port_traits_of<
- Mechanism, PortCategory, typename boost::remove_cv<T1>::type
- >::type,
- typename port_traits_of<
- Mechanism, typename PortCategory::complement, typename boost::remove_cv<T2>::type
- >::type
->::template apply<T1, T2>::type
+typename result_of<
+ extension::get_keyed_port_impl<
+ typename port_traits_of<
+ Mechanism, PortCategory, typename boost::remove_cv<T1>::type
+ >::type,
+ typename port_traits_of<
+ Mechanism, typename PortCategory::complement, typename boost::remove_cv<T2>::type
+ >::type
+ > (T1 &, T2 &)
+>::type
get_keyed_port(T1 &t1, T2 &t2)
{
return extension::get_keyed_port_impl<
@@ -57,7 +57,7 @@
typename port_traits_of<
Mechanism, typename PortCategory::complement, typename boost::remove_cv<T2>::type
>::type
- >::template apply<T1, T2>::call(t1, t2);
+ >()(t1, t2);
}
namespace extension
@@ -69,14 +69,11 @@
>::type >
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- binary_operation<Operation, typename ProducerTag::mechanism>
- (get_keyed_port<typename ProducerTag::mechanism, typename ProducerTag::category>(producer, consumer), consumer);
- }
- };
+ binary_operation<Operation, typename ProducerTag::mechanism>
+ (get_keyed_port<typename ProducerTag::mechanism, typename ProducerTag::category>(producer, consumer), consumer);
+ }
};
template<typename Operation, typename ProducerTag, typename ConsumerTag>
@@ -86,14 +83,11 @@
>::type >
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- binary_operation<Operation, typename ProducerTag::mechanism>
- (producer, get_keyed_port<typename ProducerTag::mechanism, typename ConsumerTag::category>(consumer, producer));
- }
- };
+ binary_operation<Operation, typename ProducerTag::mechanism>
+ (producer, get_keyed_port<typename ProducerTag::mechanism, typename ConsumerTag::category>(consumer, producer));
+ }
};
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -16,6 +16,7 @@
#include <boost/mpl/is_sequence.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_cv.hpp>
+#include <boost/utility/result_of.hpp>
namespace boost { namespace dataflow {
@@ -145,17 +146,20 @@
template<typename Traits>
struct get_port_impl
{
- template<typename T>
- struct apply
+ template<typename Args> struct result;
+
+ template<typename F, typename T>
+ struct result<F(T &) >
{
typedef T & type;
-
- static type call(T &p)
- {
- BOOST_MPL_ASSERT(( is_port<typename Traits::mechanism, typename Traits::category, T> ));
- return p;
- }
};
+
+ template<typename T>
+ T & operator()(T &p)
+ {
+ BOOST_MPL_ASSERT(( is_port<typename Traits::mechanism, typename Traits::category, T> ));
+ return p;
+ }
};
}
@@ -173,14 +177,16 @@
typename disable_if<is_proxy_port<Mechanism, PortCategory, T> >::type>
{
typedef
- typename
- extension::get_port_impl<
- typename port_traits_of<
- Mechanism,
- PortCategory,
- typename utility::underlying_type<T>::type
- >::type
- >::template apply<typename remove_reference<T>::type>::type type;
+ typename result_of<
+ typename
+ extension::get_port_impl<
+ typename port_traits_of<
+ Mechanism,
+ PortCategory,
+ typename utility::underlying_type<T>::type
+ >::type
+ >(T &)
+ >::type type;
};
template<typename Mechanism, typename PortCategory, typename T>
@@ -192,7 +198,7 @@
{
return extension::get_port_impl<
typename port_traits_of<Mechanism, PortCategory, typename boost::remove_cv<T>::type >::type
- >::template apply<T>::call(p);
+ >()(p);
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -10,6 +10,7 @@
#include <boost/dataflow/utility/copy_cv.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
+#include <boost/utility/result_of.hpp>
#include <boost/static_assert.hpp>
@@ -92,7 +93,7 @@
return
extension::get_port_impl<
typename proxy_port_traits_of<Mechanism, PortCategory, T>::type
- >::template apply<T>::call(t);
+ >()(t);
}
namespace extension
@@ -100,8 +101,10 @@
template<typename Mechanism, typename PortCategory, typename ProxiedPort, typename GetProxiedObject>
struct get_port_impl<default_proxy_port<Mechanism, PortCategory, ProxiedPort, GetProxiedObject> >
{
- template<typename ProxyPort>
- struct apply
+ template<typename Args> struct result;
+
+ template<typename F, typename ProxyPort>
+ struct result<F(ProxyPort &)>
{
typedef typename
get_port_result_type<
@@ -109,19 +112,22 @@
PortCategory,
typename utility::copy_cv<ProxiedPort,ProxyPort>::type
>::type type;
-
- static type call(ProxyPort &t)
- {
- return get_port<Mechanism, PortCategory>(GetProxiedObject()(t));
- }
};
+
+ template<typename ProxyPort>
+ typename result<get_port_impl(ProxyPort &)>::type operator()(ProxyPort &t)
+ {
+ return get_port<Mechanism, PortCategory>(GetProxiedObject()(t));
+ }
};
template<typename Mechanism, typename PortCategory, typename ProxiedPort, typename GetProxiedObject>
struct get_port_impl<mutable_proxy_port<Mechanism, PortCategory, ProxiedPort, GetProxiedObject> >
{
- template<typename ProxyPort>
- struct apply
+ template<typename Args> struct result;
+
+ template<typename F, typename ProxyPort>
+ struct result<F(ProxyPort &)>
{
typedef typename
get_port_result_type<
@@ -129,12 +135,13 @@
PortCategory,
ProxiedPort
>::type type;
-
- static type call(const ProxyPort &t)
- {
- return get_port<Mechanism, PortCategory>(GetProxiedObject()(t));
- }
};
+
+ template<typename ProxyPort>
+ typename result<get_port_impl(ProxyPort &)>::type operator()(const ProxyPort &t)
+ {
+ return get_port<Mechanism, PortCategory>(GetProxiedObject()(t));
+ }
};
}
@@ -147,13 +154,16 @@
{
typedef
typename
- extension::get_port_impl<
- typename proxy_port_traits_of<
- Mechanism,
- PortCategory,
- typename remove_cv<T>::type
- >::type
- >::template apply<T>::type type;
+ result_of<
+ typename
+ extension::get_port_impl<
+ typename proxy_port_traits_of<
+ Mechanism,
+ PortCategory,
+ typename remove_cv<T>::type
+ >::type
+ >(T &)
+ >::type type;
};
template<typename Mechanism, typename PortCategory, typename T>
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/unary_operation.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/unary_operation.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/unary_operation.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -27,21 +27,17 @@
template<typename Operation, typename PortTraits, typename Enable=void>
struct unary_operation_impl
{
- template<typename Producer>
- struct apply
+ struct detail
{
- struct detail
- {
- typedef void not_specialized;
- };
-
- static void call(Producer &)
- {
- // Error: unary_operation_impl Operation has not been
- // implemented for PortTraits.
- BOOST_STATIC_ASSERT(sizeof(Producer)==0);
- }
+ typedef void not_specialized;
};
+ template<typename Producer>
+ void operator()(Producer &)
+ {
+ // Error: unary_operation_impl Operation has not been
+ // implemented for PortTraits.
+ BOOST_STATIC_ASSERT(sizeof(Producer)==0);
+ }
};
}
@@ -59,7 +55,7 @@
typename extension::unary_operation_impl<
Operation,
typename port_traits_of<Mechanism, PortCategory, Producer>::type
- >::template apply<Producer>::detail::not_specialized
+ >::detail::not_specialized
>::type
>
: public mpl::false_ {};
@@ -70,7 +66,7 @@
extension::unary_operation_impl<
Operation,
typename port_traits_of<Mechanism, PortCategory, Port>::type
- >::template apply<Port>::call(producer);
+ >()(producer);
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -170,6 +170,7 @@
08F3FE0C0CA0975100F0E144 /* common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common.hpp; sourceTree = "<group>"; };
08F418080CBD69FE007E7F7A /* port.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = port.hpp; sourceTree = "<group>"; };
08F418AB0CBD7668007E7F7A /* proxy_port.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = proxy_port.hpp; sourceTree = "<group>"; };
+ 08F448760CD5368000E128A8 /* simple_example_components.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = simple_example_components.hpp; sourceTree = "<group>"; };
08F4FBB80C56AFDF00EB271A /* producer_wrapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = producer_wrapper.hpp; sourceTree = "<group>"; };
08F4FC170C56C96300EB271A /* producer_container.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = producer_container.hpp; sourceTree = "<group>"; };
08F585BE0C5A7ED70086F4F4 /* concepts.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = concepts.qbk; sourceTree = "<group>"; };
@@ -282,7 +283,7 @@
path = ../../test;
sourceTree = SOURCE_ROOT;
};
- 08EF9B200C5D506A00D4D206 /* signal */ = {
+ 08EF9B200C5D506A00D4D206 /* signals */ = {
isa = PBXGroup;
children = (
08FBDA3B0CD2748100CC3891 /* conditional_templated.hpp */,
@@ -293,7 +294,7 @@
08EF9B450C5D506A00D4D206 /* detail */,
08EF9B480C5D506A00D4D206 /* trait */,
);
- path = signal;
+ path = signals;
sourceTree = "<group>";
};
08EF9B210C5D506A00D4D206 /* component */ = {
@@ -498,6 +499,7 @@
08F98B3F0CD018E7009D642B /* signals */ = {
isa = PBXGroup;
children = (
+ 08F448760CD5368000E128A8 /* simple_example_components.hpp */,
08C3EEA20C625AE30074AB9E /* simple_example.cpp */,
08668C4E0C19A16300ACB19A /* simple_distributed_example.cpp */,
08F98B400CD0190A009D642B /* Jamfile.v2 */,
@@ -522,7 +524,7 @@
children = (
08F348960CC021CE006D0A67 /* utility */,
08F079940CA88EAB001E6E24 /* templates */,
- 08EF9B200C5D506A00D4D206 /* signal */,
+ 08EF9B200C5D506A00D4D206 /* signals */,
08F022C10C47556200C0ED27 /* connection */,
08F0216A0C473AE000C0ED27 /* detail */,
08F01F950C470E1500C0ED27 /* support */,
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/Jamfile.v2 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -18,9 +18,9 @@
# :
# [ glob ../../../boost/dataflow/support.hpp ]
# [ glob ../../../boost/dataflow/support/*.hpp ]
-# [ glob ../../../boost/dataflow/signal/*.hpp ]
-# [ glob ../../../boost/dataflow/signal/connection/*.hpp ]
-# [ glob ../../../boost/dataflow/signal/component/*.hpp ]
+# [ glob ../../../boost/dataflow/signals/*.hpp ]
+# [ glob ../../../boost/dataflow/signals/connection/*.hpp ]
+# [ glob ../../../boost/dataflow/signals/component/*.hpp ]
# :
# <doxygen:param>TAB_SIZE=4
# <doxygen:param>EXAMPLE_PATH=../test
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -113,7 +113,7 @@
[/Another important thing to note is that there is a separation between providing
the data to a component, and invoking the component. In some cases, the two
-happen simoultaneously (when the data is passed and returned via a function
+happen simultaneously (when the data is passed and returned via a function
call), while in others invoking the computational element can happen
separately from providing the data (at least from a modeling perspective).
An example of the latter is a consumer which uses data stored in
@@ -165,10 +165,15 @@
[variablelist
[[P] [A [ProducerPortConcept] type.]]
- [[C] [A [ConsumerPortConcept] type.
- [footnote `P` and `C` are [ConnectableConcept]]
+ [[C_C] [A [ConsumerPortConcept] [ConnectableConcept] with `P`]]
+ [[C_O] [A [ConsumerPortConcept] [OnlyConnectableConcept] with `P`]]
+ [[C_D] [A [ConsumerPortConcept] [DisconnectableConcept] with `P`]]
+ [[C_E] [A [ConsumerPortConcept] [ExtractableConcept] with `P`]]
[[p] [An object of type P.]]
- [[c] [An object of type C.]]
+ [[c_c] [An object of type C_C.]]
+ [[c_o] [An object of type C_O.]]
+ [[c_d] [An object of type C_D.]]
+ [[c_e] [An object of type C_E.]]
]
[heading Requirements]
@@ -176,16 +181,16 @@
[[Name] [Expression] [Result Type] [Description]]
[
[Connect]
- [`binary_operation<operations::connect, M>(p,c)`]
- [Any type]
+ [`binary_operation<operations::connect, M>(p,c_c)`]
+ [void]
[
Creates a lasting connection between the `p` and `c`.
]
]
[
[OnlyConnect]
- [`binary_operation<operations::connect_only, M>(p,c)`]
- [Any type]
+ [`binary_operation<operations::connect_only, M>(p,c_o)`]
+ [void]
[
Discards any lasting connections stored by `p` or `c`,
and creates a lasting connection between `p` and `c`.
@@ -195,16 +200,16 @@
]
[
[Disconnect]
- [`binary_operation<operations::disconnect, M>(p,c)`]
- [Any type]
+ [`binary_operation<operations::disconnect, M>(p,c_d)`]
+ [void]
[
Discards any existing connection between `p` and `c`.
]
]
[
[Extract]
- [`binary_operation<operations::extract, M>(p,c)`]
- [Any type]
+ [`binary_operation<operations::extract, M>(p,c_e)`]
+ [void]
[
Perfoms a one time transfer of data from `p` to `c`.
]
@@ -237,7 +242,7 @@
[
[Disconnect All]
[`unnary_operation<operations::disconnect_all, M>(p)`]
- [Any type]
+ [void]
[
Destroys any connections stored by `p`.
]
@@ -283,6 +288,10 @@
[section Component]
+[note The Component concept is not fully fleshed out. It lacks any
+functionality related to getting access to any [PortConcept] that is
+a part of the component.]
+
A type `C` is a ['[ComponentConcept]] for a mechanism `M`
if it specifies a [ComponentTraitsConcept] for that mechanism.
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -38,8 +38,10 @@
[template ComponentOperableConcept[] [link dataflow.concepts.componentoperable [^ComponentOperable]]]
[template InvocableConcept[] [link dataflow.concepts.componentoperable [^Invocable]]]
+[template SignalPortTraitsConcept[] [link dataflow.signals.concepts.signalporttraits [^SignalPortTraits]]]
[template SignalProducerConcept[] [link dataflow.signals.concepts.signalproducer [^SignalProducer]]]
[template SignalConsumerConcept[] [link dataflow.signals.concepts.signalconsumer [^SignalConsumer]]]
+
[template PhoenixProducerConcept[] [link dataflow.concepts.phoenix.phoenixproducer [^PhoenixProducer]]]
[template PhoenixConsumerConcept[] [link dataflow.concepts.phoenix.phoenixproducer [^PhoenixConsumer]]]
@@ -79,6 +81,7 @@
[template BoostFusion[] [@http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/index.html Boost.Fusion]]
[template BoostIostreams[] [@http://www.boost.org/libs/iostreams/doc/index.html]]
[template BoostSignals[] [@http://www.boost.org/doc/html/signals.html Boost.Signals]]
+[template BoostThread[] [@http://www.boost.org/doc/html/thread.html Boost.Thread]]
[template BoostPhoenix2[] [@http://spirit.sourceforge.net/ Boost.Phoenix2]]
[template BoostPhoenix[] [@http://spirit.sourceforge.net/ Boost.Phoenix]]
[template BoostAsio[] [@http://asio.sourceforge.net/boost_asio_0_3_8/libs/asio/doc/html/index.html Boost.Asio]]
@@ -91,6 +94,7 @@
[template vtkActor[] [@http://www.vtk.org/doc/nightly/html/classvtkActor.html ['vtkActor]]]
[template vtkRenderer[] [@http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html ['vtkRenderer]]]
+[template blueprint[] [link dataflow.future.blueprint blueprint]]
[import ../test/signals/test_connect.cpp]
@@ -113,8 +117,9 @@
[import ../test/signals/test_mutex.cpp]
[import ../example/fibonacci.cpp]
-[import ../example/simple_example.cpp]
-[import ../example/simple_distributed_example.cpp]
+[import ../example/signals/simple_example_components.hpp]
+[import ../example/signals/simple_example.cpp]
+[import ../example/signals/simple_distributed_example.cpp]
[import ../example/signals/intro_example.cpp]
[import ../example/VTK/support.hpp]
@@ -122,7 +127,8 @@
Dataflow is a generic library for [WikiDataflow] programming using various data
transport mechanisms. It also has layers of support for
two data transport mechanisms - one is based on
-[BoostSignals], and the other (experimental) is based connections made through
+[BoostSignals], and the other (experimental and currently broken) is based
+connections made through
simple object pointers, with support for using [BoostPhoenix2]
actors for data processing.
@@ -160,12 +166,31 @@
[section:discussion Discussion on Boost Community Feedback]
-The following summarizes some of the suggestions / comments given by the Boost community, and
-what has been done to incorporate this feedback.
+The following summarizes some of the suggestions / comments given by the Boost
+community, and what has been done to incorporate this feedback.
+
+[* Douglas Gregor has suggested the dataflow library could be applied to
+ [VTK] and [BoostIostreams], gave helpful suggestions on how deal with
+ fused/unfused issues in the [DataflowSignals] documentation and the code,
+ and suggested making the examples more connected to the introductory
+ examples and including visual diagrams for the dataflow networks.]
+
+* I have added an [link dataflow.introduction.examples.new_layer example]
+ of [VTK] support, but the library is not quite ready for [BoostIostreams].
+* As per Doug's suggestion, I have made the documentation focus on the
+ unfused components, and made the unfused components default in the
+ implementation.
+* I have started ASCII visual diagrams in the documentation.
+* Examples still need to be expanded and integrated more.
+
+[* Jake Voytko suggested having master table of [BoostDataflow] components
+ describing their use, adding instructions on linking with the library.]
+* A master table has been added to the [components] page.
+* I have started a [link dataflow.introduction.link linking] instruction page.
[* Tobias Schwinger indicated that the library could be used for pulling rather than pushing data.]
-* [link dataflow.connections.pull An example] which illustrates this has been addded.
+* [link dataflow.signals.introduction.examples.pull An example] which illustrates this has been addded.
[* James Jones suggested that a ||-like operator could be used for branching, and >> for chaining.]
@@ -177,7 +202,7 @@
[* Paolo Coletta suggested a "video_generator >>= ( effect1 && effect2 ) >>= image_sum" - like syntax that
would allow parallel processing of signals (identified as the "join" pattern by Yigong Liu)]
-* I have started to implement thread-related components in [timed_generator] and [mutex].
+* I have started to implement thread-related components in [timed_storage] and [mutex].
More sophisticated threading components, control and syntax to follow.
[* Yigong Liu suggested enhanced support for common network topologies, such as mesh. ]
@@ -239,9 +264,21 @@
[section:acknowledgements Acknowledgements]
-* Thanks to Douglas Gregor for making himself available as a mentor for this project, and for his support, suggestions and feedback.
-* Thanks to all the members of the Boost community who have expressed an interest in this library
- and contributed [link dataflow.discussion valuable feedback].
+* Thanks to the [@http://ame.asu.edu Arts, Media and Engineering Program] of
+ Arizona State University for
+ allowing the release of a prototype implementation of a boost::signal based
+ dataflow library for the purposes of proposing a Google Summer of
+ Code project.
+* Thanks to Google for funding and Boost for accepting the Dataflow library
+ as a GSoC project,
+ during which the library has been completely rewritten (several times) to
+ produce a much cleaner, more maintainable and more useful library.
+* Thanks to Douglas Gregor for making himself available as a mentor for the GSoC
+ project, and for his support, suggestions and feedback.
+* Thanks to all the members of the Boost community who have expressed an
+ interest in this library and contributed
+ [link dataflow.discussion valuable feedback], in particular Douglas Gregor and
+ Jake Voytko for in-depth reviews of the library.
* Thanks to Tobias Schwinger for a most valuable discussion on various
dataflow-oriented approaches and ideas.
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -1,16 +1,55 @@
[section:future Future Directions]
-There is also a planned /blueprint/ layer (not implemented yet), which
-would provide generic components that are used to provide a "big picture"
-of a dataflow network. A blueprint component corresponds to an actual,
+[section:blueprint The blueprint layer]
+
+The current focus of the Dataflow library are mechanisms in which the
+dataflow network is stored in the individual components - i.e., there
+is no global picture of the network available through the library.
+
+One way of adressing this shortcoming is a planned /blueprint/ layer, which
+would provide generic components that would provide this "big picture"
+of a dataflow network. A blueprint component corresponds to an actual
component - but whereas the actual component takes care of the work, the
blueprint component serves as a factory and serializer of the component.
Hence, a dataflow network blueprint, made out of blueprint components, could
be used to serialize or instantiate the underlying dataflow network made out
of actual components. The blueprint layer is likely to be implemented using
-virtual-based polymorphism and the Boost Graph library.
+run-time polymorphic classes and the Boost Graph library.
+
+[endsect]
+
+[section:gui GUI based dataflow network construction]
+
+Many dataflow-oriented frameworks have a visual programming environment.
+Examples are [@http://www.cycling74.com/products/maxmsp MAX/MSP] and
+[@http://www.ni.com/labview/ LabVIEW].
+
+The [@http://vcreatelogic.com/oss/vtkdesigner/index.html VTK Designer]
+has recently introduced a similar environment for C++ (and [VTK]),
+based on the [@http://vcreatelogic.com/oss/gcf/index.html Generic
+Component Framework] and is released under the GNU GPL license.
+
+Once the [blueprint] layer is built, it might be possible to integrate
+it with the Generic Component Framework to get a visual programming
+environment for the Dataflow library.
+
+[endsect]
-[section:pin Comparison with a pin-based approach, proposed by Tobias Schwinger]
+[section:layers Support for more layers]
+
+Several boost libraries are prime candidates for dataflow support, and the
+usefulness of the dataflow library would greatly increase either by adding
+support layers for these libraries, or providing examples of how to use these
+libraries with existing layers.
+
+Some of these libraries are:
+
+* Boost.Iostreams
+* Boost.GIL
+
+[endsect]
+
+[section:pin Supporing a pin-based approach, as proposed by Tobias Schwinger]
In the early stages of the design of the then called Signal Network
library, Tobias Schwinger discussed with me his ideas of an alternative
@@ -61,12 +100,6 @@
signal-based approach and the pin-based approach are not too different, and
perhaps even compatible or convertible between each other.
-[/In the pin-based approach, the situation is reversed. There is a "big picture" of what the complete
-network looks like, and the network control mechanism uses this information to decide when a component
-should be invoked and to manage the data shared between the components via pins. Global
-knowledge of the network can be used for better optimization, serialization, etc. However, it may
-come at the price of some intrusiveness to the computation components.]
-
[endsect]
[endsect][/future]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/introduction.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/introduction.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/introduction.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -15,7 +15,8 @@
[@http://en.wikipedia.org/wiki/Signal_processing signal processing],
e.g. a video signal processor which perhaps starts with a video input,
modifies it through a number of processing components (video filters),
-and finally outputs it to a video display.
+and finally outputs it to a video display. Another example is event
+processing.
[heading A motivating example]
@@ -72,7 +73,13 @@
To give you a sense of how you would do something like this using the Dataflow
library, we will present a slightly simplified example using [DataflowSignals].
Instead of processing images, we will just process numbers - but the dataflow
-parts of the code are pretty much the same:
+parts of the code are pretty much the same.
+
+We will first define a few components to use for our network:
+
+[simple_example_components]
+
+And then connect them in a dataflow network:
[simple_example]
@@ -279,7 +286,7 @@
The fundamental user-oriented generic elements, such as `is_producer`,
`producer_category_of` etc., are located in the `boost::dataflow` namespace.
-Function objects which must be specialized for different data trasport
+Function objects which must be specialized for different data transport
mechanisms, such as `connect_impl`, are in the `boost::dataflow::extension`
namespace. The connection operators are in `boost::dataflow::operators`.
@@ -362,7 +369,7 @@
[heading Next]
[link dataflow.introduction.examples.new_layer.producerconsumer
- Setting up a Producer and Consumer]
+ Setting up a ProducerPort and ConsumerPort]
[endsect][/mechanism]
[section:producerconsumer Setting up a ProducerPort and ConsumerPort]
@@ -375,8 +382,8 @@
In Dataflow concepts, [vtkAlgorithmOutput] can be made a [ProducerPortConcept]
- it corresponds to a single data output point. We support it as such by
-creating a [PortTraitsConcept], and associating [vtkAlgorithmOutput]
-with the producer category:
+defining a [PortTraitsConcept] type, and associating it with
+[vtkAlgorithmOutput].
[vtk_algorithm_output_producer]
@@ -427,7 +434,7 @@
[endsect][/connectable]
-[section:proxyproducer Setting up a ProxyProducer]
+[section:proxyproducer Setting up a ProxyPort]
In the VTK example above, both `vtkConeSource` and `vtkPolyDataMapper`
inherit [vtkAlgorithm].
@@ -441,7 +448,7 @@
forms its output connections using [vtkAlgorithmOutput] objects
returned through the `GetOutputPort` member functions, and we've already
configured [vtkAlgorithmOutput] as a [ProducerPortConcept], we can make use
-of the [ProxyProducerConcept] concept provided by the dataflow library.
+of the [ProxyPortConcept] concept provided by the dataflow library.
In effect, we will make [vtkAlgorithm] delegate it's [ProducerPortConcept]
functionality to [vtkAlgorithmOutput]:
@@ -457,7 +464,7 @@
[heading Next]
[link dataflow.introduction.examples.new_layer.filter
- Setting up a Filter (Producer+Consumer)]
+ Setting up a filter (ProducerPort+ConsumerPort)]
[endsect][/proxyproducer]
@@ -465,8 +472,7 @@
In a VTK pipeline, a [vtkActor] consumes data from a [vtkMapper], and produces
data for a [vtkRenderer]. In this case, we can provide Dataflow support
-for a [vtkActor] as both a [ProducerPortConcept] and a [ConsumerPortConcept] in one
-fell swoop:
+for a [vtkActor] as both a [ProducerPortConcept] and a [ConsumerPortConcept]:
[vtk_actor_filter]
@@ -581,7 +587,7 @@
which must be built and linked. A few of the components ([socket_sender]
and [socket_receiver]) are also dependent on [BoostAsio], which depends on
the System library which must also be built and linked. A few other components
-([mutex] and [condition]) are dependent on [BoostThreads], which has to be
+([mutex] and [condition]) are dependent on [BoostThread], which has to be
linked as well.
[endsect][/linking]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/port_concepts.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/port_concepts.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/port_concepts.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -50,7 +50,7 @@
[heading Notation]
[variablelist
- [[PC] [A PortTraits type.]]
+ [[PT] [A PortTraits type.]]
[[P] [A [PortConcept] type with port traits `PC`.]]
]
@@ -59,19 +59,19 @@
[[Name] [Expression] [Result Type] [Semantics]]
[
[Mechanism]
- [`PC::mechanism`]
+ [`PT::mechanism`]
[any type]
[[MechanismConcept] type tag.]
]
[
[Port Category]
- [`PC::port_category`]
+ [`PT::port_category`]
[[PortCategoryConcept] type]
[The category of the port]
]
[
[Port Concept]
- [`PC::port_concept`]
+ [`PT::port_concept`]
[`concepts::port`, `concepts::keyed_port`]
[The most refined producer concept that `P` satisfies.]
]
@@ -116,9 +116,10 @@
The following expressions are used in this document:
[variablelist
- [[P] [A Port type.]]
- [[M] [A [MechanismConcept] type.]]
- [[PC] [A [PortCategoryConcept] type.]]
+ [[`P`] [A Port type.]]
+ [[`M`] [A [MechanismConcept] type.]]
+ [[`PC`] [A [PortCategoryConcept] type.]]
+ [[`p`] [An object of type `P`]]
]
[heading Requirements]
@@ -141,6 +142,16 @@
concept.
]
]
+ [
+ [Get Port]
+ [`get_port<M,PC>()`]
+ [`get_port_result_type<M,PC,P>::type`]
+ [
+ Returns the underlying port object. With regular ports,
+ this is typically the same as `p`. With [ProxyPortConcept]
+ objects, it is typically the proxied port object.
+ ]
+ ]
]
[heading Header]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -2,17 +2,22 @@
[heading Naming conventions]
-* I encountered the term /dataflow/ after starting this library. Although the information I can find about dataflow as
- a programming paradigm seems to be a little sub-par, it seems like the right name for this programming paradigm.
- As a part of developing this library and doing the accompanying research I can work on improving the information that i
- out there (on Wikipedia, etc.)
-* I chose /component/ to refer to a processing element of a dataflow network, because the term has no prior (to my knowledge)
- C++ meaning.
-* In differentiating components that output data from those that input data, I originally thought about using "input component"
- and "output component". However, I realized that "input" and "output" switch depending on perspective - from the perspective
- of a component, it is "output" if it outputs data, but from the perspective of a corresponding connection, that same component is the
- "input". A better choice might be /producer/ and /consumer/ as they don't suffer from the same problem. Perhaps "provider"
- would be more accurate (since the component does not necessarily need to produce new data each time, but can keep providing
- the same data), but there is a precedent for using producer and consumer. The filter class might be renamed to producer.
+* I encountered the term /dataflow/ after starting this library. Although
+ the information I can find about dataflow as
+ a programming paradigm seems to be a little sub-par,
+ it seems like the right name for this programming paradigm.
+ As a part of developing this library and doing the accompanying research I
+ can work on improving the information that is out there (on Wikipedia, etc.)
+* I chose /component/ to refer to a processing element of a dataflow network,
+ because the term has no prior (to my knowledge) C++ meaning.
+* In differentiating components that output data from those that input data,
+ I originally thought about using "input component"
+ and "output component". However, I realized that "input" and "output"
+ switch depending on perspective - from the perspective
+ of a component, it is "output" if it outputs data, but from the perspective
+ of a corresponding connection, that same component is the
+ "input". A better choice might be /producer/ and /consumer/ as they don't
+ suffer from the same problem. Perhaps "provider"
+ would be more accurate, and there is a precedent for this nomenclature.
[endsect]
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/signals.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/signals.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/signals.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -2,7 +2,7 @@
[include signals/introduction.qbk]
-[/[include signals/concepts.qbk]]
+[include signals/concepts.qbk]
[include signals/connections.qbk]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/signals/components.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/signals/components.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/signals/components.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -6,10 +6,11 @@
[table
[[Component][Use]]
- [[[filter]][Base class for your own components]]
- [[[junction]][This will be renamed to gate, it controls whether signals pass through it]]
- [[[multiplexer]][Allows selection of which of the input ports is forwarded]]
- [[[counter]][Counts the number of signals passing through]]
+ [[[filter]][Base class for your own components.]]
+ [[[storage]][Stores signal arguments.]]
+ [[[counter]][Counts the number of signals passing through.]]
+ [[[junction]][Convenient when multiple producers need to be connected to the same set of consumers. Also has gate functionality.]]
+ [[[multiplexer]][Allows selection of which of the input ports is forwarded]]
[[[mutex]][Provides mutexing on incoming signals for multithreaded environments]]
[[[condition]][Signals a threading condition whenever a signal is received]]
[[[function]][Allows any Boost.Function object to be applied to a passing signal]]
@@ -148,10 +149,8 @@
The [storage] class can store the arguments it receives from a signal,
as well as transmit the stored argument values through its own signal.
-[table storage class use example
- [[fused][unfused]]
- [[[test_storage_fused]][[test_storage_unfused]]]
-]
+[test_storage_unfused]
+
[endsect][/storage]
[section:counter counter]
@@ -161,10 +160,7 @@
receives a signal, it will increment an internal
counter and forward the signal.
-[table counter class use example
- [[fused][unfused]]
- [[[test_counter_fused]][[test_counter_unfused]]]
-]
+[test_counter_unfused]
[endsect][/counter]
[endsect][/properties]
@@ -184,10 +180,8 @@
The [junction] class can be used to bring in multiple signals, and forward
them all to the same set of output signals.
-[table storage class use example
- [[fused][unfused]]
- [[[test_junction_fused]][[test_junction_unfused]]]
-]
+[test_junction_unfused]
+
[endsect][/junction]
[section multiplexer]
@@ -226,10 +220,8 @@
The [mutex] class locks an internal mutex when it receives a signal, and then forwards the signal.
[mutex] is an __instantiator__ with the Instantiation boost::mutex::scoped_lock and Member boost::mutex.
-[table mutex class use example
- [[fused][unfused]]
- [[[test_mutex_fused]][[test_mutex_unfused]]]
-]
+[test_mutex_unfused]
+
[endsect][/mutex]
[section:condition condition]
@@ -245,10 +237,8 @@
The [condition] class signals a threading condition when receiving a signal.
-[table mutex class use example
- [[fused][unfused]]
- [[[test_mutex_fused]][[test_mutex_unfused]]]
-]
+[test_mutex_unfused]
+
[endsect][/condition]
[endsect][/threading]
@@ -268,10 +258,7 @@
The [function] class can be used to apply a function to an incoming signal and output the result.
[function] is a __modifier__ with the Modifier set to an adapter for the provided function.
-[table function class use example
- [[fused][unfused]]
- [[[test_function_fused]][[test_function_unfused]]]
-]
+[test_function_unfused]
[endsect][/function]
@@ -316,7 +303,7 @@
[heading Description]
-The [socket_sender] class can be used to bridge a signal network accross multiple computers via a
+The [socket_sender] class can be used to bridge a signal network across multiple computers via a
network connection. Any signal going to the [socket_sender] will be serialized and sent over a provided
socket. A [socket_receiver] can be used on the other end to unserialize the signal and forward it.
@@ -335,7 +322,7 @@
[heading Description]
-The [socket_receiver] class can be used to bridge a signal network accross multiple computers via a
+The [socket_receiver] class can be used to bridge a signal network across multiple computers via a
network connection. Any signal going to the [socket_sender] will be serialized and sent over a provided
socket. A [socket_receiver] can be used on the other end to unserialize the signal and forward it.
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/signals/concepts.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/signals/concepts.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/signals/concepts.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -1,105 +1,132 @@
[section Concepts]
-[section SignalProducer]
-
-A [ProducerPortConcept] type `P` is a ['[SignalProducerConcept]] if it uses
-the boost::signal based data transport mechanism.
+[section:signalporttraits SignalPortTraits]
+A [PortTraitsConcept] type `T` is a [`[SignalPortTraitsConcept]] if
+its mechanism is `signals::mechanism`, and it specifies the signature
+of the underlying signal.
[heading Refinement of]
-* [ProducerPortConcept]
-* [ConnectableConcept] with [SignalConsumerConcept] of compatible consumed type.
+* [PortTraitsConcept]
[heading Notation]
The following expressions are used in this document:
[variablelist
- [[P] [A [SignalProducerConcept] type.]]
- [[C] [A [SignalConsumerConcept] type with compatible consumed type.]]
+ [[PT] [A [SignalPortTraitsConcept] type.]]
+ [[C] [A [ConnectableConcept] [SignalConsumerConcept].]]
[[p] [An object of type `p`.]]
[[c] [An object of type `c`.]]
]
[heading Requirements]
[table
- [[Name] [Expression] [Result Type] [Description]]
+ [[Name] [Expression] [Result Type] [Semantics]]
[
- [Connect]
- [`connect(p,c)`]
- [Any type]
- [
- *Semantics:* Connects `p` to `c`. Any previous
- connection coming out of `p` are left in tact.
- ]
+ [Mechanism]
+ [`PT::mechanism`]
+ [`dataflow::signals::mechanism`]
+ [[MechanismConcept] type tag.]
]
[
- [Signal Type]
- [`get_signal_type<P>::type`
- [footnote `namespace boost::dataflow::extension::signals`]]
- [`boost::signal` type]
- [
- *Semantics:* The type of signal storing the outgoing connections.
- ]
+ [Signature]
+ [`PT::signature_type`]
+ [`any function type`]
+ [Signature of the underlying `boost::signal`/`boost::function`.]
]
+]
+
+[endsect]
+
+[section SignalProducer]
+
+A [ProducerPortConcept] type `P` is a ['[SignalProducerConcept]] if its
+[PortTraitsConcept] is a [SignalPortTraitsConcept], and the `get_port` function
+returns the underlying `boost::signal`.
+
+[heading Refinement of]
+* [ProducerPortConcept]
+* [ConnectableConcept] with [SignalConsumerConcept] of same signature.
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[`P`] [A [SignalProducerConcept] type.]]
+ [[`PT`] [[PortTraitsConcept] of `P`]]
+ [[`C`] [A [ConnectableConcept] [SignalConsumerConcept].]]
+ [[`S`] [Signature of underlying signal]]
+ [[`p`] [An object of type `p`.]]
+ [[`c`] [An object of type `c`.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Description]]
[
[Signal]
- [`get_signal(p)`
- [footnote `namespace boost::dataflow::extension::signals`]]
- [`get_signal_type<P>::type &`]
+ [`dataflow::get_port(p)`]
+ [`boost::signal<PT::signal_type,...> &`]
[
- *Semantics:* Reference to the signal storing the outgoing connections.
+ Reference to the signal storing the outgoing connections.
]
]
]
-[heading Notes]
+[heading Header]
-To define a new [ProducerPortConcept] class type, it is sufficient to define
-member typedefs `producer_category` and `signal_type`, and specialize
-the `get_signal` template.
+The types, templates, and functions shown here are declared in the following
+files:
+
+```
+ #include <boost/dataflow/signals/support.hpp>
+```
[endsect][/signalproducer]
[section SignalConsumer]
-A type `T` is a ['[SignalConsumerConcept]] if it uses the boost::signal based
-data transport mechanism. I.e., it is [ConnectableConcept] to
+A [ConsumerPortConcept] type `P` is a ['[SignalConsumerConcept]] if its
+[PortTraitsConcept] is a [SignalPortTraitsConcept], and the `get_port` function
+returns the underlying `boost::function`.
[heading Refinement of]
* [ConsumerPortConcept]
-* [ConnectableConcept] with [SignalProducerConcept] of compatible produced type.
+* [ConnectableConcept] with [SignalProducerConcept] of same signature.
[heading Notation]
The following expressions are used in this document:
[variablelist
- [[P] [A [SignalProducerConcept] type.]]
- [[C] [A [SignalConsumerConcept] type s.t. .]]
+ [[`C`] [A [SignalConsumerConcept] type.]]
+ [[`PT`] [[PortTraitsConcept] of `C`]]
+ [[`P`] [A [ConnectableConcept] [SignalProducerConcept].]]
+ [[`S`] [Signature of underlying signal]]
+ [[`c`] [An object of type `c`.]]
+ [[`p`] [An object of type `p`.]]
]
[heading Requirements]
[table
[[Name] [Expression] [Result Type] [Description]]
[
- [Signal Connectable]
- [`connect(p,c)`]
- [Any type]
- [
- *Semantics:* Connects p to c. This overwrites any previous
- connection coming out of p.
- ]
- ]
- [
- [Slot]
- [`get_slot(c)`]
- [`boost::function` type]
+ [Signal]
+ [`dataflow::get_port(p)`]
+ [`boost::function<PT::signature_type>`]
[
- *Semantics:* Returns the `boost::function` referring to the
- consumer's slot (function / member function that accepts the
- data).
+ Boost.Function object for the slot.
]
]
]
+[heading Header]
+
+The types, templates, and functions shown here are declared in the following
+files:
+
+```
+ #include <boost/dataflow/signals/support.hpp>
+```
+
[endsect][/signalconsumer]
[endsect]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/signals/connections.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/signals/connections.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/signals/connections.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -1,25 +1,21 @@
-[section:connections Connections]
+[section:connections Functions, operators, and helper classes]
[section:connect connect function]
[*See also]: [funcref boost::signals::connect connect function reference.]
-The [connect] function is the fundamental connection-creating mechanism of
-the library. Given a /producer/ `p` and /consumer/ `c` supported by the library,
+[DataflowSignals] provides a [connect] function in the `boost::signals`
+namespace, which connects a [SignalProducerConcept] and [SignalConsumerConcept]
+which are [ConnectableConcept].
+
+Given a [SignalProducerConcept] `p` and [SignalConsumerConcept] `c`,
connect(p,c);
will create a connection between the two. The examples in this documentation typically
-use [operators] to create connections. The __operators__ use the __connect__ function
+use [operators] to create connections. The [operators] use the [connect] function
directly, and can be replaced by invocations of [connect] if preferred.
-The support for various types of components that are supported by [connect] is currently
-divided in the following files:
-
- #include <boost/signal_network/connection/signal.hpp>
-
-will add support for `boost::signal` as a producer, and function objects for which `boost::result_of` is defined
-as consumers.
#include <boost/signal_network/connection/slot_selector.hpp>
@@ -34,155 +30,53 @@
In addition, fusion maps can be used as signal producers if the underlying object of the front element is a signal
producer.
-[table connect example
- [[unfused]]
- [[[test_connect]]]
-]
-
-[endsect]
-
-[section:classes Classes]
-
-[section:slot_selector slot_selector]
-
-[*See also]: [classref boost::signals::slot_selector slot_selector class reference.]
-
-The [slot_selector] class is used to refer to a particular member function of a particular object, and can be used
-can be used as a receiver.
-
-[slot_selector] objects can be constructed using the [funcref boost::signals::make_slot_selector] function.
-See the [link dataflow.connections.examples.multiple_same Multiple inputs of the same signature] example.
+[test_connect]
[endsect]
-[endsect][/classes]
+[section:operators connection operators]
-[section:operators Operators]
-
-[section:chaining Chaining]
+[heading Chaining]
Chaining of components can be done using `operator >>=`.
-[table chaining example
- [[fused][unfused]]
- [[[test_storage_fused]][[test_storage_unfused]]]
-]
-
-[endsect][/chaining]
+[test_storage_unfused]
-[section:branching Branching]
+[heading Branching]
More complex connections can also be made relatively easily using
both `operator >>=`
and `operator |`, with `operator |` being used for branching.
-[table branching example
- [[fused][unfused]]
- [[[test_branching_fused]][[test_branching_unfused]]]
-]
-
-[endsect][/branching]
+[test_branching_unfused]
[endsect][/operators]
-[section Examples]
-
-[section:pull Pull-based networks]
-
-The [DataflowSignals] module was built with push-based networks in
-mind (the data producer sends data through a signal), but it can also
-be used for pull-based networks (the data consumer requests data through
-a signal).
-
-The following example illustrates this:
-
-[table pull-based network example
- [[fused][unfused]]
- [[[/test_pull_fused]][[test_pull_unfused]]]
-]
-
-The example uses the following classes:
-
-[test_pull_classes]
+[section invoke function]
-[endsect][/pull]
+[DataflowSignals] provides an [invoke] function in the `boost::signals`
+namespace, which invokes a [InvocableConcept] [DataflowSignals]
+[ComponentConcept].
-[section:disconnect Disconnecting]
-
-Connections can be terminated in two ways. One is through the "trackable"
-mechanism of Boost.Signals, which will automatically destroy connections
-to a trackable object when the object is destroyed. The other
-way is through the disconnect_all_slots method of the signal sender.
-
-[table disconnect example
- [[fused][unfused]]
- [[[/test_disconnect_fused]][[test_disconnect_unfused]]]
-]
-
-[endsect][/disconnect]
-
-[section:multiple_different Multiple slots of different signatures]
-
-It is simple to have an object provide multiple slots through operator() functions
-of different signatures. The following class does so through providing unary slots
-of different types:
-
-[test_multi_type_classes]
-
-[/The following class, on the other hand, uses slots of different number of arguments:
-
-[test_multi_type_classes]]
-
-In such cases, where the operator() functions differ in their signature,
-standard connection operators will work out the correct connection:
-
-[table multiple slots example
- [[fused][unfused]]
- [[[/test_multi_args_unfused]][[test_multi_args_unfused]]]
-]
-
-[endsect][/multiple_different]
-
-[section:multiple_same Multiple inputs of the same signature]
-
-In some cases, a class may want to receive multiple signals of the same
-signature. [/For example, the following class can receive a void() signal
-through its inherited operator() function, as well as through the
-operator() function of member "other":
-
-[test_same_type_class1]]
-
-For example, the following class could receive void() signals both
-through operator() and through AltInput:
-
-[test_same_type_classes]
-
-The following example shows how to connect signals to all of the above slots.
-For the class Signal2VoidInputs, this is accomplished using the
-slot_selector function:
+[endsect]
-[table multiple slots example
- [[fused][unfused]]
- [[[/test_same_type_fused]][[test_same_type_unfused]]]
-]
+[section:slot_selector slot_selector class]
-[endsect][/multiple_same]
+[*See also]: [classref boost::signals::slot_selector slot_selector class reference.]
-[section:multi_out Multiple outputs]
+The [slot_selector] class is used to refer to a particular member function of a particular object, and can be used
+can be used as a receiver.
-Multiple outputs can be achieved by introducing additional signals in the class.
+[slot_selector] objects can be constructed using the [funcref boost::signals::make_slot_selector] function.
+See the [link dataflow.connections.examples.multiple_same Multiple inputs of the same signature] example.
-[table multiple outs example
- [[fused][unfused]]
- [[[/test_multi_out_fused]][[test_multi_out_unfused]]]
-]
+[heading Models]
-The example uses the following classes:
+* [SignalConsumer]
+* [ProxyPortConcept]
-[test_multi_out_classes]
+[endsect][/slot_selector]
-[endsect][/multi_out]
-[endsect][/examples]
[endsect][/connections]
Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/signals/introduction.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/signals/introduction.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/signals/introduction.qbk 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -48,13 +48,13 @@
* can receive both fused and unfused signals
* has both a version that sends fused signals and a version that sends unfused signals.
-The type of sent signal is provided as a template argument to the class, and the default value can be set
-by defining `SIGNAL_NETWORK_DEFAULT_OUT` to either `unfused` or `fused` before including a sinal
-network component.
+The type of sent signal is provided as a template argument to the class, with
+the default value being `unfused`.
For example,
signals::storage<int (int, int &, const std::string &>), signals::unfused> unfused_storage;
+ signals::storage<int (int, int &, const std::string &>)> unfused_storage_by_default;
signals::storage<int (int, int &, const std::string &>), signals::fused> fused_storage;
In the above case, `unfused_storage` is similar to `f` above, and can be used as a slot
@@ -62,16 +62,21 @@
On the other hand, `fused_storage` acts as a function object similar to `fused_f` above.
Hence, it can be used as a slot for signals which carry a fusion container as an argument.
-[heading Examples often show both versions]
+[heading Examples mostly show unfused versions]
-The examples shown in this documentation often show both a fused and unfused
-version. In the vast majority of cases, when all of the components used are
-library-provided components, the fused and unfused examples are identical
-except for the specifications that the components should be fused or unfused.
+The examples shown in this documentation are mostly focused on the unfused
+versions of the components, since a user starting with the library
+is most likely to be using the library with unfused components.
+In the vast majority of cases, when all of the
+components used are library-provided components, the fused and unfused examples
+are identical except for the specifications that the components should be fused
+or unfused.
The biggest differences come into play when the examples
include user-implemented components - implementing a fused component can
be slightly (or greatly) different from implementing an unfused component.
+In these situations, the documentation should state the differences in code
+when using fused components.
[endsect][/fusion]
@@ -84,7 +89,7 @@
[DataflowSignals] provides many common building block components for a
signal-based dataflow network. The most basic is [storage], which
can be used to store a value received through a signal, send it on,
-and/or retreive it.
+and/or retrieve it.
By default, components in the library use `operator()` to receive a signal.
For example, when a [storage] object receives a signal through its `operator()`
@@ -142,4 +147,90 @@
[endsect][/start]
+[section Examples]
+
+[section:pull Pull-based networks]
+
+The [DataflowSignals] module was built with push-based networks in
+mind (the data producer sends data through a signal), but it can also
+be used for pull-based networks (the data consumer requests data through
+a signal).
+
+For example, the following component requests a value through a signal,
+and returns twice the value:
+
+[test_pull_classes]
+
+This class can be connected using the usual [operators]:
+
+[test_pull_unfused]
+
+[endsect][/pull]
+
+[section:disconnect Disconnecting]
+
+Connections can be terminated in two ways. One is through the "trackable"
+mechanism of Boost.Signals, which will automatically destroy connections
+to a trackable object when the object is destroyed. The other
+way is through the disconnect_all_slots method of the signal sender.
+
+[test_disconnect_unfused]
+
+[endsect][/disconnect]
+
+[section:multiple_different Multiple slots of different signatures]
+
+It is simple to have an object provide multiple slots through operator() functions
+of different signatures. The following class does so through providing unary slots
+of different types:
+
+[test_multi_type_classes]
+
+[/The following class, on the other hand, uses slots of different number of arguments:
+
+[test_multi_type_classes]]
+
+In such cases, where the operator() functions differ in their signature,
+standard connection operators will work out the correct connection:
+
+[test_multi_args_unfused]
+
+[endsect][/multiple_different]
+
+[section:multiple_same Multiple inputs of the same signature]
+
+In some cases, a class may want to receive multiple signals of the same
+signature. [/For example, the following class can receive a void() signal
+through its inherited operator() function, as well as through the
+operator() function of member "other":
+
+[test_same_type_class1]
+
+For example, the following class could receive void() signals both
+through operator() and through AltInput:
+
+[test_same_type_classes]
+
+The following example shows how to connect signals to all of the above slots.
+For the class Signal2VoidInputs, this is accomplished using the
+slot_selector function:
+
+[test_same_type_unfused]
+
+[endsect][/multiple_same]
+
+[section:multi_out Multiple outputs]
+
+Multiple outputs can be achieved by introducing additional signals in the class.
+
+[test_multi_out_unfused]
+
+The example uses the following classes:
+
+[test_multi_out_classes]
+
+[endsect][/multi_out]
+
+[endsect][/examples]
+
[endsect][/introduction]
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -69,30 +69,31 @@
//[ vtk_connect_impl_algorithm
namespace boost { namespace dataflow { namespace extension {
+// To implement Connectable, we specialize the binary_operation_impl
+// functor template. We specify three things:
+// operation (operations::connect)
+// producer PortTraits (vtk::vtk_algorithm_output_producer)
+// consumer PortTraits (vtk::vtk_algorithm_consumer)
template<>
struct binary_operation_impl<operations::connect, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- consumer.AddInputConnection(&producer);
- }
- };
+ consumer.AddInputConnection(&producer);
+ }
};
+// To implement OnlyConnectable, we do the same thing except now the operation
+// is operations::connect_only
template<>
struct binary_operation_impl<operations::connect_only, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- consumer.SetInputConnection(&producer);
- }
- };
+ consumer.SetInputConnection(&producer);
+ }
};
} } } // namespace boost::dataflow::vtk
@@ -104,11 +105,15 @@
namespace boost { namespace dataflow { namespace vtk {
+// First we need a ProxyPortTraits type
struct vtk_algorithm_proxy_producer
: public proxy_port_traits<mechanism, ports::producer> {};
} } } // namespace boost::dataflow::vtk
+// Then we associate all descendants of vtkAlgorithm with the ProxyPortTraits.
+// vtkMapper is a descendant of vtkAlgorithm, but we want to exclude it's
+// descendants from this registration because they will be treated differently.
DATAFLOW_PROXY_PORT_TRAITS_ENABLE_IF(
T,
mpl::and_<
@@ -119,19 +124,17 @@
namespace boost { namespace dataflow { namespace extension {
+// Finally, we specialize the get_port_impl functor template.
template<>
struct get_port_impl<vtk::vtk_algorithm_proxy_producer>
{
+ typedef vtkAlgorithmOutput & result_type;
+
template<typename ProxyProducer>
- struct apply
+ result_type operator()(ProxyProducer &t)
{
- typedef vtkAlgorithmOutput &type;
-
- static type call(ProxyProducer &t)
- {
- return *t.GetOutputPort();
- }
- };
+ return *t.GetOutputPort();
+ }
};
} } } // namespace boost::dataflow::extension
@@ -168,9 +171,15 @@
namespace boost { namespace dataflow { namespace vtk {
+// First we need a PortTraits type that we will use for vtkMapper connections.
struct vtk_mapper_producer
: public port_traits<mechanism, ports::producer, concepts::port> {};
+// Since vtkMapper itself will have multiple "faces" (depending on what we
+// are connecting to it), we will define a proxy type for vtkMapper that we
+// will use to specify that we want to use the mapper output for a vtkActor.
+// (rather than wanting to use the output for a vtkAlgorithm, in for which
+// we can use vtkAlgorithmOutput as the proxy object).
struct vtk_mapper_proxy : public port<vtk_mapper_producer>
{
vtkMapper *ptr;
@@ -178,20 +187,23 @@
operator vtkMapper * () const {return ptr;}
};
+// Next, we define a fusion map type to hold the mapping between consumers
+// and Port types.
typedef boost::fusion::map<
boost::fusion::pair<vtk::vtk_algorithm_consumer, vtkAlgorithmOutput &>,
boost::fusion::pair<vtk::vtk_actor_consumer, vtk_mapper_proxy>
> vtk_mapper_map;
+// ...And a ProxyPortTraits type...
struct vtk_mapper_proxy_producer
: public proxy_port_traits<
vtk::mechanism,
ports::producer
-// port_map<mechanism, ports::producer, vtk_mapper_map>
> {};
} } } // namespace boost::dataflow::vtk
+// ... that we associate with vtkMapper descendants.
DATAFLOW_PROXY_PORT_TRAITS_ENABLE_IF(
T,
boost::is_base_of<vtkMapper BOOST_PP_COMMA() T>,
@@ -199,48 +211,45 @@
namespace boost { namespace dataflow { namespace extension {
+// Now we specialize the get_port_imple functor template that will return
+// a port_map for a port with vtk_mapper_proxy_producer ProxyPortTraits.
+// The port_map object is a KeyedPort and takes care of providing the
+// appropriate Port depending on the consumer.
template<>
struct get_port_impl<vtk::vtk_mapper_proxy_producer>
{
+ typedef const port_map<vtk::mechanism, ports::producer, vtk::vtk_mapper_map> result_type;
+
template<typename ProxyProducer>
- struct apply
+ result_type operator()(ProxyProducer &t)
{
- typedef const port_map<vtk::mechanism, ports::producer, vtk::vtk_mapper_map> type;
-
- static type call(ProxyProducer &t)
- {
- return vtk::vtk_mapper_map(t.GetNumberOfOutputPorts() ?
- *t.GetOutputPort() : *(vtkAlgorithmOutput *)NULL,
- vtk::vtk_mapper_proxy(&t));
- }
- };
+ return vtk::vtk_mapper_map(t.GetNumberOfOutputPorts() ?
+ *t.GetOutputPort() : *(vtkAlgorithmOutput *)NULL,
+ vtk::vtk_mapper_proxy(&t));
+ }
};
+// Finally, we provide implementations for connect and connect_only
+// between vtk_mapper_producer and vtk_actor_consumer
template<>
struct binary_operation_impl<operations::connect_only, vtk::vtk_mapper_producer, vtk::vtk_actor_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- consumer.SetMapper(producer);
- }
- };
+ consumer.SetMapper(producer);
+ }
};
template<>
struct binary_operation_impl<operations::connect, vtk::vtk_mapper_producer, vtk::vtk_actor_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- BOOST_ASSERT(!consumer.GetMapper());
- consumer.SetMapper(producer);
- }
- };
+ BOOST_ASSERT(!consumer.GetMapper());
+ consumer.SetMapper(producer);
+ }
};
} } } // namespace boost::dataflow::extension
@@ -288,26 +297,20 @@
struct binary_operation_impl<operations::connect, vtk::vtk_actor_producer, vtk::vtk_renderer_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- consumer.AddActor(&producer);
- }
- };
+ consumer.AddActor(&producer);
+ }
};
template<>
struct binary_operation_impl<operations::connect, vtk::vtk_renderer_producer, vtk::vtk_rendererwindow_consumer>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &producer, Consumer &consumer)
{
- static void call(Producer &producer, Consumer &consumer)
- {
- consumer.AddRenderer(&producer);
- }
- };
+ consumer.AddRenderer(&producer);
+ }
};
} } } // namespace boost::dataflow::extension
@@ -345,31 +348,25 @@
template<typename T>
struct get_port_impl<vtk::pointer_proxy_producer<T> >
{
+ typedef T & result_type;
+
template<typename ProxyProducer>
- struct apply
+ result_type operator()(ProxyProducer &t)
{
- typedef T & type;
-
- static type call(ProxyProducer &t)
- {
- return *t;
- }
- };
+ return *t;
+ }
};
template<typename T>
struct get_port_impl<vtk::pointer_proxy_consumer<T> >
{
+ typedef T & result_type;
+
template<typename ProxyConsumer>
- struct apply
+ result_type operator()(ProxyConsumer &t)
{
- typedef T & type;
-
- static type call(ProxyConsumer &t)
- {
- return *t;
- }
- };
+ return *t;
+ }
};
} // namespace extension
@@ -379,8 +376,11 @@
//]
//[ vtk_specialize_connect
+// the include templates expect DATAFLOW_TEMPLATE_MECHANISM to have
+// the template type
#define DATAFLOW_TEMPLATE_MECHANISM boost::dataflow::vtk::mechanism
+// the binary_operation.hpp template expects DATAFLOW_TEMPLATE_BINARY_OPERATION
#define DATAFLOW_TEMPLATE_BINARY_OPERATION connect
#include <boost/dataflow/templates/binary_operation.hpp>
#undef DATAFLOW_TEMPLATE_BINARY_OPERATION
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/signals/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/signals/Jamfile.v2 (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/signals/Jamfile.v2 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -11,9 +11,9 @@
;
exe intro_example : intro_example.cpp ;
-exe simple_example : simple_example.cpp /boost/thread//boost_thread/<link>static/<thrd-api>pthread ;
+exe simple_example : simple_example.cpp /boost/thread//boost_thread/<link>static ;
exe simple_distributed_example : simple_distributed_example.cpp
/boost/serialization//boost_serialization/<link>static
- /boost/thread//boost_thread/<link>static/<thrd-api>pthread
+ /boost/thread//boost_thread/<link>static
/boost/system//boost_system/<link>static ;
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/signals/intro_example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/signals/intro_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/signals/intro_example.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,8 +3,8 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
using namespace boost;
@@ -51,7 +51,7 @@
{
//[ signal_void_counter_main
SignalVoidCounter counter;
- signals::storage<void(), signals::unfused> storage;
+ signals::storage<void()> storage;
storage >>= counter;
for (int i=0; i<33; i++)
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_distributed_example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_distributed_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_distributed_example.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,59 +3,24 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+
//[ simple_distributed_example
-#include <boost/asio.hpp>
+#include <boost/dataflow/signals/component/socket_receiver.hpp>
+#include <boost/dataflow/signals/component/socket_sender.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/timed_generator.hpp>
+#include <boost/dataflow/signals/connection.hpp>
-#include <boost/dataflow/signal/component/socket_receiver.hpp>
-#include <boost/dataflow/signal/component/socket_sender.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/timed_generator.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/normal_distribution.hpp>
-#include <boost/random/variate_generator.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
-#include <iostream>
+
+#include "simple_example_components.hpp"
+
using namespace boost;
-// This will be our data processor. The signature void(double) designates
-// the output signal (we will be sending out an double). The signals
-// we can receive depend on how we overload operator().
-class processor : public signals::filter<void (double)>
-{
-public:
- // Initialize the Gaussian noise generator.
- processor() : generator(mt, dist) {}
-
- // Receive void(double) signals, add some Gaussian noise, and send
- // out the modified value.
- void operator()(double x)
- {
- out(x + generator());
- }
-private:
- mt19937 mt;
- normal_distribution<> dist;
- boost::variate_generator<mt19937&, boost::normal_distribution<> > generator;
-};
-
-// This will be our data output. We just need to make a function object,
-// and specify that it is a signals::call_consumer.
-class output
-{
-public:
- typedef dataflow::signals::call_consumer port_traits;
-
- void operator()(double x)
- {
- std::cout << x << std::endl;
- }
-};
mutex mutex_;
condition cond;
@@ -81,13 +46,19 @@
// at a specified time interval. We'll store a value of 0 to be sent out.
// The signature void(double) specifies that the signal carries a double,
// and that there is no return value.
- signals::timed_generator<void (double), signals::unfused> input(0);
+ signals::timed_generator<void (double)> input(0);
// To have our dataflow network straddle a network connection,
// we need a socket_sender
signals::socket_sender<void (double)> sender(socket);
- // create the network
- input >>= sender;
+ // ---Connect the dataflow network ---------------------
+ //
+ // ,---------. ,---------.
+ // | input | --> | sender --- -- - (socket)
+ // `---------' `---------'
+ //
+ // -----------------------------------------------------
+ input >>= sender;
// Tell the source to start producing data, every 0.5s:
input.enable(0.5);
@@ -116,10 +87,16 @@
// Setup data processor and output:
processor proc;
output out;
- signals::socket_receiver<void (double), signals::unfused> receiver(socket);
+ signals::socket_receiver<void (double)> receiver(socket);
- // set up the network
- receiver >>= proc >>= out;
+ // ---Connect the dataflow network -----------------------------
+ //
+ // ,---------. ,---------. ,---------.
+ // (socket) - -- --- receiver | --> | proc | --> | out |
+ // `---------' `---------' `---------'
+ //
+ // -------------------------------------------------------------
+ receiver >>= proc >>= out;
// start asynchronous receiving
receiver.async_read();
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -5,50 +5,13 @@
//[ simple_example
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/timed_generator.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/normal_distribution.hpp>
-#include <boost/random/variate_generator.hpp>
-#include <iostream>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/timed_generator.hpp>
+#include <boost/dataflow/signals/connection.hpp>
+#include "simple_example_components.hpp"
-using namespace boost;
-// This will be our data processor. The signature void(double) designates
-// the output signal (we will be sending out an double). The signals
-// we can receive depend on how we overload operator().
-class processor : public signals::filter<void (double)>
-{
-public:
- // Initialize the Gaussian noise generator.
- processor() : generator(mt, dist) {}
-
- // Receive void(double) signals, add some Gaussian noise, and send
- // out the modified value.
- void operator()(double x)
- {
- out(x + generator());
- }
-private:
- mt19937 mt;
- normal_distribution<> dist;
- boost::variate_generator<mt19937&, boost::normal_distribution<> > generator;
-};
-
-// This will be our data output. We just need to make a function object,
-// and specify that it is a signals::call_consumer.
-class output
-{
-public:
- typedef dataflow::signals::call_consumer port_traits;
-
- void operator()(double x)
- {
- std::cout << x << std::endl;
- }
-};
+using namespace boost;
int main(int, char* [])
{
@@ -57,14 +20,21 @@
// at a specified time interval. We'll store a value of 0 to be sent out.
// The signature void(double) specifies that the signal carries a double,
// and that there is no return value.
- signals::timed_generator<void (double), signals::unfused> input(0);
+ signals::timed_generator<void (double)> input(0);
// Data processor and output:
processor proc;
output out;
- // Now connect the network:
+ // ---Connect the dataflow network ---------------------
+ //
+ // ,---------. ,---------. ,---------.
+ // | input | --> | proc | --> | out |
+ // `---------' `---------' `---------'
+ //
+ // -----------------------------------------------------
input >>= proc >>= out;
+
// If you prefer, you can also do:
// connect(input, proc);
// connect(proc, out);
Copied: sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example_components.hpp (from r40538, /sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example_components.hpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,11 +3,9 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-//[ simple_example
+//[ simple_example_components
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/timed_generator.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/filter.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/normal_distribution.hpp>
@@ -17,7 +15,7 @@
using namespace boost;
// This will be our data processor. The signature void(double) designates
-// the output signal (we will be sending out an double). The signals
+// the output signal (we will be sending out a double). The signals
// we can receive depend on how we overload operator().
class processor : public signals::filter<void (double)>
{
@@ -50,36 +48,4 @@
}
};
-int main(int, char* [])
-{
- // For our data source, we will use timed_generator,
- // which creates its own thread and outputs it's stored value
- // at a specified time interval. We'll store a value of 0 to be sent out.
- // The signature void(double) specifies that the signal carries a double,
- // and that there is no return value.
- signals::timed_generator<void (double), signals::unfused> input(0);
-
- // Data processor and output:
- processor proc;
- output out;
-
- // Now connect the network:
- input >>= proc >>= out;
- // If you prefer, you can also do:
- // connect(input, proc);
- // connect(proc, out);
-
- // Tell the source to start producing data, every 0.5s:
- input.enable(0.5);
-
- // take a little nap :-)
- boost::xtime xt;
- boost::xtime_get(&xt, boost::TIME_UTC);
- xt.sec += 10;
- boost::thread::sleep(xt);
-
- input.join();
- return 0;
-}
-
//]
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/timing_example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/timing_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/timing_example.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -23,8 +23,8 @@
std::vector<float> v(1);
// instantiate all of the components we need
- signals::storage<void (std::vector<float> &, std::vector<float>), signals::unfused> floater;
- signals::storage<void (std::vector<float> &, std::vector<float>), signals::unfused> collector;
+ signals::storage<void (std::vector<float> &, std::vector<float>)> floater;
+ signals::storage<void (std::vector<float> &, std::vector<float>)> collector;
// create the network
floater >>= collector;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_bind_object.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_bind_object.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_bind_object.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,7 +3,7 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/connection/detail/bind_object.hpp>
+#include <boost/dataflow/signals/connection/detail/bind_object.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -15,15 +15,28 @@
{
{
//[ test_branching_unfused
- signals::storage<void (), signals::unfused> banger;
- signals::counter<void (), signals::unfused> counter;
- signals::storage<void (float), signals::unfused> floater(2.5f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
+ signals::storage<void ()> banger;
+ signals::counter<void ()> counter;
+ signals::storage<void (float)> floater(2.5f);
+ signals::storage<void (float)> collector(0.0f);
+
+ // ---Connect the dataflow network -----------------------------
+ //
+ // ,--------. void() ,---------.
+ // | banger | -------+-------> | counter |
+ // `--------' | `---------'
+ // |
+ // V
+ // ,-(send_slot)-. void(float) ,-----------.
+ // | floater | -------------> | collector |
+ // `-------------' `-----------'
+ //
+ // -------------------------------------------------------------
+
banger
- // floater connects to collector, banger to floater.send_slot()
- | (floater.send_slot() >>= collector)
- | counter; // and banger to counter
+ | counter
+ | (floater.send_slot() >>= collector);
banger();
BOOST_CHECK_EQUAL(counter.count(), 1);
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/chain.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/chain.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp>
@@ -16,7 +16,7 @@
using namespace boost;
//[ test_chain_classes
-class UnfusedDoublerClass : public signals::filter<void (float), signals::unfused>
+class UnfusedDoublerClass : public signals::filter<void (float)>
{
public:
typedef void result_type;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,7 +3,7 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/support.hpp>
+#include <boost/dataflow/signals/support.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -12,8 +12,6 @@
struct receiver
: public boost::dataflow::port<boost::dataflow::signals::call_consumer>
{
- typedef void result_type;
-
receiver() : stored(0) {}
void operator()(int x)
@@ -30,7 +28,7 @@
boost::signal<void(int)> p;
receiver r;
- boost::dataflow::binary_operation<boost::dataflow::operations::connect, boost::dataflow::signals::mechanism>(p, r);
+ connect(p, r);
p(3);
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connections.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connections.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connections.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -12,22 +12,22 @@
#define BOOST_SIGNALS_STATIC_LINK
#include <boost/optional.hpp>
-#include <boost/dataflow/signal/filter.hpp>
-#include <boost/dataflow/signal/storage.hpp>
-#include <boost/dataflow/signal/junction.hpp>
-#include <boost/dataflow/signal/selector.hpp>
-#include <boost/dataflow/signal/mutex.hpp>
-#include <boost/dataflow/signal/timed_generator.hpp>
-#include <boost/dataflow/signal/function.hpp>
-#include <boost/dataflow/signal/chain.hpp>
+#include <boost/dataflow/signals/filter.hpp>
+#include <boost/dataflow/signals/storage.hpp>
+#include <boost/dataflow/signals/junction.hpp>
+#include <boost/dataflow/signals/selector.hpp>
+#include <boost/dataflow/signals/mutex.hpp>
+#include <boost/dataflow/signals/timed_generator.hpp>
+#include <boost/dataflow/signals/function.hpp>
+#include <boost/dataflow/signals/chain.hpp>
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define _WIN32_WINDOWS
#endif
-#include <boost/dataflow/signal/socket_receiver.hpp>
-#include <boost/dataflow/signal/socket_sender.hpp>
+#include <boost/dataflow/signals/socket_receiver.hpp>
+#include <boost/dataflow/signals/socket_sender.hpp>
#undef _WIN32_WINDOWS
// for access to connection operators >>= and |
@@ -61,16 +61,16 @@
}
};
-class SignalMultiInheritedCollector : public signals::storage<void (float), signals::unfused>, public SignalVoidCounter, public SignalFloat2Collector
+class SignalMultiInheritedCollector : public signals::storage<void (float)>, public SignalVoidCounter, public SignalFloat2Collector
{
public:
- SignalMultiInheritedCollector() : signals::storage<void (float), signals::unfused>(0) {}
+ SignalMultiInheritedCollector() : signals::storage<void (float)>(0) {}
};
void multi_num_args_inherited_test()
{
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater;
+ signals::storage<void ()> banger;
+ signals::storage<void (float)> floater;
floater(2.5f);
SignalFloatDuplicator duplicator;
SignalMultiInheritedCollector collector;
@@ -79,7 +79,7 @@
| (SignalVoidCounter &) collector
|
(floater
- | (signals::storage<void (float), signals::unfused> &) collector
+ | (signals::storage<void (float)> &) collector
| (duplicator >>= (SignalFloat2Collector &) collector));
banger();
@@ -94,11 +94,11 @@
void selector_test()
{
-/* signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater1, floater2;
+/* signals::storage<void ()> banger;
+ signals::storage<void (float)> floater1, floater2;
floater1(1.0f);
floater2(2.0f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
+ signals::storage<void (float)> collector(0.0f);
signals::selector<2, void (float)> selector;
banger >>= floater1 >>= selector.slot1();
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_counter.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_counter.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_counter.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,7 +3,7 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/counter.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -13,7 +13,7 @@
{
{
//[ test_counter_unfused
- signals::counter<void (), signals::unfused> counter;
+ signals::counter<void ()> counter;
for (int i=0; i<33; i++)
counter();
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -15,12 +15,12 @@
{
{
//[ test_disconnect_unfused
- signals::storage<void (), signals::unfused> banger;
+ signals::storage<void ()> banger;
{
- signals::counter<void (), signals::unfused> counter;
- signals::storage<void (float), signals::unfused> floater;
+ signals::counter<void ()> counter;
+ signals::storage<void (float)> floater;
floater(2.5f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
+ signals::storage<void (float)> collector(0.0f);
banger | counter;
floater >>= collector;
@@ -42,7 +42,7 @@
#endif
BOOST_CHECK_EQUAL(banger.get_proxied_producer().num_slots(), 0u);
- signals::counter<void (), signals::unfused> counter;
+ signals::counter<void ()> counter;
banger >>= counter;
banger.disconnect_all_slots();
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/filter.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/filter.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
@@ -15,7 +15,7 @@
//[ test_filter_classes
-class DoublerClass : public signals::filter<void (float), signals::unfused>
+class DoublerClass : public signals::filter<void (float)>
{
public:
void operator()(float x) {out(2*x);}
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/function.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/function.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -15,12 +15,12 @@
{
{
//[ test_function_unfused
- signals::function<void (float), float(float), signals::unfused>
+ signals::function<void (float), float(float)>
double_fun1(boost::bind(std::multiplies<float>(), _1, 2.0f));
- signals::function<void (float), float(float), signals::unfused>
+ signals::function<void (float), float(float)>
double_fun2(boost::bind(std::multiplies<float>(), _1, 2.0f));
- signals::storage<void (float), signals::unfused> floater(1.0f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
+ signals::storage<void (float)> floater(1.0f);
+ signals::storage<void (float)> collector(0.0f);
floater >>= double_fun1 >>= double_fun2 >>= collector;
floater.send();
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,10 +3,10 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/junction.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/junction.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -16,9 +16,9 @@
{
{
//[ test_junction_unfused
- signals::storage<void (), signals::unfused> banger1, banger2;
- signals::counter<void (), signals::unfused> counter1, counter2;
- signals::junction<void (), signals::unfused> junction;
+ signals::storage<void ()> banger1, banger2;
+ signals::counter<void ()> counter1, counter2;
+ signals::junction<void ()> junction;
banger1 >>= junction >>= counter1;
banger2 >>= junction >>= counter2;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,8 +3,8 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/optional.hpp>
@@ -14,7 +14,7 @@
//[ test_multi_args_class1
-class SignalFloatDuplicator : public signals::filter<void (float, float), signals::unfused>
+class SignalFloatDuplicator : public signals::filter<void (float, float)>
{
public:
typedef void result_type;
@@ -71,8 +71,8 @@
{
{
//[ test_multi_args_unfused
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater;
+ signals::storage<void ()> banger;
+ signals::storage<void (float)> floater;
floater(2.5f);
SignalFloatDuplicator duplicator;
SignalMultiCollector collector;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,8 +3,8 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -12,7 +12,7 @@
//[ test_multi_out_classes
-class SignalOutIntFloat : public signals::filter<void (float), signals::unfused>
+class SignalOutIntFloat : public signals::filter<void (float)>
{
public:
SignalOutIntFloat(float x) : x(x) {}
@@ -34,8 +34,8 @@
//[ test_multi_out_unfused
SignalOutIntFloat multi_out(2.5f);
- signals::storage<void (float), signals::unfused> float_collector(0);
- signals::storage<void (int), signals::unfused> int_collector(0);
+ signals::storage<void (float)> float_collector(0);
+ signals::storage<void (int)> int_collector(0);
multi_out >>= float_collector;
multi_out.out_int >>= int_collector;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,8 +3,8 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/optional.hpp>
@@ -46,10 +46,10 @@
{
{
//[ test_multi_type_unfused
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (int), signals::unfused> inter;
+ signals::storage<void ()> banger;
+ signals::storage<void (int)> inter;
inter(2);
- signals::storage<void (float), signals::unfused> floater;
+ signals::storage<void (float)> floater;
floater(3.3f);
SignalIntFloatCollector collector;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multiplexer.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multiplexer.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multiplexer.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/multiplexer.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/multiplexer.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -15,8 +15,8 @@
{
{
//[ test_multiplexer_unfused
- signals::storage<void (float), signals::unfused> one(1.0f), two(2.0f), collector(-1.0f);
- signals::multiplexer<void (float), signals::unfused> multiplexer;
+ signals::storage<void (float)> one(1.0f), two(2.0f), collector(-1.0f);
+ signals::multiplexer<void (float)> multiplexer;
one >>= multiplexer.slot<1>();
two >>= multiplexer.slot<2>();
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,10 +3,10 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/mutex.hpp>
-#include <boost/dataflow/signal/component/timed_generator.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/mutex.hpp>
+#include <boost/dataflow/signals/component/timed_generator.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -16,9 +16,9 @@
{
{
//[ test_mutex_unfused
- signals::timed_generator<void (), signals::unfused> banger1;
- signals::timed_generator<void (), signals::unfused> banger2;
- signals::mutex<void (), signals::unfused> lock;
+ signals::timed_generator<void ()> banger1;
+ signals::timed_generator<void ()> banger2;
+ signals::mutex<void ()> lock;
signals::counter<void (), signals::unfused, volatile int> counter;
banger1 >>= lock >>= counter;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,15 +3,15 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
//[ test_pull_classes
-class PullDoubler : public signals::filter<float (), signals::unfused>
+class PullDoubler : public signals::filter<float ()>
{
public:
float operator()()
@@ -26,9 +26,20 @@
{
//[ test_pull_unfused
- signals::storage<void(float), signals::unfused> generator(1.0f);
+ signals::storage<void(float)> generator(1.0f);
PullDoubler doubler;
-
+
+ // ---Connect the dataflow network ---------------------
+ //
+ // ,---------.
+ // | doubler | <---------------.
+ // `---------' |
+ // ,-(value_at_slot<0>)-.
+ // | generator |
+ // `--------------------'
+ //
+ // -----------------------------------------------------
+
doubler >>= generator.value_at_slot<0>();
BOOST_CHECK(doubler() == 2.0f);
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_result_of_defined.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_result_of_defined.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_result_of_defined.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,10 +3,10 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/connection/detail/result_of_defined.hpp>
+#include <boost/dataflow/signals/connection/detail/result_of_defined.hpp>
#include <boost/fusion/container/map.hpp>
-#include <boost/dataflow/signal/component/junction.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
+#include <boost/dataflow/signals/component/junction.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -57,10 +57,10 @@
BOOST_CHECK(!signals::detail::result_of_defined<has_result()>::value);
BOOST_CHECK(!signals::detail::result_of_defined<has_result(float, float)>::value);
bool junction_void_value = signals::detail::result_of_defined<
- signals::junction<void(), signals::unfused> ()>::value;
+ signals::junction<void()> ()>::value;
BOOST_CHECK(junction_void_value);
// bool junction_int_value = signals::detail::result_of_defined<
-// signals::junction<void(), signals::unfused> (int)>::value;
+// signals::junction<void()> (int)>::value;
// BOOST_CHECK(!junction_int_value);
return 0;
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,9 +3,9 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/component/counter.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -13,10 +13,10 @@
//[ test_same_type_classes
-class Signal2VoidCounter : public signals::counter<void (), signals::unfused>
+class Signal2VoidCounter : public signals::counter<void ()>
{
public:
- signals::counter<void (), signals::unfused> other;
+ signals::counter<void ()> other;
}; // end class Signal2VoidCounter
class Signal2VoidInputs
@@ -47,7 +47,7 @@
{
{
//[ test_same_type_unfused
- signals::storage<void (), signals::unfused> banger;
+ signals::storage<void ()> banger;
Signal2VoidCounter counter;
banger
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -5,11 +5,11 @@
#include <boost/asio.hpp>
-#include <boost/dataflow/signal/component/socket_receiver.hpp>
-#include <boost/dataflow/signal/component/socket_sender.hpp>
-#include <boost/dataflow/signal/component/function.hpp>
-#include <boost/dataflow/signal/component/condition.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/socket_receiver.hpp>
+#include <boost/dataflow/signals/component/socket_sender.hpp>
+#include <boost/dataflow/signals/component/function.hpp>
+#include <boost/dataflow/signals/component/condition.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
@@ -41,8 +41,8 @@
acceptor.accept(socket);
// instantiate the components - a float generator, a filter that adds 2, and a sender
- signals::storage<void (float), signals::unfused> generator(1.0f);
- signals::function<void (float), float(float), signals::unfused> add2(boost::bind(std::plus<float>(), _1, 2.0f));
+ signals::storage<void (float)> generator(1.0f);
+ signals::function<void (float), float(float)> add2(boost::bind(std::plus<float>(), _1, 2.0f));
signals::socket_sender<void (float)> sender(socket);
// create the network
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -3,8 +3,8 @@
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
+#include <boost/dataflow/signals/component/storage.hpp>
+#include <boost/dataflow/signals/connection.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
@@ -15,14 +15,26 @@
{
//[ test_storage_unfused
// instantiate all of the components we need
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater(2.5f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
+ signals::storage<void ()> banger;
+ signals::storage<void (float)> floater(2.5f);
+ signals::storage<void (float)> collector(0.0f);
- // create the network (banger to floater.send, floater to collector)
+ // ---Connect the dataflow network -----------------------------
+ //
+ // ,--------. void()
+ // | banger | -------.
+ // `--------' |
+ // |
+ // V
+ // ,-(send_slot)-. void(float) ,-----------.
+ // | floater | -------------> | collector |
+ // `-------------' `-----------'
+ //
+ // -------------------------------------------------------------
banger >>= floater.send_slot() >>= collector;
- // signal from banger causes floater to output 2.5
+ // signal from banger is will invoke floater.send(), which causes
+ // floater to output 2.5
banger();
BOOST_CHECK_EQUAL(floater.at<0>(), 2.5f);
BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_binary_op.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_binary_op.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_binary_op.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -16,39 +16,30 @@
struct binary_operation_impl<operations::connect, my_producer_traits, my_consumer_traits>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- connected = true;
- }
- };
+ connected = true;
+ }
};
template<>
struct binary_operation_impl<operations::connect_only, my_producer_traits, my_consumer_traits>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- only_connected = true;
- }
- };
+ only_connected = true;
+ }
};
template<>
struct binary_operation_impl<operations::disconnect, my_producer_traits, my_consumer_traits>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- disconnected = true;
- }
- };
+ disconnected = true;
+ }
};
}}}
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -25,13 +25,10 @@
struct component_operation_impl<operations::invoke, my_component_traits>
{
template<typename Component>
- struct apply
+ void operator()(Component &)
{
- static void call(Component &)
- {
- invoked = true;
- }
- };
+ invoked = true;
+ }
};
}}}
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_keyed_port.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_keyed_port.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_keyed_port.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -41,26 +41,20 @@
struct binary_operation_impl<operations::connect, my_producer_traits, my_consumer_traits>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- connected++;
- }
- };
+ connected++;
+ }
};
template<>
struct binary_operation_impl<operations::connect, my_other_producer_traits, my_other_consumer_traits>
{
template<typename Producer, typename Consumer>
- struct apply
+ void operator()(Producer &, Consumer &)
{
- static void call(Producer &, Consumer &)
- {
- connected_other = true;
- }
- };
+ connected_other = true;
+ }
};
}}}
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -62,15 +62,13 @@
template<>
struct get_port_impl<my_non_intrusive_proxy_producer_traits>
{
+ typedef my_producer & result_type;
+
template<typename T>
- struct apply
+ result_type operator()(T &t)
{
- typedef my_producer &type;
- static type call(T &t)
- {
- return t.my_producer;
- }
- };
+ return t.my_producer;
+ }
};
Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_unary_op.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_unary_op.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_unary_op.cpp 2007-11-07 14:26:47 EST (Wed, 07 Nov 2007)
@@ -14,13 +14,10 @@
struct unary_operation_impl<operations::disconnect_all, my_producer_traits>
{
template<typename Producer>
- struct apply
+ void operator()(Producer &)
{
- static void call(Producer &)
- {
- disconnected = true;
- }
- };
+ disconnected = true;
+ }
};
}}}
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