|
Boost-Commit : |
From: stipe_at_[hidden]
Date: 2007-09-23 14:07:43
Author: srajko
Date: 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
New Revision: 39491
URL: http://svn.boost.org/trac/boost/changeset/39491
Log:
Add mechanism support
Added:
sandbox/SOC/2007/signals/boost/dataflow/signal/connection/operators.hpp (contents, props changed)
sandbox/SOC/2007/signals/boost/dataflow/support/common.hpp (contents, props changed)
sandbox/SOC/2007/signals/libs/dataflow/doc/consumer_concepts.qbk (contents, props changed)
sandbox/SOC/2007/signals/libs/dataflow/doc/producer_concepts.qbk (contents, props changed)
sandbox/SOC/2007/signals/libs/dataflow/test/signals/
sandbox/SOC/2007/signals/libs/dataflow/test/signals/Jamfile.v2
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_bind_object.cpp
- copied unchanged from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_bind_object.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connections.cpp
- copied unchanged from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_connections.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_counter.cpp
- copied unchanged from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_counter.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp
- copied, changed from r39333, /sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp
- copied, changed from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp
Removed:
sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector_map.hpp
sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2
sandbox/SOC/2007/signals/libs/dataflow/test/test_bind_object.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_connections.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_counter.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp
sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp
Text files modified:
sandbox/SOC/2007/signals/boost/dataflow/VTK/support.hpp | 58 +++++++---
sandbox/SOC/2007/signals/boost/dataflow/connection/consumer_map.hpp | 42 ++++---
sandbox/SOC/2007/signals/boost/dataflow/connection/producer_map.hpp | 42 ++++---
sandbox/SOC/2007/signals/boost/dataflow/signal/component/chain.hpp | 6
sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter.hpp | 23 +++
sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter_base.hpp | 23 +++
sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_sender.hpp | 4
sandbox/SOC/2007/signals/boost/dataflow/signal/connection.hpp | 3
sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector.hpp | 11 -
sandbox/SOC/2007/signals/boost/dataflow/signal/support.hpp | 47 ++++++--
sandbox/SOC/2007/signals/boost/dataflow/support/connectable.hpp | 85 ++++++++++-----
sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp | 122 +++++++++++++++++-----
sandbox/SOC/2007/signals/boost/dataflow/support/filter.hpp | 28 ++--
sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp | 114 ++++++++++++++++----
sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp | 123 +++++++++++++---------
sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp | 125 +++++++++++++----------
sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj | 92 ++++++++++-------
sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk | 213 +++------------------------------------
sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk | 43 +++++---
sandbox/SOC/2007/signals/libs/dataflow/doc/signals/components.qbk | 3
sandbox/SOC/2007/signals/libs/dataflow/example/Jamfile.v2 | 2
sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx | 10 +
sandbox/SOC/2007/signals/libs/dataflow/example/example.cpp | 11 --
sandbox/SOC/2007/signals/libs/dataflow/test/signals/Jamfile.v2 | 6
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp | 7
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp | 5
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp | 5
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp | 1
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp | 5
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp | 4
sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp | 8 -
39 files changed, 686 insertions(+), 593 deletions(-)
Modified: sandbox/SOC/2007/signals/boost/dataflow/VTK/support.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/VTK/support.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/VTK/support.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -12,13 +12,14 @@
#include <boost/dataflow/support.hpp>
#include <boost/dataflow/connection/producer_map.hpp>
-#include <boost/dataflow/connection/operators.hpp>
#include <boost/fusion/sequence/container/map.hpp>
#include <boost/type_traits/is_base_of.hpp>
namespace boost { namespace dataflow {
+struct vtk;
+
struct vtk_algorithm_output_producer;
struct vtk_algorithm_consumer;
struct vtk_algorithm_proxy_producer;
@@ -32,14 +33,14 @@
struct vtk_mapper_data;
template<>
-struct producer_category_of<vtkAlgorithmOutput *>
+struct producer_category_of<vtk, vtkAlgorithmOutput *>
{
typedef vtk_algorithm_output_producer type;
};
template<typename T>
struct proxy_producer_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkAlgorithm,T> >::type
>
{
@@ -47,14 +48,14 @@
};
template<>
-struct producer_category_of<vtkMapper *>
+struct producer_category_of<vtk, vtkMapper *>
{
typedef vtk_algorithm_mapper_producer type;
};
template<typename T>
struct proxied_producer_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkAlgorithm,T> >::type
>
{
@@ -68,7 +69,7 @@
namespace extension
{
template<>
- struct get_proxied_producer_impl<vtk_algorithm_proxy_producer>
+ struct get_proxied_producer_impl<vtk, vtk_algorithm_proxy_producer>
{
template<typename ProxyProducer>
struct result
@@ -98,7 +99,7 @@
template<typename T>
struct consumer_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkAlgorithm,T> >::type
>
{
@@ -107,7 +108,7 @@
template<typename T>
struct consumed_type_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkAlgorithm,T> >::type
>
{
@@ -119,7 +120,7 @@
namespace extension
{
template<>
- struct connect_impl<vtk_algorithm_output_producer, vtk_algorithm_consumer>
+ struct connect_impl<vtk, vtk_algorithm_output_producer, vtk_algorithm_consumer>
{
template<typename Producer, typename Consumer>
struct apply
@@ -132,7 +133,7 @@
};
template<>
- struct connect_impl<vtk_algorithm_mapper_producer, vtk_mapper_consumer>
+ struct connect_impl<vtk, vtk_algorithm_mapper_producer, vtk_mapper_consumer>
{
template<typename Producer, typename Consumer>
struct apply
@@ -145,7 +146,7 @@
};
template<>
- struct connect_impl<vtk_prop_producer, vtk_renderer_filter>
+ struct connect_impl<vtk, vtk_prop_producer, vtk_renderer_filter>
{
template<typename Producer, typename Consumer>
struct apply
@@ -158,7 +159,7 @@
};
template<>
- struct connect_impl<vtk_renderer_filter, vtk_rendererwindow_consumer>
+ struct connect_impl<vtk, vtk_renderer_filter, vtk_rendererwindow_consumer>
{
template<typename Producer, typename Consumer>
struct apply
@@ -173,7 +174,7 @@
template<typename T>
struct producer_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkActor,T> >::type
>
{
@@ -182,7 +183,7 @@
template<typename T>
struct consumer_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkActor,T> >::type
>
{
@@ -191,7 +192,7 @@
template<typename T>
struct consumed_type_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkActor,T> >::type
>
{
@@ -200,7 +201,7 @@
template<typename T>
struct filter_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkRenderer,T> >::type
>
{
@@ -209,7 +210,7 @@
template<typename T>
struct consumer_category_of<
- T,
+ vtk, T,
typename boost::enable_if<boost::is_base_of<vtkRenderWindow,T> >::type
>
{
@@ -218,5 +219,28 @@
} }
+template<typename Producer, typename Consumer>
+inline void connect(Producer &producer, Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::vtk>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(const Producer &producer, Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::vtk>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(Producer &producer, const Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::vtk>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(const Producer &producer, const Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::vtk>(producer, consumer);
+}
#endif // BOOST_DATAFLOW_VTK_SUPPORT_HPP
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/boost/dataflow/connection/consumer_map.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/connection/consumer_map.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/connection/consumer_map.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -22,32 +22,36 @@
namespace boost { namespace dataflow {
-struct fusion_map_consumer;
+struct fusion_map_consumer {};
template<class T>
struct consumer_map : public T
{
consumer_map(const T& t) : T(t) {}
- typedef fusion_map_consumer consumer_category;
- typedef
- typename boost::remove_const<
- typename boost::remove_reference<
- typename boost::fusion::result_of::front<T>::type
- >::type
- >::type::second_type proxy_producer_for;
- typedef mutable_proxy_producer proxy_producer_category;
-
- typename get_proxied_producer_type<proxy_producer_for>::type &get_proxied_producer() const
+ template<typename Mechanism>
+ struct dataflow
{
- return boost::dataflow::get_proxied_producer(boost::fusion::front(*this).second);
- }
+ typedef fusion_map_consumer consumer_category;
+ typedef
+ typename boost::remove_const<
+ typename boost::remove_reference<
+ typename boost::fusion::result_of::front<T>::type
+ >::type
+ >::type::second_type proxy_producer_for;
+ typedef mutable_proxy_producer proxy_producer_category;
+
+ static typename get_proxied_producer_type<Mechanism, proxy_producer_for>::type &get_proxied_producer(const T &t)
+ {
+ return boost::dataflow::get_proxied_producer<Mechanism>(boost::fusion::front(t).second);
+ }
+ };
};
namespace extension
{
// component >>= consumer_map
- template<typename ProducerTag, typename ConsumerTag>
- struct connect_impl<ProducerTag, ConsumerTag,
+ template<typename Mechanism, typename ProducerTag, typename ConsumerTag>
+ struct connect_impl<Mechanism, ProducerTag, ConsumerTag,
typename boost::enable_if<//boost::mpl::and_<
//is_producer<ProducerTag>,
boost::is_base_of<fusion_map_consumer, ConsumerTag>
@@ -61,7 +65,7 @@
connect(
producer,
boost::fusion::at_key<
- typename produced_type_of<Producer>::type
+ typename produced_type_of<Mechanism, Producer>::type
>(consumer));
}
static void call(const Producer &producer, Consumer &consumer)
@@ -69,7 +73,7 @@
connect(
producer,
boost::fusion::at_key<
- typename produced_type_of<Producer>::type
+ typename produced_type_of<Mechanism, Producer>::type
>(consumer));
}
static void call(Producer &producer, const Consumer &consumer)
@@ -77,7 +81,7 @@
connect(
producer,
boost::fusion::at_key<
- typename produced_type_of<Producer>::type
+ typename produced_type_of<Mechanism, Producer>::type
>(consumer));
}
static void call(Producer &producer, Consumer &consumer)
@@ -85,7 +89,7 @@
connect(
producer,
boost::fusion::at_key<
- typename produced_type_of<Producer>::type
+ typename produced_type_of<Mechanism, Producer>::type
>(consumer));
}
};
Modified: sandbox/SOC/2007/signals/boost/dataflow/connection/producer_map.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/connection/producer_map.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/connection/producer_map.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -23,32 +23,36 @@
namespace boost { namespace dataflow {
-struct fusion_map_producer;
+struct fusion_map_producer {};
template<class T>
struct producer_map : public T
{
producer_map(const T& t) : T(t) {}
- typedef fusion_map_producer producer_category;
- typedef
- typename boost::remove_const<
- typename boost::remove_reference<
- typename boost::fusion::result_of::front<T>::type
- >::type
- >::type::second_type proxy_consumer_for;
- typedef mutable_proxy_consumer proxy_consumer_category;
-
- typename boost::call_traits<typename get_proxied_consumer_type<proxy_consumer_for>::type>::reference get_proxied_consumer() const
+ template<typename Mechanism>
+ struct dataflow
{
- return boost::dataflow::get_proxied_consumer(boost::fusion::front(*this).second);
- }
+ typedef fusion_map_producer producer_category;
+ typedef
+ typename boost::remove_const<
+ typename boost::remove_reference<
+ typename boost::fusion::result_of::front<T>::type
+ >::type
+ >::type::second_type proxy_consumer_for;
+ typedef mutable_proxy_consumer proxy_consumer_category;
+
+ static typename boost::call_traits<typename get_proxied_consumer_type<Mechanism, proxy_consumer_for>::type>::reference get_proxied_consumer(const T &t)
+ {
+ return boost::dataflow::get_proxied_consumer(boost::fusion::front(t).second);
+ }
+ };
};
namespace extension
{
// component >>= coxsumer_map
- template<typename ProducerTag, typename ConsumerTag>
- struct connect_impl<ProducerTag, ConsumerTag,
+ template<typename Mechanism, typename ProducerTag, typename ConsumerTag>
+ struct connect_impl<Mechanism, ProducerTag, ConsumerTag,
typename boost::enable_if<
boost::is_base_of<fusion_map_producer, ProducerTag>
>::type >
@@ -60,7 +64,7 @@
{
connect(
boost::fusion::at_key<
- typename consumed_type_of<Consumer>::type
+ typename consumed_type_of<Mechanism, Consumer>::type
>(producer),
consumer);
}
@@ -68,7 +72,7 @@
{
connect(
boost::fusion::at_key<
- typename consumed_type_of<Consumer>::type
+ typename consumed_type_of<Mechanism, Consumer>::type
>(producer),
consumer);
}
@@ -76,7 +80,7 @@
{
connect(
boost::fusion::at_key<
- typename consumed_type_of<Consumer>::type
+ typename consumed_type_of<Mechanism, Consumer>::type
>(producer),
consumer);
}
@@ -84,7 +88,7 @@
{
connect(
boost::fusion::at_key<
- typename consumed_type_of<Consumer>::type
+ typename consumed_type_of<Mechanism, Consumer>::type
>(producer),
consumer);
}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signal/component/chain.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/component/chain.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/component/chain.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -19,7 +19,7 @@
namespace detail
{
template<typename Signature, typename T>
- class chain_impl : public filter_base
+ class chain_impl : public filter_base<typename T::signal_type>
{
protected:
typedef typename boost::function_types::parameter_types<Signature>::type parameter_types;
@@ -53,9 +53,9 @@
{
return components[size-1].default_signal();
}
- typename boost::dataflow::get_proxied_producer_type<proxy_producer_for>::type &get_proxied_producer() const
+ typename T::signal_type &get_proxied_producer() const
{
- return boost::dataflow::get_proxied_producer(components[size-1]);
+ return boost::dataflow::get_proxied_producer<boost::dataflow::signals_mechanism>(components[size-1]);
}
private:
void initialize(size_t copies, T *component=NULL)
Modified: sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -61,13 +61,13 @@
/** \brief Unfused version of the filter class
*/
template<typename Signature, typename Combiner, typename Group, typename GroupCompare>
-class filter<Signature, unfused, Combiner, Group, GroupCompare> : public filter_base
+class filter<Signature, unfused, Combiner, Group, GroupCompare>
+ : public filter_base<boost::signal<Signature, Combiner, Group, GroupCompare> >
{
public:
// the type of the signal
typedef boost::signal<Signature, Combiner, Group, GroupCompare> signal_type;
- typedef signal_type proxy_producer_for;
-
+
// the signature of the output signal
typedef Signature signature_type;
@@ -76,7 +76,7 @@
const filter &operator = (const filter &) {return *this;}
/// Returns the default out signal.
- proxy_producer_for &get_proxied_producer() const
+ signal_type &get_proxied_producer() const
{ return out; }
/// Disconnects all slots connected to the signals::filter.
@@ -107,11 +107,24 @@
boost::fusion::fused<typename base_type::signal_type const &> fused_out;
}; // class filter
+namespace detail
+{
+ template<typename Signature, typename Combiner, typename Group, typename GroupCompare>
+ struct fused_signal_type
+ {
+ typedef typename boost::function_types::parameter_types<Signature>::type parameter_types;
+ typedef typename boost::fusion::result_of::as_vector<parameter_types>::type parameter_vector;
+ typedef typename Combiner::result_type signature_type (const parameter_vector &);
+ typedef typename Combiner::result_type fused_signature_type (const parameter_vector &);
+ typedef boost::signal<signature_type, Combiner, Group, GroupCompare> signal_type;
+ };
+}
+
/** \brief Fused version of the filter class
*/
template<typename Signature, typename Combiner, typename Group, typename GroupCompare>
class filter<Signature, fused, Combiner, Group, GroupCompare>
-: public filter_base
+: public filter_base<typename detail::fused_signal_type<Signature, Combiner, Group, GroupCompare>::signal_type>
{
public:
filter(const filter &) {}
Modified: sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter_base.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter_base.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/component/filter_base.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -20,14 +20,33 @@
namespace boost { namespace signals {
+template<typename Signal>
class filter_base
#ifdef SIGNAL_NETWORK_TRACKABLE
: public boost::signals::trackable
#endif
{
public:
- typedef boost::dataflow::signal_consumer consumer_category;
- typedef boost::dataflow::mutable_proxy_producer proxy_producer_category;
+ template<typename Mechanism, typename Enable=void>
+ struct dataflow;
+
+ template<typename Mechanism>
+ struct dataflow<
+ Mechanism,
+ typename enable_if<
+ is_same<Mechanism, boost::dataflow::signals_mechanism>
+ >::type>
+ {
+ typedef boost::dataflow::signal_consumer consumer_category;
+ typedef boost::dataflow::mutable_proxy_producer proxy_producer_category;
+ typedef Signal proxy_producer_for;
+
+ template<typename T>
+ static typename boost::dataflow::get_proxied_producer_type<boost::dataflow::signals_mechanism, Signal>
+ ::type &get_proxied_producer(const T &t)
+ { return t.get_proxied_producer(); }
+
+ };
};
} }
Modified: sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_sender.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_sender.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/component/socket_sender.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -55,14 +55,14 @@
*/
template<typename Signature>
class socket_sender : public boost::fusion::unfused_inherited<
- detail::socket_sender_impl<Signature>, typename boost::function_types::parameter_types<Signature>::type >
+ detail::socket_sender_impl<Signature>, typename boost::function_types::parameter_types<Signature>::type >,
+ public boost::dataflow::consumer<boost::dataflow::signals_mechanism, boost::dataflow::signal_consumer>
{
typedef boost::fusion::unfused_inherited<
detail::socket_sender_impl<Signature>,
typename boost::function_types::parameter_types<Signature>::type>
base_type;
public:
- typedef boost::dataflow::signal_consumer consumer_category;
socket_sender(asio::ip::tcp::socket & socket) : base_type(socket)
{ }
};
Modified: 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/signal/connection.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -7,8 +7,7 @@
#define SIGNAL_NETWORK_CONNECTION_HPP
#include <boost/dataflow/signal/support.hpp>
-#include <boost/dataflow/connection/operators.hpp>
+#include <boost/dataflow/signal/connection/operators.hpp>
#include <boost/dataflow/signal/connection/slot_selector.hpp>
-#include <boost/dataflow/signal/connection/slot_selector_map.hpp>
#endif
\ No newline at end of file
Added: sandbox/SOC/2007/signals/boost/dataflow/signal/connection/operators.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/connection/operators.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -0,0 +1,68 @@
+// Copyright Stjepan Rajko 2007. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_DATAFLOW_SIGNALS_CONNECTION_OPERATORS_HPP
+#define BOOST_DATAFLOW_SIGNALS_CONNECTION_OPERATORS_HPP
+
+#include <boost/dataflow/signal/support.hpp>
+
+namespace boost { namespace signals {
+
+ /// Connects two components (typically as a part of a chain of components).
+ /** This operator is identical to signals::operator| (it connects the
+ left component to the right component, and returns a reference to the left component),
+ except it is evaluated right to left. This makes it semantics more suitable for
+ connecting a chain of components.
+ */
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, Input & >::type
+ operator >>= (Input &input, Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, Input & >::type
+ operator >>= (Input &input, const Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, const Input & >::type
+ operator >>= (const Input &input, Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, const Input & >::type
+ operator >>= (const Input &input, const Output &output)
+ { connect(input, output); return input;}
+
+ /// Connects two components (typically as a part of branching from a single component).
+ /** This operator is identical to signals::operator>>=, (it connects the
+ left component to the right component, and returns a reference to the left component)
+ except it is evaluated left to right. This makes its semantics more suitable for
+ branching connections.
+ */
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, Input & >::type
+ operator | (Input &input, Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, Input & >::type
+ operator | (Input &input, const Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, const Input & >::type
+ operator | (const Input &input, Output &output)
+ { connect(input, output); return input;}
+
+ template<typename Input, typename Output>
+ typename boost::enable_if<dataflow::is_producer<boost::dataflow::signals_mechanism, Input>, const Input & >::type
+ operator | (const Input &input, const Output &output)
+ { connect(input, output); return input;}
+
+} } // namespace boost::dataflow
+
+#endif // BOOST_DATAFLOW_SIGNALS_CONNECTION_OPERATORS_HPP
+
Modified: sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -12,20 +12,17 @@
#include <boost/dataflow/signal/connection/detail/bind_object.hpp>
#include <boost/dataflow/signal/support.hpp>
+#include <boost/dataflow/signal/component/filter_base.hpp>
namespace boost { namespace signals {
/** \brief Reference to a class instance and pointer to a class member function.
*/
template<typename Signature, typename T>
-struct slot_selector
+struct slot_selector : public filter_base<T>
{
typedef Signature signature_type;
typedef T class_type;
- typedef boost::dataflow::signal_consumer consumer_category;
- typedef T proxy_producer_for;
- typedef boost::dataflow::mutable_proxy_producer proxy_producer_category;
-
T &object;
typename detail::slot_type<Signature, T>::type func;
@@ -33,8 +30,8 @@
slot_selector(typename detail::slot_type<Signature, T>::type func, T &object)
: object(object), func(func) {}
- typename boost::dataflow::get_proxied_producer_type<T>::type &get_proxied_producer() const
- { return boost::dataflow::get_proxied_producer(object); }
+ typename boost::dataflow::get_proxied_producer_type<boost::dataflow::signals_mechanism, T>::type &get_proxied_producer() const
+ { return boost::dataflow::get_proxied_producer<boost::dataflow::signals_mechanism>(object); }
};
/** \brief Allows arbitrary member functions to serve as slots.
Deleted: sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector_map.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/signal/connection/slot_selector_map.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,67 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef SIGNAL_NETWORK_SLOT_SELECTOR_MAP_HPP
-#define SIGNAL_NETWORK_SLOT_SELECTOR_MAP_HPP
-/*
-#include <boost/dataflow/signal/connection/slot_selector.hpp>
-
-#include <boost/fusion/support/is_sequence.hpp>
-#include <boost/fusion/sequence/intrinsic/at_key.hpp>
-#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
-#include <boost/fusion/sequence/intrinsic/front.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-
-namespace boost { namespace dataflow {
-
-template<typename T>
-struct producer_category_of<T, typename boost::enable_if<boost::fusion::traits::is_sequence<T> >::type>
-{
- typedef signal_producer type;
-};
-
-namespace extension { namespace signals {
-
-// Support for fusion maps of consumer components.
-template<typename Signature, typename T>
-struct get_slot<Signature, T, typename boost::enable_if<boost::fusion::traits::is_sequence<T> >::type> // this should be is_map
-{
- boost::function<Signature> operator()(const T &seq)
- {
- return get_slot<Signature, typename boost::fusion::result_of::value_at_key<T, Signature>::type>()
- (boost::fusion::at_key<Signature>(seq));
- }
-};
-
-// Support for slot_selector as an input component (producer).
-template<typename T>
-struct get_signal_type<T, typename boost::enable_if<boost::fusion::traits::is_sequence<T> >::type>
-{
- typedef
- typename get_signal_type<
- typename boost::remove_reference<
- typename boost::fusion::result_of::front<T>::type
- >::type::second_type
- >::type type;
-};
-
-// Support for slot_selector as an input component (producer).
-template<typename T>
-struct get_signal<T, typename boost::enable_if<boost::fusion::traits::is_sequence<T> >::type>
-{
- typename get_signal_type<T>::type &operator()(const T &map)
- {
- return get_signal<
- typename boost::remove_reference<
- typename boost::fusion::result_of::front<T>::type
- >::type::second_type>()(boost::fusion::front(map).second);
- }
-};
-
- } }
-
-} } // namespace boost::signals
-*/
-#endif // SIGNAL_NETWORK_SLOT_SELECTOR_MAP_HPP
\ No newline at end of file
Modified: 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/signal/support.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -30,22 +30,20 @@
};
}
-} }
+} } // namespace boost::signals
namespace boost { namespace dataflow {
struct signal_producer {};
struct signal_consumer {};
+struct signals_mechanism;
template<typename Signature, typename Combiner, typename Group, typename GroupCompare>
-struct producer_category_of<boost::signal<Signature, Combiner, Group, GroupCompare> >
+struct producer_category_of<signals_mechanism, boost::signal<Signature, Combiner, Group, GroupCompare> >
{
typedef signal_producer type;
};
-/*template<typename T>
-struct consumer_type_of<T, */
-
namespace extension
{
namespace signals
@@ -96,8 +94,8 @@
/** \brief Support for function objects that for which boost::result_of is defined.
*/
-/* template<typename T>
- struct consumer_category_of<T, boost::enable_if<boost::signals::detail::result_of_defined<
+ /*template<typename T>
+ struct consumer_category_of<signals_mechanism, T, boost::enable_if<boost::signals::detail::result_of_defined<
typename boost::signals::detail::replace_return_type<Signature, T>::type > >::type>
{
typedef boost::dataflow::signal_consumer type;
@@ -105,7 +103,7 @@
}
template<typename ProducerTag, typename ConsumerTag>
- struct connect_impl<ProducerTag, ConsumerTag,
+ struct connect_impl<signals_mechanism, ProducerTag, ConsumerTag,
typename boost::enable_if<boost::mpl::and_<
boost::is_base_of<signal_producer, ProducerTag>,
boost::is_base_of<signal_consumer, ConsumerTag>
@@ -118,25 +116,25 @@
{
signals::get_signal<Producer>()(producer).connect(
signals::get_slot<typename dataflow::produced_type_of<
- Producer>::type, Consumer>()(consumer));
+ signals_mechanism, Producer>::type, Consumer>()(consumer));
}
static void call(const Producer &producer, Consumer &consumer)
{
signals::get_signal<Producer>()(producer).connect(
signals::get_slot<typename dataflow::produced_type_of<
- Producer>::type, Consumer>()(consumer));
+ signals_mechanism, Producer>::type, Consumer>()(consumer));
}
static void call(Producer &producer, const Consumer &consumer)
{
signals::get_signal<Producer>()(producer).connect(
signals::get_slot<typename dataflow::produced_type_of<
- Producer>::type, Consumer>()(consumer));
+ signals_mechanism, Producer>::type, Consumer>()(consumer));
}
static void call(Producer &producer, Consumer &consumer)
{
signals::get_signal<Producer>()(producer).connect(
signals::get_slot<typename dataflow::produced_type_of<
- Producer>::type, Consumer>()(consumer));
+ signals_mechanism, Producer>::type, Consumer>()(consumer));
}
};
};
@@ -158,6 +156,7 @@
template<typename Signature, typename Combiner, typename Group, typename GroupCompare>
struct produced_type_of<
+ signals_mechanism,
boost::signal<Signature, Combiner, Group, GroupCompare> >
{
typedef Signature type;
@@ -167,7 +166,29 @@
namespace boost { namespace signals {
- using boost::dataflow::connect;
+template<typename Producer, typename Consumer>
+inline void connect(Producer &producer, Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::signals_mechanism>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(const Producer &producer, Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::signals_mechanism>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(Producer &producer, const Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::signals_mechanism>(producer, consumer);
+}
+
+template<typename Producer, typename Consumer>
+inline void connect(const Producer &producer, const Consumer &consumer)
+{
+ boost::dataflow::connect<boost::dataflow::signals_mechanism>(producer, consumer);
+}
} } // namespace boost::phoenix
Added: sandbox/SOC/2007/signals/boost/dataflow/support/common.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/common.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -0,0 +1,16 @@
+// Copyright 2007 Stjepan Rajko.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_DATAFLOW_SUPPORT_COMMON_HPP
+#define BOOST_DATAFLOW_SUPPORT_COMMON_HPP
+
+namespace boost { namespace dataflow {
+
+/// Tag describing that dataflow properties should apply to all mechanisms.
+struct all_mechanisms;
+
+} } // namespace boost::dataflow
+
+#endif // BOOST_DATAFLOW_SUPPORT_COMMON_HPP
\ No newline at end of file
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/connectable.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/connectable.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/connectable.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -14,9 +14,16 @@
namespace boost { namespace dataflow {
+/*namespace concepts
+{
+ struct producer;
+ struct single_type_producer;
+ struct keyed_producer;
+}*/
+
namespace extension
{
- template<typename ProducerTag, typename ConsumerTag, typename Enable=void>
+ template<typename Mechanism, typename ProducerTag, typename ConsumerTag, typename Enable=void>
struct connect_impl
{
template<typename Producer, typename Consumer>
@@ -30,58 +37,78 @@
}
};
};
+
+/* template<typename Mechanism, typename ProducerTag, typename ConsumerTag,
+ typename enable_if<
+ boost::is_same<ProducerTag, typename concepts::keyed_producer>
+ >::type >
+ struct connect_impl
+ {
+ template<typename Producer, typename Consumer>
+ struct apply
+ {
+ static void call(Producer &producer, Consumer &consumer)
+ {
+ connect(get_keyed_producer<Mechanism>(producer, consumer), consumer);
+ }
+ };
+ };*/
}
-template<typename Producer, typename Consumer>
+template<typename Mechanism, typename Producer, typename Consumer>
inline void connect(Producer &producer, Consumer &consumer)
{
extension::connect_impl<
- typename producer_category_of<Producer>::type,
- typename consumer_category_of<Consumer>::type>
+ Mechanism,
+ typename producer_category_of<Mechanism, Producer>::type,
+ typename consumer_category_of<Mechanism, Consumer>::type>
::template apply<
- typename get_proxied_producer_type<Producer>::type,
- typename get_proxied_consumer_type<Consumer>::type
- >::call(get_proxied_producer(producer),
- get_proxied_consumer(consumer));
+ typename get_proxied_producer_type<Mechanism, Producer>::type,
+ typename get_proxied_consumer_type<Mechanism, Consumer>::type
+ >::call(get_proxied_producer<Mechanism>(producer),
+ get_proxied_consumer<Mechanism>(consumer));
}
-template<typename Producer, typename Consumer>
+template<typename Mechanism, typename Producer, typename Consumer>
inline void connect(const Producer &producer, Consumer &consumer)
{
extension::connect_impl<
- typename producer_category_of<Producer>::type,
- typename consumer_category_of<Consumer>::type>
+ Mechanism,
+ typename producer_category_of<Mechanism, Producer>::type,
+ typename consumer_category_of<Mechanism, Consumer>::type>
::template apply<
- typename get_proxied_producer_type<Producer>::type,
- typename get_proxied_consumer_type<Consumer>::type
- >::call(get_proxied_producer(producer),
- get_proxied_consumer(consumer));
+ typename get_proxied_producer_type<Mechanism, Producer>::type,
+ typename get_proxied_consumer_type<Mechanism, Consumer>::type
+ >::call(get_proxied_producer<Mechanism>(producer),
+ get_proxied_consumer<Mechanism>(consumer));
}
-template<typename Producer, typename Consumer>
+template<typename Mechanism, typename Producer, typename Consumer>
inline void connect(Producer &producer, const Consumer &consumer)
{
extension::connect_impl<
- typename producer_category_of<Producer>::type,
- typename consumer_category_of<Consumer>::type>
+ Mechanism,
+ typename producer_category_of<Mechanism, Producer>::type,
+ typename consumer_category_of<Mechanism, Consumer>::type>
::template apply<
- typename get_proxied_producer_type<Producer>::type,
- typename get_proxied_consumer_type<Consumer>::type
- >::call(get_proxied_producer(producer),
- get_proxied_consumer(consumer));
+ typename get_proxied_producer_type<Mechanism, Producer>::type,
+ typename get_proxied_consumer_type<Mechanism, Consumer>::type
+ >::call(get_proxied_producer<Mechanism>(producer),
+ get_proxied_consumer<Mechanism>(consumer));
}
-template<typename Producer, typename Consumer>
+template<typename Mechanism, typename Producer, typename Consumer>
inline void connect(const Producer &producer, const Consumer &consumer)
{
extension::connect_impl<
- typename producer_category_of<Producer>::type,
- typename consumer_category_of<Consumer>::type>
+ Mechanism,
+ typename producer_category_of<Mechanism, Producer>::type,
+ typename consumer_category_of<Mechanism, Consumer>::type>
::template apply<
- typename get_proxied_producer_type<Producer>::type,
- typename get_proxied_consumer_type<Consumer>::type
- >::call(get_proxied_producer(producer),
- get_proxied_consumer(consumer));
+ typename get_proxied_producer_type<Mechanism, Producer>::type,
+ typename get_proxied_consumer_type<Mechanism, Consumer>::type
+ >::call(get_proxied_producer<Mechanism>(producer),
+ get_proxied_consumer<Mechanism>(consumer));
}
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -7,57 +7,123 @@
#define BOOST_DATAFLOW_SUPPORT_CONSUMER_HPP
#include <boost/dataflow/detail/enable_if_defined.hpp>
+#include <boost/dataflow/support/common.hpp>
#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost { namespace dataflow {
-// trait giving the consumer category of a type.
-template<typename T, typename Enable=void>
-struct consumer_category_of;
-
-template<typename T>
-struct consumer_category_of<T,
-typename detail::enable_if_defined<typename T::consumer_category>::type >
+/// Trait giving the consumer category of a type.
+template<typename Mechanism, typename T, typename Enable=void>
+struct consumer_category_of
{
- typedef typename T::consumer_category type;
};
-// trait giving the consumer category of a type.
-template<typename T, typename Enable=void>
-struct consumed_type_of;
-
-template<typename T>
-struct consumed_type_of<T,
-typename detail::enable_if_defined<typename T::consumed_type>::type >
+/// Allows intrusive specification of the consumer category.
+template<typename Mechanism, typename T>
+struct consumer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::consumer_category>::type
+ >
{
- typedef typename T::consumed_type type;
+ typedef typename T::template dataflow<Mechanism>::consumer_category type;
};
-// trait determining whether a type is a consumer.
-template<typename T, typename Enable=void>
+/// Trait determining whether a type is a Consumer.
+template<typename Mechanism, typename T, typename Enable=void>
struct is_consumer
: public boost::false_type {};
-template<typename T>
-struct is_consumer<T,
- typename detail::enable_if_defined<typename consumer_category_of<T>::type>::type >
+template<typename Mechanism, typename T>
+struct is_consumer<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename consumer_category_of<Mechanism, T>::type
+ >::type >
: public boost::true_type {};
-// trait determining whether a type is a consumer.
-template<typename T, typename Enable=void>
+/// Trait giving the consumed type of a SingleTypeConsumer.
+template<typename Mechanism, typename T, typename Enable=void>
+struct consumed_type_of
+{
+};
+
+/// Allows intrusive specification of the consumer category.
+template<typename Mechanism, typename T>
+struct consumed_type_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::consumed_type>::type
+ >
+{
+ typedef typename T::template dataflow<Mechanism>::consumed_type type;
+};
+
+template<typename Mechanism, typename ConsumerTag>
+struct consumer
+{
+ template<typename M, typename Enable=void>
+ struct dataflow
+ {
+ };
+
+ template<typename M>
+ struct dataflow<M, typename boost::enable_if<is_same<M, Mechanism> >::type>
+ {
+ typedef ConsumerTag consumer_category;
+ };
+};
+
+template<typename ConsumerTag>
+struct consumer<all_mechanisms, ConsumerTag>
+{
+ template<typename M>
+ struct dataflow
+ {
+ typedef ConsumerTag consumer_category;
+ };
+};
+
+// Trait determining whether a type is a SingleTypeConsumer.
+template<typename Mechanism, typename T, typename Enable=void>
struct is_single_type_consumer
: public boost::false_type {};
-template<typename T>
-struct is_single_type_consumer<T,
+template<typename Mechanism, typename T>
+struct is_single_type_consumer<Mechanism, T,
typename detail::enable_if_defined<detail::all_of<
- typename consumer_category_of<T>::type,
- typename consumed_type_of<T>::type>
- >::type >
+ typename consumer_category_of<Mechanism, T>::type,
+ typename consumed_type_of<Mechanism, T>::type
+ > >::type >
: public boost::true_type {};
+template<typename Mechanism, typename ConsumerTag, typename ConsumedType>
+struct single_type_consumer
+{
+ template<typename M, typename Enable=void>
+ struct dataflow
+ {
+ };
+
+ template<typename M>
+ struct dataflow<M, typename boost::enable_if<is_same<M, Mechanism> >::type>
+ {
+ typedef ConsumerTag consumer_category;
+ typedef ConsumedType consumed_type;
+ };
+};
+
+template<typename ConsumerTag, typename ConsumedType>
+struct single_type_consumer<all_mechanisms, ConsumerTag, ConsumedType>
+{
+ template<typename M>
+ struct dataflow
+ {
+ typedef ConsumerTag consumer_category;
+ typedef ConsumedType consumed_type;
+ };
+};
+
} } // namespace boost::dataflow
#endif // BOOST_DATAFLOW_SUPPORT_CONSUMER_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/filter.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/filter.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/filter.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -12,30 +12,32 @@
namespace boost { namespace dataflow {
// trait giving the producer category of a type.
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct filter_category_of
{
};
-template<typename T>
-struct filter_category_of<T,
- typename detail::enable_if_defined<typename T::filter_category>::type >
+template<typename Mechanism, typename T>
+struct filter_category_of<Mechanism, T,
+ typename detail::enable_if_defined<typename T::template dataflow<Mechanism>::filter_category>::type >
{
- typedef typename T::filter_category type;
+ typedef typename T::template dataflow<Mechanism>::filter_category type;
};
-template<typename T>
-struct producer_category_of<T,
- typename detail::enable_if_defined<typename filter_category_of<T>::type>::type >
+template<typename Mechanism, typename T>
+struct producer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename filter_category_of<Mechanism, T>::type
+ >::type >
{
- typedef typename filter_category_of<T>::type type;
+ typedef typename filter_category_of<Mechanism, T>::type type;
};
-template<typename T>
-struct consumer_category_of<T,
- typename detail::enable_if_defined<typename filter_category_of<T>::type>::type >
+template<typename Mechanism, typename T>
+struct consumer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<typename filter_category_of<Mechanism, T>::type>::type >
{
- typedef typename filter_category_of<T>::type type;
+ typedef typename filter_category_of<Mechanism, T>::type type;
};
} } // namespace boost::dataflow
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -7,57 +7,123 @@
#define BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
#include <boost/dataflow/detail/enable_if_defined.hpp>
+#include <boost/dataflow/support/common.hpp>
-#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/integral_constant.hpp>
-#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost { namespace dataflow {
-// trait giving the producer category of a type.
-template<typename T, typename Enable=void>
+/// Trait giving the producer category of a type.
+template<typename Mechanism, typename T, typename Enable=void>
struct producer_category_of
{
};
-template<typename T>
-struct producer_category_of<T,
- typename detail::enable_if_defined<typename T::producer_category>::type >
+/// Allows intrusive specification of the producer category.
+template<typename Mechanism, typename T>
+struct producer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::producer_category>::type
+ >
{
- typedef typename T::producer_category type;
+ typedef typename T::template dataflow<Mechanism>::producer_category type;
};
-template<typename T, typename Enable=void>
-struct produced_type_of
-{
-};
-
-// trait determining whether a type is a Producer.
-template<typename T, typename Enable=void>
+/// Trait determining whether a type is a Producer.
+template<typename Mechanism, typename T, typename Enable=void>
struct is_producer
: public boost::false_type {};
-template<typename T>
-struct is_producer<T,
+template<typename Mechanism, typename T>
+struct is_producer<Mechanism, T,
typename detail::enable_if_defined<
- typename producer_category_of<T>::type
+ typename producer_category_of<Mechanism, T>::type
>::type >
: public boost::true_type {};
-// trait determining whether a type is a SingleTypeProducer.
-template<typename T, typename Enable=void>
+/// Trait giving the produced type of a SingleTypeProducer.
+template<typename Mechanism, typename T, typename Enable=void>
+struct produced_type_of
+{
+};
+
+/// Allows intrusive specification of the producer category.
+template<typename Mechanism, typename T>
+struct produced_type_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::produced_type>::type
+ >
+{
+ typedef typename T::template dataflow<Mechanism>::produced_type type;
+};
+
+template<typename Mechanism, typename ProducerTag>
+struct producer
+{
+ template<typename M, typename Enable=void>
+ struct dataflow
+ {
+ };
+
+ template<typename M>
+ struct dataflow<M, typename boost::enable_if<is_same<M, Mechanism> >::type>
+ {
+ typedef ProducerTag producer_category;
+ };
+};
+
+template<typename ProducerTag>
+struct producer<all_mechanisms, ProducerTag>
+{
+ template<typename M>
+ struct dataflow
+ {
+ typedef ProducerTag producer_category;
+ };
+};
+
+// Trait determining whether a type is a SingleTypeProducer.
+template<typename Mechanism, typename T, typename Enable=void>
struct is_single_type_producer
: public boost::false_type {};
-template<typename T>
-struct is_single_type_producer<T,
+template<typename Mechanism, typename T>
+struct is_single_type_producer<Mechanism, T,
typename detail::enable_if_defined<detail::all_of<
- typename producer_category_of<T>::type,
- typename produced_type_of<T>::type
+ typename producer_category_of<Mechanism, T>::type,
+ typename produced_type_of<Mechanism, T>::type
> >::type >
: public boost::true_type {};
+template<typename Mechanism, typename ProducerTag, typename ProducedType>
+struct single_type_producer
+{
+ template<typename M, typename Enable=void>
+ struct dataflow
+ {
+ };
+
+ template<typename M>
+ struct dataflow<M, typename boost::enable_if<is_same<M, Mechanism> >::type>
+ {
+ typedef ProducerTag producer_category;
+ typedef ProducedType produced_type;
+ };
+};
+
+template<typename ProducerTag, typename ProducedType>
+struct single_type_producer<all_mechanisms, ProducerTag, ProducedType>
+{
+ template<typename M>
+ struct dataflow
+ {
+ typedef ProducerTag producer_category;
+ typedef ProducedType produced_type;
+ };
+};
+
} } // namespace boost::dataflow
#endif // BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -13,68 +13,72 @@
namespace boost { namespace dataflow {
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct proxied_consumer_of
{
};
-template<typename T>
-struct proxied_consumer_of<T,
-typename detail::enable_if_defined<typename T::proxy_consumer_for >::type >
+template<typename Mechanism, typename T>
+struct proxied_consumer_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::proxy_consumer_for >::type >
{
- typedef typename T::proxy_consumer_for type;
+ typedef typename T::template dataflow<Mechanism>::proxy_consumer_for type;
};
struct default_proxy_consumer;
struct mutable_proxy_consumer;
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct proxy_consumer_category_of
{
typedef default_proxy_consumer type;
};
-template<typename T>
-struct proxy_consumer_category_of<T,
-typename detail::enable_if_defined<typename T::proxy_consumer_category >::type >
+template<typename Mechanism, typename T>
+struct proxy_consumer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::proxy_consumer_category
+ >::type >
{
- typedef typename T::proxy_consumer_category type;
+ typedef typename T::template dataflow<Mechanism>::proxy_consumer_category type;
};
// trait determining whether a type is a consumer proxy.
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct is_proxy_consumer
: public boost::false_type {};
-template<typename T>
-struct is_proxy_consumer<T,
+template<typename Mechanism, typename T>
+struct is_proxy_consumer<Mechanism, T,
typename detail::enable_if_defined<
detail::all_of<
- typename proxied_consumer_of<T>::type,
- typename proxy_consumer_category_of<T>::type
+ typename proxied_consumer_of<Mechanism, T>::type,
+ typename proxy_consumer_category_of<Mechanism, T>::type
>
>::type >
: public boost::true_type {};
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct get_proxied_consumer_type
{
typedef T type;
};
-template<typename T>
-struct get_proxied_consumer_type<T,
- typename boost::enable_if<is_proxy_consumer<T> >::type>
+template<typename Mechanism, typename T>
+struct get_proxied_consumer_type<Mechanism, T,
+ typename boost::enable_if<is_proxy_consumer<Mechanism, T> >::type>
{
typedef
typename get_proxied_consumer_type<
- typename proxied_consumer_of<T>::type
+ Mechanism,
+ typename proxied_consumer_of<Mechanism, T>::type
>::type type;
};
namespace extension
{
- template<typename ProxyProducerTag>
+ template<typename Mechanism, typename ProxyProducerTag>
struct get_proxied_consumer_impl
{
template<typename ProxyProducer>
@@ -89,34 +93,40 @@
};
};
- template<>
- struct get_proxied_consumer_impl<default_proxy_consumer>
+ template<typename Mechanism>
+ struct get_proxied_consumer_impl<Mechanism, default_proxy_consumer>
{
template<typename ProxyProducer>
struct result
{
typedef typename
- boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_consumer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct result<const ProxyProducer>
{
typedef const typename
- boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_consumer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct apply
{
static typename
- boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type &
+ boost::dataflow::get_proxied_consumer_type<Mechanism, ProxyProducer>::type &
call(ProxyProducer &t)
{
return t.get_proxied_consumer();
}
static
- const typename boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type &
+ const typename boost::dataflow::get_proxied_consumer_type<Mechanism, ProxyProducer>::type &
call(const ProxyProducer &t)
{
return t.get_proxied_consumer();
@@ -124,21 +134,24 @@
};
};
- template<>
- struct get_proxied_consumer_impl<mutable_proxy_consumer>
+ template<typename Mechanism>
+ struct get_proxied_consumer_impl<Mechanism, mutable_proxy_consumer>
{
template<typename ProxyProducer>
struct result
{
typedef typename
- boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_consumer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct apply
{
static
- typename boost::dataflow::get_proxied_consumer_type<ProxyProducer>::type &
+ typename boost::dataflow::get_proxied_consumer_type<Mechanism, ProxyProducer>::type &
call(const ProxyProducer &t)
{
return t.get_proxied_consumer();
@@ -148,9 +161,9 @@
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::disable_if<
- is_proxy_consumer<T>,
+ is_proxy_consumer<Mechanism, T>,
const T &
>::type
get_proxied_consumer(const T &t)
@@ -158,9 +171,9 @@
return t;
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::disable_if<
- is_proxy_consumer<T>,
+ is_proxy_consumer<Mechanism, T>,
T &
>::type
get_proxied_consumer(T &t)
@@ -168,46 +181,50 @@
return t;
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::lazy_enable_if<
- is_proxy_consumer<T>,
- typename extension::get_proxied_consumer_impl<
- typename proxy_consumer_category_of<T>::type>::template result<T>
+ is_proxy_consumer<Mechanism, T>,
+ typename extension::get_proxied_consumer_impl<Mechanism,
+ typename proxy_consumer_category_of<Mechanism, T>::type>::template result<T>
>::type
get_proxied_consumer(T &t)
{
- return extension::get_proxied_consumer_impl<
- typename proxy_consumer_category_of<T>::type>::template apply<T>::call(t);
+ return extension::get_proxied_consumer_impl<Mechanism,
+ typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<T>::call(t);
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::lazy_enable_if<
- is_proxy_consumer<T>,
+ is_proxy_consumer<Mechanism, T>,
typename extension::get_proxied_consumer_impl<
- typename proxy_consumer_category_of<T>::type>::template result<const T>
+ Mechanism,
+ typename proxy_consumer_category_of<Mechanism, T>::type>::template result<const T>
>::type
get_proxied_consumer(const T &t)
{
return extension::get_proxied_consumer_impl<
- typename proxy_consumer_category_of<T>::type>::template apply<T>::call(t);
+ Mechanism,
+ typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<T>::call(t);
}
-template<typename T>
-struct consumer_category_of<T,
- typename boost::enable_if<is_proxy_consumer<T> >::type>
+template<typename Mechanism, typename T>
+struct consumer_category_of<Mechanism, T,
+ typename boost::enable_if<is_proxy_consumer<Mechanism, T> >::type>
{
typedef
typename consumer_category_of<
- typename get_proxied_consumer_type<T>::type
+ Mechanism,
+ typename get_proxied_consumer_type<Mechanism, T>::type
>::type type;
};
-template<typename T>
-struct produced_type_of<T, typename boost::enable_if<is_proxy_consumer<T> >::type>
+template<typename Mechanism, typename T>
+struct consumed_type_of<Mechanism, T, typename boost::enable_if<is_proxy_consumer<Mechanism, T> >::type>
{
typedef
- typename produced_type_of<
- typename get_proxied_consumer_type<T>::type
+ typename consumed_type_of<
+ Mechanism,
+ typename get_proxied_consumer_type<Mechanism, T>::type
>::type type;
};
Modified: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -16,68 +16,72 @@
namespace boost { namespace dataflow {
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct proxied_producer_of
{
};
-template<typename T>
-struct proxied_producer_of<T,
-typename detail::enable_if_defined<typename T::proxy_producer_for >::type >
+template<typename Mechanism, typename T>
+struct proxied_producer_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::proxy_producer_for >::type >
{
- typedef typename T::proxy_producer_for type;
+ typedef typename T::template dataflow<Mechanism>::proxy_producer_for type;
};
struct default_proxy_producer;
struct mutable_proxy_producer;
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct proxy_producer_category_of
{
typedef default_proxy_producer type;
};
-template<typename T>
-struct proxy_producer_category_of<T,
-typename detail::enable_if_defined<typename T::proxy_producer_category >::type >
+template<typename Mechanism, typename T>
+struct proxy_producer_category_of<Mechanism, T,
+ typename detail::enable_if_defined<
+ typename T::template dataflow<Mechanism>::proxy_producer_category
+ >::type >
{
- typedef typename T::proxy_producer_category type;
+ typedef typename T::template dataflow<Mechanism>::proxy_producer_category type;
};
// trait determining whether a type is a producer proxy.
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct is_proxy_producer
: public boost::false_type {};
-template<typename T>
-struct is_proxy_producer<T,
+template<typename Mechanism, typename T>
+struct is_proxy_producer<Mechanism, T,
typename detail::enable_if_defined<
detail::all_of<
- typename proxied_producer_of<T>::type,
- typename proxy_producer_category_of<T>::type
+ typename proxied_producer_of<Mechanism, T>::type,
+ typename proxy_producer_category_of<Mechanism, T>::type
>
>::type >
: public boost::true_type {};
-template<typename T, typename Enable=void>
+template<typename Mechanism, typename T, typename Enable=void>
struct get_proxied_producer_type
{
typedef T type;
};
-template<typename T>
-struct get_proxied_producer_type<T,
- typename boost::enable_if<is_proxy_producer<T> >::type>
+template<typename Mechanism, typename T>
+struct get_proxied_producer_type<Mechanism, T,
+ typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
{
typedef
typename get_proxied_producer_type<
- typename proxied_producer_of<T>::type
+ Mechanism,
+ typename proxied_producer_of<Mechanism, T>::type
>::type type;
};
namespace extension
{
- template<typename ProxyProducerTag>
+ template<typename Mechanism, typename ProxyProducerTag>
struct get_proxied_producer_impl
{
template<typename ProxyProducer>
@@ -92,68 +96,77 @@
};
};
- template<>
- struct get_proxied_producer_impl<default_proxy_producer>
+ template<typename Mechanism>
+ struct get_proxied_producer_impl<Mechanism, default_proxy_producer>
{
template<typename ProxyProducer>
struct result
{
typedef typename
- boost::dataflow::get_proxied_producer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_producer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct result<const ProxyProducer>
{
typedef const typename
- boost::dataflow::get_proxied_producer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_producer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct apply
{
static typename
- boost::dataflow::get_proxied_producer_type<ProxyProducer>::type &
+ boost::dataflow::get_proxied_producer_type<Mechanism, ProxyProducer>::type &
call(ProxyProducer &t)
{
return t.get_proxied_producer();
}
static
- const typename boost::dataflow::get_proxied_producer_type<ProxyProducer>::type &
+ const typename boost::dataflow::get_proxied_producer_type<Mechanism, ProxyProducer>::type &
call(const ProxyProducer &t)
{
- return t.get_proxied_producer();
+ return ProxyProducer::template dataflow<Mechanism>::get_proxied_producer(t);
}
};
};
- template<>
- struct get_proxied_producer_impl<mutable_proxy_producer>
+ template<typename Mechanism>
+ struct get_proxied_producer_impl<Mechanism, mutable_proxy_producer>
{
template<typename ProxyProducer>
struct result
{
typedef typename
- boost::dataflow::get_proxied_producer_type<ProxyProducer>::type & type;
+ boost::dataflow::get_proxied_producer_type<
+ Mechanism,
+ ProxyProducer
+ >::type & type;
};
template<typename ProxyProducer>
struct apply
{
static
- typename boost::dataflow::get_proxied_producer_type<ProxyProducer>::type &
+ typename boost::dataflow::get_proxied_producer_type<Mechanism, ProxyProducer>::type &
call(const ProxyProducer &t)
{
- return t.get_proxied_producer();
+ return ProxyProducer::template dataflow<Mechanism>::get_proxied_producer(t);
}
};
};
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::disable_if<
- is_proxy_producer<T>,
+ is_proxy_producer<Mechanism, T>,
const T &
>::type
get_proxied_producer(const T &t)
@@ -161,9 +174,9 @@
return t;
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::disable_if<
- is_proxy_producer<T>,
+ is_proxy_producer<Mechanism, T>,
T &
>::type
get_proxied_producer(T &t)
@@ -171,46 +184,50 @@
return t;
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::lazy_enable_if<
- is_proxy_producer<T>,
- typename extension::get_proxied_producer_impl<
- typename proxy_producer_category_of<T>::type>::template result<T>
+ is_proxy_producer<Mechanism, T>,
+ typename extension::get_proxied_producer_impl<Mechanism,
+ typename proxy_producer_category_of<Mechanism, T>::type>::template result<T>
>::type
get_proxied_producer(T &t)
{
- return extension::get_proxied_producer_impl<
- typename proxy_producer_category_of<T>::type>::template apply<T>::call(t);
+ return extension::get_proxied_producer_impl<Mechanism,
+ typename proxy_producer_category_of<Mechanism, T>::type>::template apply<T>::call(t);
}
-template<typename T>
+template<typename Mechanism, typename T>
typename boost::lazy_enable_if<
- is_proxy_producer<T>,
+ is_proxy_producer<Mechanism, T>,
typename extension::get_proxied_producer_impl<
- typename proxy_producer_category_of<T>::type>::template result<const T>
+ Mechanism,
+ typename proxy_producer_category_of<Mechanism, T>::type>::template result<const T>
>::type
get_proxied_producer(const T &t)
{
return extension::get_proxied_producer_impl<
- typename proxy_producer_category_of<T>::type>::template apply<T>::call(t);
+ Mechanism,
+ typename proxy_producer_category_of<Mechanism, T>::type>::template apply<T>::call(t);
}
-template<typename T>
-struct producer_category_of<T,
- typename boost::enable_if<is_proxy_producer<T> >::type>
+template<typename Mechanism, typename T>
+struct producer_category_of<Mechanism, T,
+ typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
{
typedef
typename producer_category_of<
- typename get_proxied_producer_type<T>::type
+ Mechanism,
+ typename get_proxied_producer_type<Mechanism, T>::type
>::type type;
};
-template<typename T>
-struct produced_type_of<T, typename boost::enable_if<is_proxy_producer<T> >::type>
+template<typename Mechanism, typename T>
+struct produced_type_of<Mechanism, T, typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
{
typedef
typename produced_type_of<
- typename get_proxied_producer_type<T>::type
+ Mechanism,
+ typename get_proxied_producer_type<Mechanism, T>::type
>::type type;
};
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-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -87,27 +87,14 @@
083FD3B90C62A4CB00EF3F6B /* concepts.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = concepts.qbk; sourceTree = "<group>"; };
083FD3C10C62A75B00EF3F6B /* concepts.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = concepts.qbk; sourceTree = "<group>"; };
083FD3C60C62A7F600EF3F6B /* phoenix.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = phoenix.qbk; sourceTree = "<group>"; };
+ 084482560CA0B37200B88137 /* operators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = operators.hpp; sourceTree = "<group>"; };
08668C4E0C19A16300ACB19A /* example.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = example.cpp; sourceTree = "<group>"; };
08668C4F0C19A16300ACB19A /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Jamfile.v2; sourceTree = "<group>"; };
- 08668C560C19AD0100ACB19A /* test_connections.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_connections.cpp; sourceTree = "<group>"; };
089A9A090C931A1800C6C5F1 /* proxy_consumer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = proxy_consumer.hpp; sourceTree = "<group>"; };
089A9A150C931BDD00C6C5F1 /* producer_map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = producer_map.hpp; sourceTree = "<group>"; };
08C3EEA20C625AE30074AB9E /* simple_example.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simple_example.cpp; sourceTree = "<group>"; };
08C675970C13A03E00D85379 /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Jamfile.v2; sourceTree = "<group>"; };
- 08C675980C13A03E00D85379 /* test_chain.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_chain.cpp; sourceTree = "<group>"; };
- 08C675990C13A03E00D85379 /* test_counter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_counter.cpp; sourceTree = "<group>"; };
- 08C6759A0C13A03E00D85379 /* test_function.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_function.cpp; sourceTree = "<group>"; };
- 08C6759B0C13A03E00D85379 /* test_junction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_junction.cpp; sourceTree = "<group>"; };
- 08C6759C0C13A03E00D85379 /* test_mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_mutex.cpp; sourceTree = "<group>"; };
- 08C6759D0C13A03E00D85379 /* test_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_socket.cpp; sourceTree = "<group>"; };
- 08C6759E0C13A03E00D85379 /* test_storage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_storage.cpp; sourceTree = "<group>"; };
- 08C8F14F0C3B269B00B3CE45 /* test_bind_object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_bind_object.cpp; sourceTree = "<group>"; };
08DC14FC0C951C4800B96B2E /* Cone.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cone.cxx; sourceTree = "<group>"; };
- 08EBB2CB0C210CC9004BE220 /* test_pull.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_pull.cpp; sourceTree = "<group>"; };
- 08EBB3020C21105B004BE220 /* test_disconnect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_disconnect.cpp; sourceTree = "<group>"; };
- 08EBB3910C211C36004BE220 /* test_multi_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_type.cpp; sourceTree = "<group>"; };
- 08EBB3BC0C211F23004BE220 /* test_same_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_same_type.cpp; sourceTree = "<group>"; };
- 08EBB3E00C21209B004BE220 /* test_multi_args.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_args.cpp; sourceTree = "<group>"; };
08EF9B220C5D506A00D4D206 /* applicator.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = applicator.hpp; sourceTree = "<group>"; };
08EF9B230C5D506A00D4D206 /* chain.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = chain.hpp; sourceTree = "<group>"; };
08EF9B240C5D506A00D4D206 /* conditional.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = conditional.hpp; sourceTree = "<group>"; };
@@ -134,7 +121,6 @@
08EF9B3E0C5D506A00D4D206 /* result_of_defined.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = result_of_defined.hpp; sourceTree = "<group>"; };
08EF9B3F0C5D506A00D4D206 /* slot_type.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = slot_type.hpp; sourceTree = "<group>"; };
08EF9B420C5D506A00D4D206 /* slot_selector.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = slot_selector.hpp; sourceTree = "<group>"; };
- 08EF9B430C5D506A00D4D206 /* slot_selector_map.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = slot_selector_map.hpp; sourceTree = "<group>"; };
08EF9B440C5D506A00D4D206 /* connection.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = connection.hpp; sourceTree = "<group>"; };
08EF9B460C5D506A00D4D206 /* enable_if_defined.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = enable_if_defined.hpp; sourceTree = "<group>"; };
08EF9B470C5D506A00D4D206 /* unfused_typed_class.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = unfused_typed_class.hpp; sourceTree = "<group>"; };
@@ -150,7 +136,6 @@
08F082020C1D591000687E1B /* introduction.qbk */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = introduction.qbk; sourceTree = "<group>"; };
08F082570C1DD53400687E1B /* components.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = components.qbk; sourceTree = "<group>"; };
08F0825A0C1DD58500687E1B /* connections.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = connections.qbk; sourceTree = "<group>"; };
- 08F082840C1DE02F00687E1B /* test_branching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_branching.cpp; sourceTree = "<group>"; };
08F20FB60C95AD97005D01D4 /* filter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = filter.hpp; sourceTree = "<group>"; };
08F22ECE0C4BF6130027D364 /* make_ref.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_ref.hpp; sourceTree = "<group>"; };
08F22ED60C4BF78B0027D364 /* sequence_environment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence_environment.hpp; sourceTree = "<group>"; };
@@ -162,14 +147,33 @@
08F348510C492B4B0096097F /* group.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = group.hpp; sourceTree = "<group>"; };
08F36DFB0C41375B00E2F9A1 /* dataflow_table.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = dataflow_table.xml; sourceTree = "<group>"; };
08F37EDF0C57A4A700AC7FB8 /* static_function_call.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = static_function_call.hpp; sourceTree = "<group>"; };
+ 08F3FE0C0CA0975100F0E144 /* common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common.hpp; sourceTree = "<group>"; };
08F4533A0C92259D00877528 /* proxy_producer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = proxy_producer.hpp; sourceTree = "<group>"; };
08F496DA0C9A15EC00C37AC0 /* support.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = support.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>"; };
- 08F79CF00C3B58E700B6450B /* test_connect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_connect.cpp; sourceTree = "<group>"; };
- 08F803D30C21895700D8296D /* test_multi_out.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_out.cpp; sourceTree = "<group>"; };
- 08F804AD0C219CC300D8296D /* test_filter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_filter.cpp; sourceTree = "<group>"; };
+ 08F71D320CA3538E0010099E /* producer_concepts.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = producer_concepts.qbk; sourceTree = "<group>"; };
+ 08F71D390CA353F40010099E /* consumer_concepts.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = consumer_concepts.qbk; sourceTree = "<group>"; };
+ 08F71D3E0CA3547C0010099E /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Jamfile.v2; sourceTree = "<group>"; };
+ 08F71D3F0CA3547C0010099E /* test_bind_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_bind_object.cpp; sourceTree = "<group>"; };
+ 08F71D400CA3547C0010099E /* test_branching.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_branching.cpp; sourceTree = "<group>"; };
+ 08F71D410CA3547C0010099E /* test_chain.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_chain.cpp; sourceTree = "<group>"; };
+ 08F71D420CA3547C0010099E /* test_connect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_connect.cpp; sourceTree = "<group>"; };
+ 08F71D430CA3547C0010099E /* test_connections.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_connections.cpp; sourceTree = "<group>"; };
+ 08F71D440CA3547C0010099E /* test_counter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_counter.cpp; sourceTree = "<group>"; };
+ 08F71D450CA3547C0010099E /* test_disconnect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_disconnect.cpp; sourceTree = "<group>"; };
+ 08F71D460CA3547C0010099E /* test_filter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_filter.cpp; sourceTree = "<group>"; };
+ 08F71D470CA3547C0010099E /* test_function.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_function.cpp; sourceTree = "<group>"; };
+ 08F71D480CA3547C0010099E /* test_junction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_junction.cpp; sourceTree = "<group>"; };
+ 08F71D490CA3547C0010099E /* test_multi_args.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_args.cpp; sourceTree = "<group>"; };
+ 08F71D4A0CA3547C0010099E /* test_multi_out.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_out.cpp; sourceTree = "<group>"; };
+ 08F71D4B0CA3547C0010099E /* test_multi_type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_multi_type.cpp; sourceTree = "<group>"; };
+ 08F71D4C0CA3547C0010099E /* test_mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_mutex.cpp; sourceTree = "<group>"; };
+ 08F71D4D0CA3547C0010099E /* test_pull.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_pull.cpp; sourceTree = "<group>"; };
+ 08F71D4E0CA3547C0010099E /* test_same_type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_same_type.cpp; sourceTree = "<group>"; };
+ 08F71D4F0CA3547C0010099E /* test_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_socket.cpp; sourceTree = "<group>"; };
+ 08F71D500CA3547C0010099E /* test_storage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_storage.cpp; sourceTree = "<group>"; };
08F8A00B0C3C879C007637A9 /* test_result_of_defined.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_result_of_defined.cpp; sourceTree = "<group>"; };
08F9459A0C46A86E00E224E4 /* components.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = components.hpp; sourceTree = "<group>"; };
08F9462E0C46C2F000E224E4 /* fibonacci.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fibonacci.cpp; sourceTree = "<group>"; };
@@ -241,25 +245,8 @@
08C675960C13A03E00D85379 /* test */ = {
isa = PBXGroup;
children = (
+ 08F71D3D0CA3547C0010099E /* signals */,
08C675970C13A03E00D85379 /* Jamfile.v2 */,
- 08C675980C13A03E00D85379 /* test_chain.cpp */,
- 08C675990C13A03E00D85379 /* test_counter.cpp */,
- 08C6759A0C13A03E00D85379 /* test_function.cpp */,
- 08C6759B0C13A03E00D85379 /* test_junction.cpp */,
- 08C6759C0C13A03E00D85379 /* test_mutex.cpp */,
- 08C6759D0C13A03E00D85379 /* test_socket.cpp */,
- 08C6759E0C13A03E00D85379 /* test_storage.cpp */,
- 08668C560C19AD0100ACB19A /* test_connections.cpp */,
- 08F082840C1DE02F00687E1B /* test_branching.cpp */,
- 08EBB2CB0C210CC9004BE220 /* test_pull.cpp */,
- 08EBB3020C21105B004BE220 /* test_disconnect.cpp */,
- 08EBB3910C211C36004BE220 /* test_multi_type.cpp */,
- 08EBB3BC0C211F23004BE220 /* test_same_type.cpp */,
- 08EBB3E00C21209B004BE220 /* test_multi_args.cpp */,
- 08F803D30C21895700D8296D /* test_multi_out.cpp */,
- 08F804AD0C219CC300D8296D /* test_filter.cpp */,
- 08C8F14F0C3B269B00B3CE45 /* test_bind_object.cpp */,
- 08F79CF00C3B58E700B6450B /* test_connect.cpp */,
08F8A00B0C3C879C007637A9 /* test_result_of_defined.cpp */,
);
name = test;
@@ -320,7 +307,7 @@
children = (
08EF9B3B0C5D506A00D4D206 /* detail */,
08EF9B420C5D506A00D4D206 /* slot_selector.hpp */,
- 08EF9B430C5D506A00D4D206 /* slot_selector_map.hpp */,
+ 084482560CA0B37200B88137 /* operators.hpp */,
);
path = connection;
sourceTree = "<group>";
@@ -362,6 +349,7 @@
08F4533A0C92259D00877528 /* proxy_producer.hpp */,
089A9A090C931A1800C6C5F1 /* proxy_consumer.hpp */,
08F20FB60C95AD97005D01D4 /* filter.hpp */,
+ 08F3FE0C0CA0975100F0E144 /* common.hpp */,
);
path = support;
sourceTree = "<group>";
@@ -411,6 +399,32 @@
path = detail;
sourceTree = "<group>";
};
+ 08F71D3D0CA3547C0010099E /* signals */ = {
+ isa = PBXGroup;
+ children = (
+ 08F71D3E0CA3547C0010099E /* Jamfile.v2 */,
+ 08F71D3F0CA3547C0010099E /* test_bind_object.cpp */,
+ 08F71D400CA3547C0010099E /* test_branching.cpp */,
+ 08F71D410CA3547C0010099E /* test_chain.cpp */,
+ 08F71D420CA3547C0010099E /* test_connect.cpp */,
+ 08F71D430CA3547C0010099E /* test_connections.cpp */,
+ 08F71D440CA3547C0010099E /* test_counter.cpp */,
+ 08F71D450CA3547C0010099E /* test_disconnect.cpp */,
+ 08F71D460CA3547C0010099E /* test_filter.cpp */,
+ 08F71D470CA3547C0010099E /* test_function.cpp */,
+ 08F71D480CA3547C0010099E /* test_junction.cpp */,
+ 08F71D490CA3547C0010099E /* test_multi_args.cpp */,
+ 08F71D4A0CA3547C0010099E /* test_multi_out.cpp */,
+ 08F71D4B0CA3547C0010099E /* test_multi_type.cpp */,
+ 08F71D4C0CA3547C0010099E /* test_mutex.cpp */,
+ 08F71D4D0CA3547C0010099E /* test_pull.cpp */,
+ 08F71D4E0CA3547C0010099E /* test_same_type.cpp */,
+ 08F71D4F0CA3547C0010099E /* test_socket.cpp */,
+ 08F71D500CA3547C0010099E /* test_storage.cpp */,
+ );
+ path = signals;
+ sourceTree = "<group>";
+ };
08FB7BEE0C6157AE00BD4EC2 /* signals */ = {
isa = PBXGroup;
children = (
@@ -480,6 +494,8 @@
08FB7BFE0C61597000BD4EC2 /* signals.qbk */,
083FD3C60C62A7F600EF3F6B /* phoenix.qbk */,
08F077830C63F736003D448D /* components.qbk */,
+ 08F71D320CA3538E0010099E /* producer_concepts.qbk */,
+ 08F71D390CA353F40010099E /* consumer_concepts.qbk */,
);
name = doc;
path = ../../doc;
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-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -1,6 +1,6 @@
[section Concepts]
-To explore generic dataflow in C++, let us begin by examining where the flow of
+[/To explore generic dataflow in C++, let us begin by examining where the flow of
data happens in C++. Rather informally, we can divide things as follows:
* on one hand, there is data (variables, objects, etc...)
@@ -22,7 +22,21 @@
* the element returns it as a return value
With the above in mind, let's informally introduce a few concepts related to dataflow
-programming:
+programming:]
+
+[heading Mechanisms]
+
+There are many different environments that offer dataflow-related functionality.
+For example, [BoostSignals] offers transfer of data through function calls,
+while [VTK] offers a number of classes which are meant to be connected in
+a pipline (e.g., starting with the data source, manipulating it, and
+finally displaying it on the screen).
+
+[BoostSignals] and [VTK] are examples of different /mechanisms/ - particular
+environments each offering their own, independent way of doing dataflow.
+In the Dataflow library, everything is keyed through a mechanism typename
+tag, allowing different mechanisms to be specified independently, and
+allowing a single component to support muliple mechanisms.
[heading Components]
@@ -41,7 +55,7 @@
Producers and consumers are captured more formally by the [ProducerConcept]
and [ConsumerConcept] concepts. There is no concept directly corresponding to
a component, because a component is a more abstract notion - i.e., a component
-is whatever makes sense for the design application. Typically, though, a
+is whatever makes sense for the application design. Typically, though, a
component is embedded in a class, and the different [ProducerConcept]s
and [ConsumerConcept]s are accessible either through the class
directly, or through its member functions and variables.
@@ -111,200 +125,11 @@
if it causes the invoked producer to also invoke the consumer, or if it causes
the invoked consumer to invoke the producer.]
-[section Producer]
-
-A type `P` is a ['[ProducerConcept]] if it defines a producer category,
-a produced type, and specifies whether it is invocable.
-To be useful, a [ProducerConcept] should likely be
-[ConnectableConcept] to at least one [ConsumerConcept]. Also, at least
-one component of a connected network should be [InvocableConcept].
-
-[heading Refinements]
-* [PhoenixProducerConcept]
-
-[heading Notation]
-The following expressions are used in this document:
-
-[variablelist
- [[P] [A Producer type.]]
-]
-
-[heading Requirements]
-[table
- [[Name] [Expression] [Result Type] [Description]]
- [
- [Producer Category]
- [`producer_category_of<P>::type`
- [footnote `namespace boost::dataflow`]]
- [Any type]
- [
- *Semantics:* The category of the producer, used for tag forwarding.
- ]
- ]
- [
- [Produced Type]
- [`produced_type_of<P>::type`
- [footnote `namespace boost::dataflow`]]
- [Any type]
- [
- *Semantics:* The type of data produced by the producer.
- [footnote This might
- mean different things for different producer categories - for
- example, a SignalProducer uses function types, whereas
- a PhoenixProducer uses object types.].
- ]
- ]
- [
- [Producer Trait]
- [`is_producer<P>::type`
- [footnote `namespace boost::dataflow`]]
- [mpl::true_ or boost::true_type]
- [
- *Semantics:* A trait encapsulating adherence to the Producer
- concept.
- ]
- ]
- [
- [Invocable]
- [`is_invocable<P>::type`
- [footnote `namespace boost::dataflow`]]
- [Boolean metafunction]
- [
- *Semantics:* A producer must specify if it is [InvocableConcept].
- ]
- ]
-]
-
-[heading Notes]
-
-To define a new [ProducerConcept] class type, it is sufficient to define
-member typedefs `producer_category` and `produced_type`.
-
-[heading Examples]
-
-[endsect][/producer]
-
-
-[section ProxyProducer]
-
-A type `PP` is a ['[ProxyProducerConcept]] if specifies the proxied producer
-type, and if objects of the proxied type can be retreived from objects of
-[ProxyProducerConcept] type. If the proxied producer type is a valid
-[ProducerConcept], then 'PP' satisfies the [ProducerConcept] requirements
-in the same way.
-
-[heading Notation]
-The following expressions are used in this document:
-
-[variablelist
- [[PP] [A ProxyProducer type.]]
- [[pp] [An object of type `PP`]]
-]
-
-[heading Requirements]
-[table
- [[Name] [Expression] [Result Type] [Semantics]]
- [
- [Proxy Producer Category]
- [`proxy_producer_category_of<PP>::type`
- [footnote `namespace boost::dataflow`]]
- [Any type]
- [
- The category of the proxy producer, used for tag forwarding.
- ]
- ]
- [
- [Proxied Producer Type]
- [`proxied_producer_of<PP>::type`
- [footnote `namespace boost::dataflow`]]
- [Any type]
- [
- The proxied producer type.
- ]
- ]
- [
- [Proxied Producer]
- [`get_proxied_producer(pp)`
- [footnote `namespace boost::dataflow`]]
- []
- [
- Retrieves a reference to the proxied producer object.
- ]
- ]
-]
-
-[heading Notes]
-
-To define a new [ProxyProducerConcept] class type, it is sufficient to define
-member typedefs `proxy_producer_category` and `proxy_producer_for`,
-and member function `get_proxied_producer`.
-
-[heading Examples]
-
-[endsect][/proxyproducer]
-
-
-[section Consumer]
-
-A type `T` is a /consumer/ if it defines a consumer category.
-To be useful, a [ConsumerConcept] should likely be
-[ConnectableConcept] to at least one [ProducerConcept]. Also, at least
-one component of a connected network should be [InvocableConcept].
-
-[heading Refinements]
-* [PhoenixConsumerConcept]
-
-[heading Notation]
-The following expressions are used in this document:
-
-[variablelist
- [[C] [A Consumer type.]]
-]
-
-[heading Requirements]
-[table
- [[Name] [Expression] [Result Type] [Description]]
- [
- [Consumer Category]
- [`consumer_category_of<C>::type`
- [footnote `namespace boost::dataflow`]]
- [Any type]
- [
- *Semantics:* The category of the producer, used for tag forwarding.
- ]
- ]
- [
- [Consumer Trait]
- [`is_consumer<C>::type`
- [footnote `namespace boost::dataflow`]]
- [mpl::true_ or boost::true_type]
- [
- *Semantics:* A trait encapsulating adherence to the Producer
- concept.
- ]
- ]
-[/ [
- [Consumed Types]
- [`consumed_types_of<P>::type`]
- [`mpl::set<any-type-list>`]
- [
- *Semantics:* The types of data consumed by the consumer.
- [footnote The types inside the `mpl::set` might
- mean different things for different consumer categories - for
- example, a SignalProducer uses function types, whereas
- a PhoenixProducer uses object types.].
- ]
- ] ]
-]
-
-[heading Notes]
-To define a new [ConsumerConcept] class type, it is sufficient to define
-member typedefs `consumer_category` and `consumed_types`.
-[heading Examples]
+[include producer_concepts.qbk]
-[endsect][/consumer]
+[include consumer_concepts.qbk]
[section Invocable]
Added: sandbox/SOC/2007/signals/libs/dataflow/doc/consumer_concepts.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/consumer_concepts.qbk 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -0,0 +1,93 @@
+
+
+[section ConsumerCategory]
+
+A ['[ConsumerCategoryConcept]] specifies the traits of a [ConsumerConcept].
+
+[heading Notation]
+[variablelist
+ [[CC] [A ConsumerCategory type.]]
+ [[C] [A [ConsumerConcept] type of producer category `CC`.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Semantics]]
+ [
+ [Connections Stored]
+ [`CC::connections_stored`]
+ [connections_none, connections_one, connections_many]
+ [
+ The number of incoming connections that `C` can store.
+ ]
+ ]
+]
+
+[heading Notes]
+
+[heading Examples]
+
+[endsect][/consumercategory]
+
+
+[section Consumer]
+
+A type `T` is a /consumer/ if it defines a consumer category.
+To be useful, a [ConsumerConcept] should likely be
+[ConnectableConcept] to at least one [ProducerConcept]. Also, at least
+one component of a connected network should be [InvocableConcept].
+
+[heading Refinements]
+* [PhoenixConsumerConcept]
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[C] [A Consumer type.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Description]]
+ [
+ [Consumer Category]
+ [`consumer_category_of<C>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ *Semantics:* The category of the producer, used for tag forwarding.
+ ]
+ ]
+ [
+ [Consumer Trait]
+ [`is_consumer<C>::type`
+ [footnote `namespace boost::dataflow`]]
+ [mpl::true_ or boost::true_type]
+ [
+ *Semantics:* A trait encapsulating adherence to the Producer
+ concept.
+ ]
+ ]
+[/ [
+ [Consumed Types]
+ [`consumed_types_of<P>::type`]
+ [`mpl::set<any-type-list>`]
+ [
+ *Semantics:* The types of data consumed by the consumer.
+ [footnote The types inside the `mpl::set` might
+ mean different things for different consumer categories - for
+ example, a SignalProducer uses function types, whereas
+ a PhoenixProducer uses object types.].
+ ]
+ ] ]
+]
+
+[heading Notes]
+
+To define a new [ConsumerConcept] class type, it is sufficient to define
+member typedefs `consumer_category` and `consumed_types`.
+
+[heading Examples]
+
+[endsect][/consumer]
\ No newline at end of file
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-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -3,7 +3,8 @@
[version 0.1]
[authors [Rajko, Stjepan]]
[copyright 2007 Stjepan Rajko]
- [purpose Operators and Components for signal-based networks.]
+ [purpose Generic dataflow lirary providing support for data producers,
+ consumers, and connections.]
[license
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
@@ -11,8 +12,11 @@
]
]
+[template ProducerCategoryConcept[] [link dataflow.concepts.producercategory [^ProducerCategory]]]
[template ProducerConcept[] [link dataflow.concepts.producer [^Producer]]]
[template ConsumerConcept[] [link dataflow.concepts.consumer [^Consumer]]]
+[template SingleTypeProducer[] [link dataflow.concepts.singletypeproducer [^SingleTypeProducer]]]
+[template SingleTypeConsumer[] [link dataflow.concepts.singletypeconsumer [^SingleTypeConsumer]]]
[template InvocableConcept[] [link dataflow.concepts.invocable [^Invocable]]]
[template ConnectableConcept[] [link dataflow.concepts.connectable [^Connectable]]]
[template ProxyProducerConcept[] [link dataflow.concepts.proxyproducer [^ProxyProducer]]]
@@ -52,26 +56,33 @@
[template fusion[] [@http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/index.html Boost.Fusion]]
[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 BoostPhoenix2[] [@http://spirit.sourceforge.net/ Boost.Phoenix2]]
[template BoostPhoenix[] [@http://spirit.sourceforge.net/ Boost.Phoenix]]
[template WikiDataflow[] [@http://en.wikipedia.org/wiki/Dataflow_language dataflow]]
+[template VTK[] [@http://www.vtk.org/ VTK]]
+
+
+[import ../test/signals/test_connect.cpp]
+[import ../test/signals/test_branching.cpp]
+[import ../test/signals/test_pull.cpp]
+[import ../test/signals/test_disconnect.cpp]
+[import ../test/signals/test_multi_type.cpp]
+[import ../test/signals/test_multi_args.cpp]
+[import ../test/signals/test_same_type.cpp]
+[import ../test/signals/test_multi_out.cpp]
+
+[import ../test/signals/test_filter.cpp]
+[import ../test/signals/test_storage.cpp]
+[import ../test/signals/test_counter.cpp]
+[import ../test/signals/test_function.cpp]
+[import ../test/signals/test_chain.cpp]
+[import ../test/signals/test_socket.cpp]
+
+[import ../test/signals/test_junction.cpp]
+[import ../test/signals/test_mutex.cpp]
-[import ../test/test_connect.cpp]
-[import ../test/test_branching.cpp]
-[import ../test/test_pull.cpp]
-[import ../test/test_disconnect.cpp]
-[import ../test/test_multi_type.cpp]
-[import ../test/test_multi_args.cpp]
-[import ../test/test_same_type.cpp]
-[import ../test/test_multi_out.cpp]
-
-[import ../test/test_filter.cpp]
-[import ../test/test_storage.cpp]
-[import ../test/test_counter.cpp]
-[import ../test/test_function.cpp]
-[import ../test/test_chain.cpp]
-[import ../test/test_socket.cpp]
[import ../example/fibonacci.cpp]
[import ../example/simple_example.cpp]
Added: sandbox/SOC/2007/signals/libs/dataflow/doc/producer_concepts.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/producer_concepts.qbk 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -0,0 +1,226 @@
+[section ProducerCategory]
+
+A ['[ProducerCategoryConcept]] specifies the traits of a [ProducerConcept].
+
+[heading Notation]
+[variablelist
+ [[PC] [A ProducerCategory type.]]
+ [[P] [A [ProducerConcept] type of producer category `PC`.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Semantics]]
+ [
+ [Connections Stored]
+ [`PC::connections_stored`]
+ [connections::none, connections::one, connections::many]
+ [The number of outgoing connections that `P` can store.]
+ ]
+ [
+ [Producer Concept]
+ [`PC::producer_concept`]
+ [concepts::producer, concepts::single_type_producer,
+ concepts::keyed_producer]
+ [The most refined producer concept that `P` satisfies.]
+ ]
+]
+
+[heading Notes]
+All these traits are in regards to the mechanism for which the `P` has
+producer category `PC`.
+
+[heading Examples]
+
+
+[endsect][/producercategory]
+
+
+[section Producer]
+
+A type `P` is a ['[ProducerConcept]] for a mechanism `M` if it specifies
+a producer category for that mechanism.
+To be useful, a [ProducerConcept] should likely be
+[ConnectableConcept] to at least one [ConsumerConcept]. Also, at least
+one component of a connected network should be [InvocableConcept].
+
+[heading Refinements]
+* [SingleTypeProducer]
+* [PhoenixProducerConcept]
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[P] [A Producer type.]]
+ [[M] [A Mechanism type.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Semantics]]
+ [
+ [Producer Category]
+ [`producer_category_of<M, P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ The category of the producer, used for tag forwarding.
+ ]
+ ]
+ [
+ [Producer Trait]
+ [`is_producer<M, P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [mpl::true_ or boost::true_type]
+ [
+ A trait encapsulating adherence to the Producer
+ concept.
+ ]
+ ]
+]
+
+[heading Notes]
+
+To specify that a type `P` is a [ProducerConcept] for a mechanism `M`,
+it suffices to provide a specification for `producer_category_of`.
+If the type is a class type which you can modify, you can achieve this by
+providing a `T::dataflow<M>::producer_category` typedef specifying the
+category. The Dataflow library provides a convenience class
+`producer` which you can inherit for this purpose.
+
+[heading Examples]
+
+[endsect][/producer]
+
+[section SingleTypeProducer]
+
+A type `P` is a ['[ProducerConcept]] if it defines a producer category,
+a produced type, and specifies whether it is invocable.
+To be useful, a [ProducerConcept] should likely be
+[ConnectableConcept] to at least one [ConsumerConcept]. Also, at least
+one component of a connected network should be [InvocableConcept].
+
+[heading Refinements]
+* [SingleTypeProducer]
+* [PhoenixProducerConcept]
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[P] [A Producer type.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Semantics]]
+ [
+ [Producer Category]
+ [`producer_category_of<P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ The category of the producer, used for tag forwarding.
+ ]
+ ]
+ [
+ [Produced Type]
+ [`produced_type_of<P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ The type of data produced by the producer.
+ [footnote This might
+ mean different things for different producer categories - for
+ example, a SignalProducer uses function types, whereas
+ a PhoenixProducer uses object types.].
+ ]
+ ]
+ [
+ [Producer Trait]
+ [`is_producer<P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [mpl::true_ or boost::true_type]
+ [
+ *Semantics:* A trait encapsulating adherence to the Producer
+ concept.
+ ]
+ ]
+ [
+ [Invocable]
+ [`is_invocable<P>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Boolean metafunction]
+ [
+ *Semantics:* A producer must specify if it is [InvocableConcept].
+ ]
+ ]
+]
+
+[heading Notes]
+
+To define a new [ProducerConcept] class type, it is sufficient to define
+member typedefs `producer_category` and `produced_type`.
+
+[heading Examples]
+
+[endsect][/singletypeproducer]
+
+[section ProxyProducer]
+
+A type `PP` is a ['[ProxyProducerConcept]] if specifies the proxied producer
+type, and if objects of the proxied type can be retreived from objects of
+[ProxyProducerConcept] type. If the proxied producer type is a valid
+[ProducerConcept], then 'PP' satisfies the [ProducerConcept] requirements
+in the same way.
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[PP] [A ProxyProducer type.]]
+ [[pp] [An object of type `PP`]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Semantics]]
+ [
+ [Proxy Producer Category]
+ [`proxy_producer_category_of<PP>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ The category of the proxy producer, used for tag forwarding.
+ ]
+ ]
+ [
+ [Proxied Producer Type]
+ [`proxied_producer_of<PP>::type`
+ [footnote `namespace boost::dataflow`]]
+ [Any type]
+ [
+ The proxied producer type.
+ ]
+ ]
+ [
+ [Proxied Producer]
+ [`get_proxied_producer(pp)`
+ [footnote `namespace boost::dataflow`]]
+ []
+ [
+ Retrieves a reference to the proxied producer object.
+ ]
+ ]
+]
+
+[heading Notes]
+
+To define a new [ProxyProducerConcept] class type, it is sufficient to define
+member typedefs `proxy_producer_category` and `proxy_producer_for`,
+and member function `get_proxied_producer`.
+
+[heading Examples]
+
+[endsect][/proxyproducer]
\ No newline at end of file
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-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -146,7 +146,6 @@
receives a signal, it will increment an internal
counter and forward the signal.
-[import ../test/test_counter.cpp]
[table counter class use example
[[fused][unfused]]
[[[test_counter_fused]][[test_counter_unfused]]]
@@ -170,7 +169,6 @@
The [junction] class can be used to bring in multiple signals, and forward
them all to the same set of output signals.
-[import ../test/test_junction.cpp]
[table storage class use example
[[fused][unfused]]
[[[test_junction_fused]][[test_junction_unfused]]]
@@ -191,7 +189,6 @@
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.
-[import ../test/test_mutex.cpp]
[table mutex class use example
[[fused][unfused]]
[[[test_mutex_fused]][[test_mutex_unfused]]]
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/Jamfile.v2 (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/Jamfile.v2 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -5,7 +5,7 @@
build-project VTK ;
-project dataflow/test
+project dataflow/example
: requirements
<include>../../..
<library>/boost/signals//boost_signals/<link>static
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -33,8 +33,8 @@
int main()
{
- using boost::dataflow::connect;
- using namespace boost::dataflow::operators;
+ //using boost::dataflow::connect;
+ //using namespace boost::dataflow::operators;
//
// Next we create an instance of vtkConeSource and set some of its
@@ -90,7 +90,11 @@
//connect (*ren1, *renWin);
renWin->SetSize( 300, 300 );
- *cone >>= *coneMapper >>= *coneActor >>= *ren1 >>= *renWin;
+ connect(*cone, *coneMapper);
+ connect(*coneMapper, *coneActor);
+ connect(*coneActor, *ren1);
+ connect(*ren1, *renWin);
+ //*cone >>= *coneMapper >>= *coneActor >>= *ren1 >>= *renWin;
//
// Now we loop over 360 degreeees and render the cone each time.
Modified: sandbox/SOC/2007/signals/libs/dataflow/example/example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/example.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -7,18 +7,7 @@
using namespace boost;
-struct dummy_producer_tag;
-struct dummy_consumer_tag;
-
-struct test
-{
- typedef dummy_producer_tag producer_category;
- typedef dummy_consumer_tag consumer_category;
-};
int main()
{
- test t1, t2;
-
- //boost::dataflow::connect(t1, t2);
}
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,39 +0,0 @@
-# Copyright 2007 Stjepan Rajko.
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-
-import testing ;
-
-project
- : requirements
- <include>../../..
- <library>/boost/signals//boost_signals/<link>static
- <library>/boost/system//boost_system/<link>static
- <define>BOOST_ALL_NO_LIB=1
- ;
-
-run test_result_of_defined.cpp ;
-
-run test_bind_object.cpp ;
-run test_connect.cpp ;
-
-run test_filter.cpp ;
-run test_storage.cpp ;
-run test_counter.cpp ;
-run test_junction.cpp ;
-run test_function.cpp ;
-run test_chain.cpp ;
-run test_mutex.cpp
- /boost/thread//boost_thread/<link>static ;
-run test_socket.cpp
- /boost/serialization//boost_serialization/<link>static
- /boost/thread//boost_thread/<link>static ;
-run test_branching.cpp ;
-run test_pull.cpp ;
-run test_disconnect.cpp ;
-run test_multi_type.cpp ;
-run test_multi_args.cpp ;
-run test_same_type.cpp ;
-run test_multi_out.cpp ;
-
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/Jamfile.v2 (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2 (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/Jamfile.v2 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -5,16 +5,14 @@
import testing ;
-project
+project dataflow/test/signals
: requirements
- <include>../../..
+ <include>../../../..
<library>/boost/signals//boost_signals/<link>static
<library>/boost/system//boost_system/<link>static
<define>BOOST_ALL_NO_LIB=1
;
-run test_result_of_defined.cpp ;
-
run test_bind_object.cpp ;
run test_connect.cpp ;
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_branching.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -10,7 +10,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_chain.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -14,7 +14,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_chain_classes
class UnfusedDoublerClass : public signals::filter<void (float), signals::unfused>
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_connect.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -9,10 +9,11 @@
//[ test_connect
-struct receiver
+struct receiver : public boost::dataflow::consumer<
+ boost::dataflow::signals_mechanism,
+ boost::dataflow::signal_consumer>
{
typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
receiver() : stored(0) {}
@@ -30,7 +31,7 @@
boost::signal<void(int)> p;
receiver r;
- boost::dataflow::connect(p, r);
+ boost::dataflow::connect<boost::dataflow::signals_mechanism>(p, r);
p(3);
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp (from r39333, /sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_disconnect.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -10,7 +10,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_filter.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -12,7 +12,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_filter_classes
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_function.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -10,7 +10,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_junction.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -11,7 +11,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_args.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -11,7 +11,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_multi_args_class1
@@ -26,13 +25,13 @@
//[ test_multi_args_class2
-class SignalMultiCollector
+class SignalMultiCollector : public boost::dataflow::consumer<
+ boost::dataflow::signals_mechanism, boost::dataflow::signal_consumer>
{
optional<float> last, last1, last2;
int cnt;
public:
typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
SignalMultiCollector() : cnt(0) {}
void operator()()
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_out.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -9,7 +9,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_multi_out_classes
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_multi_type.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -11,17 +11,16 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_multi_type_classes
-class SignalIntFloatCollector
+class SignalIntFloatCollector : public boost::dataflow::consumer<
+ boost::dataflow::signals_mechanism, boost::dataflow::signal_consumer>
{
optional<int> last_int;
optional<float> last_float;
public:
typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
void operator()(int x)
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_mutex.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -11,7 +11,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_pull.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -9,7 +9,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_pull_classes
class PullDoubler : public signals::filter<float (), signals::unfused>
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_same_type.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -10,7 +10,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
//[ test_same_type_classes
@@ -20,12 +19,12 @@
signals::counter<void (), signals::unfused> other;
}; // end class Signal2VoidCounter
-class Signal2VoidInputs
+class Signal2VoidInputs : public boost::dataflow::consumer<
+ boost::dataflow::signals_mechanism, boost::dataflow::signal_consumer>
{
int result;
public:
typedef void result_type;
- typedef dataflow::signal_consumer consumer_category;
Signal2VoidInputs() : result(0) {};
void operator()()
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_socket.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -19,10 +19,6 @@
//[ test_socket
using namespace boost;
-namespace boost { namespace signals {
- using boost::dataflow::operators::operator|;
- using boost::dataflow::operators::operator>>=;
-} }
mutex mutex_;
condition cond;
Copied: sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp (from r39106, /sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp)
==============================================================================
--- /sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/signals/test_storage.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
@@ -9,7 +9,6 @@
#include <boost/test/included/test_exec_monitor.hpp>
using namespace boost;
-using namespace boost::dataflow::operators;
int test_main(int, char* [])
{
@@ -19,13 +18,6 @@
signals::storage<void (), signals::unfused> banger;
signals::storage<void (float), signals::unfused> floater(2.5f);
signals::storage<void (float), signals::unfused> collector(0.0f);
-
- typedef dataflow::proxied_producer_of<typeof(floater.send_slot())> test;
- typedef dataflow::is_proxy_producer<typeof(floater.send_slot())> test2;
- typedef dataflow::is_producer<typeof(floater.send_slot())> test3;
-
- BOOST_STATIC_ASSERT(test2::value);
- BOOST_STATIC_ASSERT(test3::value);
// create the network (banger to floater.send, floater to collector)
banger >>= floater.send_slot() >>= collector;
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_bind_object.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_bind_object.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,35 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/connection/detail/bind_object.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-struct adder
-{
- adder(int z) : z(z) {}
- adder() : z(0) {}
-
- int add(int x, float y)
- {
- return x + y + z;
- }
-
- int z;
-};
-
-int test_main(int, char* [])
-{
- adder a(10);
-
- boost::function<int(int, float)> f;
-
- f = boost::signals::detail::bind_object<int(int, float), adder>()(&adder::add, a);
-
- BOOST_CHECK_EQUAL(f(4, 2.1), 16);
-
- return 0;
-}
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_branching.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,53 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ 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);
-
- banger
- // floater connects to collector, banger to floater.send_slot()
- | (floater.send_slot() >>= collector)
- | counter; // and banger to counter
-
- banger();
- BOOST_CHECK_EQUAL(counter.count(), 1);
- BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
- //]
- }
- {
- //[ test_branching_fused
- signals::storage<void (), signals::fused> banger;
- signals::counter<void (), signals::fused> counter;
- signals::storage<void (float), signals::fused> floater(2.5f);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- banger
- // floater connects to collector, banger to floater.send_slot()
- | (floater.send_slot() >>= collector)
- | counter; // and banger to counter
-
- banger();
- BOOST_CHECK_EQUAL(counter.count(), 1);
- BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_chain.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,68 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/chain.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/fusion/algorithm/iteration/for_each.hpp>
-#include <boost/fusion/algorithm/transformation/transform.hpp>
-#include <boost/fusion/sequence/generation/make_vector.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_chain_classes
-class UnfusedDoublerClass : public signals::filter<void (float), signals::unfused>
-{
-public:
- typedef void result_type;
- void operator()(float x) {out(2*x);}
-};
-
-class FusedDoublerClass : public signals::filter<void (float), signals::fused>
-{
-public:
- typedef void result_type;
- void operator()(const fusion::vector<float> &x)
- {
- // this could be more general but I'm having problems with the general approach...
- fusion::vector<float> y;
- boost::fusion::at_c<0>(y) = 2 * boost::fusion::at_c<0>(x);
- fused_out(y);
- }
-};
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_chain_unfused
- signals::chain<void(float), UnfusedDoublerClass> doubling_chain(4, NULL);
- signals::storage<void (float)> floater(1.0f);
- signals::storage<void (float)> collector(0.0f);
-
- floater >>= doubling_chain >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 16.0f);
- //]
- }
- {
- //[ test_chain_fused
- signals::chain<void(float), FusedDoublerClass> doubling_chain(4, NULL);
- signals::storage<void (float), signals::fused> floater(1.0f);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- floater >>= doubling_chain >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 16.0f);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_connect.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,42 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/support.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-//[ test_connect
-
-struct receiver
-{
- typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
-
- receiver() : stored(0) {}
-
- void operator()(int x)
- {
- stored = x;
- }
-
- int stored;
-};
-
-int test_main(int, char* [])
-{
-
- boost::signal<void(int)> p;
- receiver r;
-
- boost::dataflow::connect(p, r);
-
- p(3);
-
- BOOST_CHECK_EQUAL(r.stored, 3);
-
- return 0;
-}
-
-//]
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_connections.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_connections.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,124 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#define _CRT_SECURE_NO_DEPRECATE 1
-#include <boost/fusion/sequence/generation/make_vector.hpp>
-
-
-#include <boost/test/unit_test.hpp>
-using boost::unit_test::test_suite;
-
-#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>
-
-#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>
-#undef _WIN32_WINDOWS
-
-// for access to connection operators >>= and |
-using namespace boost::signal_network;
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-class SignalFloatDoubler : public signals::filter<void (float, float)>
-{
-public:
- void operator()(float val) {out(val, val*2);}
-};
-
-
-class SignalFloat2Collector
-{
- optional<float> last1, last2;
-public:
- void operator()(float val1, float val2)
- {
- last1 = val1;
- last2 = val2;
- }
- optional<float> GetLast1()
- {
- return last1;
- }
- optional<float> GetLast2()
- {
- return last2;
- }
-};
-
-class SignalMultiInheritedCollector : public signals::storage<void (float), signals::unfused>, public SignalVoidCounter, public SignalFloat2Collector
-{
-public:
- SignalMultiInheritedCollector() : signals::storage<void (float), signals::unfused>(0) {}
-};
-
-void multi_num_args_inherited_test()
-{
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater;
- floater(2.5f);
- SignalFloatDuplicator duplicator;
- SignalMultiInheritedCollector collector;
-
- banger
- | (SignalVoidCounter &) collector
- |
- (floater
- | (signals::storage<void (float), signals::unfused> &) collector
- | (duplicator >>= (SignalFloat2Collector &) collector));
-
- banger();
- BOOST_CHECK(collector.GetCount() == 1);
- BOOST_CHECK(collector.value_<0>() == 2.5f); // calls the collector<float>'s operator()
- BOOST_CHECK(collector.GetLast1() == optional<float>(2.5f));
- BOOST_CHECK(collector.GetLast2() == optional<float>(2.5f));
-} // end void multi_num_args_inherited_test()
-
-
-
-
-void selector_test()
-{
-/* signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater1, floater2;
- floater1(1.0f);
- floater2(2.0f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
- signals::selector<2, void (float)> selector;
-
- banger >>= floater1 >>= selector.slot1();
- banger >>= floater2 >>= selector.slot2();
- selector >>= collector;
-
- selector.select(0);
- banger();
- BOOST_CHECK(collector.value_<0>() == 0.0f);
-
- selector.select(1);
- banger();
- BOOST_CHECK(collector.value_<0>() == 1.0f);
-
- selector.select(2);
- banger();
- BOOST_CHECK(collector.value_<0>() == 2.0f);*/
-} // end void selector_test()
-
-
-
-
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_counter.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_counter.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,34 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/counter.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-
-int test_main(int, char* [])
-{
- {
- //[ test_counter_unfused
- signals::counter<void (), signals::unfused> counter;
-
- for (int i=0; i<33; i++)
- counter();
- BOOST_CHECK_EQUAL(counter.count(), 33);
- //]
- }
- {
- //[ test_counter_fused
- signals::counter<void (), signals::fused> counter;
-
- for (int i=0; i<33; i++)
- counter(boost::fusion::vector<>());
- BOOST_CHECK_EQUAL(counter.count(), 33);
- //]
- }
-
- return 0;
-} // int test_main(int, char* [])
\ No newline at end of file
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_disconnect.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,54 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ test_disconnect_unfused
- signals::storage<void (), signals::unfused> banger;
- {
- signals::counter<void (), signals::unfused> counter;
- signals::storage<void (float), signals::unfused> floater;
- floater(2.5f);
- signals::storage<void (float), signals::unfused> collector(0.0f);
-
- banger
- | counter
- | (floater >>= collector).send_slot();
-
- banger();
- BOOST_CHECK_EQUAL(counter.count(), 1);
- BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
- } // counter, floater, and collector are now destroyed and disconnected with Boost.Signals
-#ifdef SIGNAL_NETWORK_THREAD_SAFE
- // if [DataflowSignals] has detected thread safe signals, we need to
- // touch the signal to disconnect things that are destroyed:
- // unfortunatelly, this call hangs on MSVC!
- // banger();
-#endif
- BOOST_CHECK_EQUAL(banger.get_proxied_producer().num_slots(), 0u);
-
- signals::counter<void (), signals::unfused> counter;
-
- banger >>= counter;
- banger.disconnect_all_slots();
-
- banger();
- BOOST_CHECK_EQUAL(counter.count(), 0);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
-
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_filter.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,88 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/filter.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/fusion/sequence/intrinsic/at.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_filter_classes
-
-class DoublerClass : public signals::filter<void (float), signals::unfused>
-{
-public:
- template<typename FArgs>
- struct result;
-
- template<typename F>
- struct result<F(float)>
- {
- typedef void type;
- };
-
- void operator()(float x) {out(2*x);}
-};
-
-class FusedDoublerClass : public signals::filter<void (float), signals::fused>
-{
-public:
- template<typename FArgs>
- struct result;
-
- template<typename F>
- struct result<F(const fusion::vector<float> &)>
- {
- typedef void type;
- };
-
- void operator()(const fusion::vector<float> &x)
- {
- // this could be more general but I'm having problems with the general approach...
- fusion::vector<float> y;
- fusion::at_c<0>(y) = 2 * fusion::at_c<0>(x);
- fused_out(y);
- }
-};
-
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_filter_unfused
-
- DoublerClass doubler1, doubler2;
- signals::storage<void (float)> floater(1.0f);
- signals::storage<void (float)> collector(0.0f);
-
- floater >>= doubler1 >>= doubler2 >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 4.0f);
-
- //]
- }
- {
- //[ test_filter_fused
-
- FusedDoublerClass doubler1, doubler2;
- signals::storage<void (float), signals::fused> floater(1.0f);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- floater >>= doubler1 >>= doubler2 >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 4.0f);
-
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_function.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,48 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/function.hpp>
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ test_function_unfused
- signals::function<void (float), float(float), signals::unfused>
- double_fun1(boost::bind(std::multiplies<float>(), _1, 2.0f));
- signals::function<void (float), float(float), signals::unfused>
- 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);
-
- floater >>= double_fun1 >>= double_fun2 >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 4.0f);
- //]
- }
- {
- //[ test_function_fused
- signals::function<void (float), float(float), signals::fused>
- double_fun1(boost::bind(std::multiplies<float>(), _1, 2.0f));
- signals::function<void (float), float(float), signals::fused>
- double_fun2(boost::bind(std::multiplies<float>(), _1, 2.0f));
- signals::storage<void (float), signals::fused> floater(1.0f);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- floater >>= double_fun1 >>= double_fun2 >>= collector;
- floater.send();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 4.0f);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_junction.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,79 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#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/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ test_junction_unfused
- signals::storage<void (), signals::unfused> banger1, banger2;
- signals::counter<void (), signals::unfused> counter1, counter2;
- signals::junction<void (), signals::unfused> junction;
-
- banger1 >>= junction >>= counter1;
- banger2 >>= junction >>= counter2;
-
- banger1.send();
- banger2.send();
-
- BOOST_CHECK_EQUAL(counter1.count(), 2);
- BOOST_CHECK_EQUAL(counter2.count(), 2);
-
- junction.disable();
- banger1.send();
- banger2.send();
-
- BOOST_CHECK_EQUAL(counter1.count(), 2);
- BOOST_CHECK_EQUAL(counter2.count(), 2);
-
- junction.enable();
- banger1.send();
- banger2.send();
-
- BOOST_CHECK_EQUAL(counter1.count(), 4);
- BOOST_CHECK_EQUAL(counter2.count(), 4);
- //]
- }
- {
- //[ test_junction_fused
- signals::storage<void (), signals::fused> banger1, banger2;
- signals::counter<void (), signals::fused> counter1, counter2;
- signals::junction<void (), signals::fused> junction;
-
- banger1 >>= junction >>= counter1;
- banger2 >>= junction >>= counter2;
-
- banger1();
- banger2();
-
- BOOST_CHECK_EQUAL(counter1.count(), 2);
- BOOST_CHECK_EQUAL(counter2.count(), 2);
-
- junction.disable();
- banger1();
- banger2();
-
- BOOST_CHECK_EQUAL(counter1.count(), 2);
- BOOST_CHECK_EQUAL(counter2.count(), 2);
-
- junction.enable();
- banger1();
- banger2();
-
- BOOST_CHECK_EQUAL(counter1.count(), 4);
- BOOST_CHECK_EQUAL(counter2.count(), 4);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
\ No newline at end of file
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_args.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,96 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/optional.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_multi_args_class1
-
-class SignalFloatDuplicator : public signals::filter<void (float, float), signals::unfused>
-{
-public:
- typedef void result_type;
- void operator()(float val) {out(val, val);}
-};
-
-//]
-
-//[ test_multi_args_class2
-
-class SignalMultiCollector
-{
- optional<float> last, last1, last2;
- int cnt;
-public:
- typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
-
- SignalMultiCollector() : cnt(0) {}
- void operator()()
- {
- cnt++;
- }
- int GetCount()
- {
- return cnt;
- }
- void operator()(float val1, float val2)
- {
- last1 = val1;
- last2 = val2;
- }
- optional<float> GetLast1()
- {
- return last1;
- }
- optional<float> GetLast2()
- {
- return last2;
- }
- void operator()(float x)
- {
- last = x;
- }
- optional<float> GetLast()
- {
- return last;
- }
-}; // end class SignalMultiCollector
-
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_multi_args_unfused
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (float), signals::unfused> floater;
- floater(2.5f);
- SignalFloatDuplicator duplicator;
- SignalMultiCollector collector;
-
- banger
- | collector
- |
- (floater
- | collector
- | (duplicator >>= collector)).send_slot();
-
- banger();
- BOOST_CHECK_EQUAL(collector.GetCount(), 1);
- BOOST_CHECK_EQUAL(collector.GetLast(), optional<float>(2.5f));
- BOOST_CHECK_EQUAL(collector.GetLast1(), optional<float>(2.5f));
- BOOST_CHECK_EQUAL(collector.GetLast2(), optional<float>(2.5f));
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_out.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,53 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_multi_out_classes
-
-class SignalOutIntFloat : public signals::filter<void (float), signals::unfused>
-{
-public:
- SignalOutIntFloat(float x) : x(x) {}
- void operator()()
- {
- out(x);
- out_int((int)x);
- }
- boost::signal<void (int)> out_int;
-private:
- float x;
-}; // end class SignalOutIntFloat
-
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ 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);
-
- multi_out >>= float_collector;
- multi_out.out_int >>= int_collector;
- multi_out();
-
- BOOST_CHECK_EQUAL(float_collector.at<0>(), 2.5f);
- BOOST_CHECK_EQUAL(int_collector.at<0>(), 2);
-
- //]
- }
-return 0;
-} // int test_main(int, char* [])
-
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_multi_type.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,67 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/optional.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_multi_type_classes
-
-class SignalIntFloatCollector
-{
- optional<int> last_int;
- optional<float> last_float;
-public:
- typedef void result_type;
- typedef boost::dataflow::signal_consumer consumer_category;
-
- void operator()(int x)
- {
- last_int = x;
- }
- void operator()(float x)
- {
- last_float = x;
- }
- optional<int> GetLastInt()
- {
- return last_int;
- }
- optional<float> GetLastFloat()
- {
- return last_float;
- }
-}; // end class SignalIntFloatCollector
-
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_multi_type_unfused
- signals::storage<void (), signals::unfused> banger;
- signals::storage<void (int), signals::unfused> inter;
- inter(2);
- signals::storage<void (float), signals::unfused> floater;
- floater(3.3f);
- SignalIntFloatCollector collector;
-
- banger
- | (inter >>= collector).send_slot()
- | (floater >>= collector).send_slot();
-
- banger();
- BOOST_CHECK_EQUAL(collector.GetLastInt(), optional<int>(2));
- BOOST_CHECK_EQUAL(collector.GetLastFloat(), optional<float>(3.3f));
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_mutex.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,57 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#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/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ test_mutex_unfused
- signals::timed_generator<void (), signals::unfused> banger1;
- signals::timed_generator<void (), signals::unfused> banger2;
- signals::mutex<void (), signals::unfused> lock;
- signals::counter<void (), signals::unfused> counter;
-
- banger1 >>= lock >>= counter;
- banger2 >>= lock;
- banger1.enable(0.5, 5);
- banger2.enable(0.5, 5);
-
- while (counter.count() < 10) {}
-
- BOOST_CHECK_EQUAL(counter.count(), 10);
- banger1.join();
- banger2.join();
- //]
- }
- {
- //[ test_mutex_fused
- signals::timed_generator<void (), signals::fused> banger1;
- signals::timed_generator<void (), signals::fused> banger2;
- signals::mutex<void (), signals::fused> lock;
- signals::counter<void (), signals::fused> counter;
-
- banger1 >>= lock >>= counter;
- banger2 >>= lock;
- banger1.enable(0.5, 5);
- banger2.enable(0.5, 5);
-
- while (counter.count() < 10) {}
-
- BOOST_CHECK_EQUAL(counter.count(), 10);
- banger1.join();
- banger2.join();
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_pull.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,41 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_pull_classes
-class PullDoubler : public signals::filter<float (), signals::unfused>
-{
-public:
- float operator()()
- {
- return 2*out();
- }
-};
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_pull_unfused
-
- signals::storage<void(float), signals::unfused> generator(1.0f);
- PullDoubler doubler;
-
- doubler >>= generator.value_at_slot<0>();
-
- BOOST_CHECK(doubler() == 2.0f);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
-
-
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_same_type.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,73 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/component/counter.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-//[ test_same_type_classes
-
-class Signal2VoidCounter : public signals::counter<void (), signals::unfused>
-{
-public:
- signals::counter<void (), signals::unfused> other;
-}; // end class Signal2VoidCounter
-
-class Signal2VoidInputs
-{
- int result;
-public:
- typedef void result_type;
- typedef dataflow::signal_consumer consumer_category;
-
- Signal2VoidInputs() : result(0) {};
- void operator()()
- {
- result++;
- }
- void AltInput()
- {
- result+=10;
- }
- int GetResult()
- {
- return result;
- }
-}; // end class Signal2VoidInputs
-
-//]
-
-int test_main(int, char* [])
-{
- {
- //[ test_same_type_unfused
- signals::storage<void (), signals::unfused> banger;
- Signal2VoidCounter counter;
-
- banger
- | counter
- | counter.other;
-
- banger();
- BOOST_CHECK_EQUAL(counter.count(), 1);
- BOOST_CHECK_EQUAL(counter.other.count(), 1);
-
- Signal2VoidInputs inputs;
-
- banger
- | inputs
- | signals::make_slot_selector<void ()> (&Signal2VoidInputs::AltInput, inputs);
-
- banger();
- BOOST_CHECK_EQUAL(inputs.GetResult(), 11);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_socket.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,86 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#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/connection.hpp>
-
-#include <boost/thread/thread.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-//[ test_socket
-
-using namespace boost;
-namespace boost { namespace signals {
- using boost::dataflow::operators::operator|;
- using boost::dataflow::operators::operator>>=;
-} }
-
-mutex mutex_;
-condition cond;
-asio::io_service io_service;
-
-// This function will set up an asio acceptor, and wait for a connection.
-// Once established, it will set up a signal network which will send
-// its final signal through the socket.
-void asio_server()
-{
- // set up the socket
- asio::ip::tcp::acceptor acceptor(io_service, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), 1097));
- asio::ip::tcp::socket socket(io_service);
- {
- boost::mutex::scoped_lock lock(mutex_);
- acceptor.listen();
- cond.notify_all();
- }
- 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::socket_sender<void (float)> sender(socket);
-
- // create the network
- generator >>= add2 >>= sender;
-
- // cause the generator to send it's stored value
- generator.send();
-}
-
-int test_main(int, char* [])
-{
- // start the server in a separate thread
- boost::mutex::scoped_lock lock(mutex_);
- boost::thread t(asio_server);
- cond.wait(lock);
-
- // set up the socket
- asio::ip::tcp::endpoint endpoint_recv(asio::ip::address::from_string("127.0.0.1"), 1097);
- asio::ip::tcp::socket socket(io_service);
- socket.connect(endpoint_recv);
-
- // instatiate the components
- signals::socket_receiver<void (float), signals::fused> receiver(socket);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- // set up the network
- receiver >>= collector;
-
- // this receiver is synchronous - we have to tell it to receive a signal
- receiver();
-
- BOOST_CHECK_EQUAL(collector.at<0>(), 3.0f);
-
- t.join();
-
- return 0;
-} // int test_main(int, char* [])
-//]
Deleted: sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_storage.cpp 2007-09-23 14:07:37 EDT (Sun, 23 Sep 2007)
+++ (empty file)
@@ -1,65 +0,0 @@
-// Copyright Stjepan Rajko 2007. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/dataflow/signal/component/storage.hpp>
-#include <boost/dataflow/signal/connection.hpp>
-
-#include <boost/test/included/test_exec_monitor.hpp>
-
-using namespace boost;
-using namespace boost::dataflow::operators;
-
-int test_main(int, char* [])
-{
- {
- //[ 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);
-
- typedef dataflow::proxied_producer_of<typeof(floater.send_slot())> test;
- typedef dataflow::is_proxy_producer<typeof(floater.send_slot())> test2;
- typedef dataflow::is_producer<typeof(floater.send_slot())> test3;
-
- BOOST_STATIC_ASSERT(test2::value);
- BOOST_STATIC_ASSERT(test3::value);
-
- // create the network (banger to floater.send, floater to collector)
- banger >>= floater.send_slot() >>= collector;
-
- // signal from banger causes floater to output 2.5
- banger();
- BOOST_CHECK_EQUAL(floater.at<0>(), 2.5f);
- BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
-
- floater(1.5f); // change the value in floater
- boost::dataflow::invoke(floater); // we can also signal floater directly
- BOOST_CHECK_EQUAL(collector.at<0>(), 1.5f);
- //]
- }
-
- {
- //[ test_storage_fused
- // instantiate all of the components we need
- signals::storage<void (), signals::fused> banger;
- signals::storage<void (float), signals::fused> floater(2.5f);
- signals::storage<void (float), signals::fused> collector(0.0f);
-
- // create the network (banger to floater.send, floater to collector)
- banger >>= floater.send_slot() >>= collector;
-
- // signal from banger causes floater to output 2.5
- banger();
- BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f);
-
- // change the value in floater
- floater(1.5f);
- floater.send(); // we can also signal floater directly
- BOOST_CHECK_EQUAL(collector.at<0>(), 1.5f);
- //]
- }
- return 0;
-} // int test_main(int, char* [])
\ No newline at end of file
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