Boost logo

Boost-Commit :

From: stipe_at_[hidden]
Date: 2007-10-15 12:40:21


Author: srajko
Date: 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
New Revision: 40057
URL: http://svn.boost.org/trac/boost/changeset/40057

Log:
start move to port-based concepts
Added:
   sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp
      - copied, changed from r39908, /sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp
   sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp
      - copied, changed from r39908, /sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp
   sandbox/SOC/2007/signals/boost/dataflow/utility/
   sandbox/SOC/2007/signals/boost/dataflow/utility/copy_cv.hpp (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone3.cxx (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone4.cxx (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone5.cxx (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone6.cxx (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/test/test_port.cpp (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp (contents, props changed)
Removed:
   sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp
   sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp
   sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp
   sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp
Text files modified:
   sandbox/SOC/2007/signals/boost/dataflow/support.hpp | 24 ++-
   sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp | 253 +++++++++++++++++++++++++++++----------
   sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp | 250 +++++++++++++++------------------------
   sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj | 22 +++
   sandbox/SOC/2007/signals/libs/dataflow/doc/concepts.qbk | 33 +++++
   sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk | 1
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Jamfile.v2 | 10
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/operators.hpp | 12
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp | 110 ++++++++++------
   9 files changed, 434 insertions(+), 281 deletions(-)

Modified: sandbox/SOC/2007/signals/boost/dataflow/support.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support.hpp (original)
+++ sandbox/SOC/2007/signals/boost/dataflow/support.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -6,15 +6,19 @@
 #ifndef BOOST_DATAFLOW_SUPPORT_HPP
 #define BOOST_DATAFLOW_SUPPORT_HPP
 
-#include <boost/dataflow/support/producer.hpp>
-#include <boost/dataflow/support/proxy_producer.hpp>
-#include <boost/dataflow/support/consumer.hpp>
-#include <boost/dataflow/support/proxy_consumer.hpp>
-#include <boost/dataflow/support/filter.hpp>
-#include <boost/dataflow/support/invocable.hpp>
-#include <boost/dataflow/support/connectable.hpp>
-#include <boost/dataflow/support/only_connectable.hpp>
-#include <boost/dataflow/support/disconnect_all_ins.hpp>
-#include <boost/dataflow/support/disconnect_all_outs.hpp>
+#include <boost/dataflow/support/port.hpp>
+#include <boost/dataflow/support/proxy_port.hpp>
+#include <boost/dataflow/support/binary_operation.hpp>
+
+//#include <boost/dataflow/support/producer.hpp>
+//#include <boost/dataflow/support/proxy_producer.hpp>
+//#include <boost/dataflow/support/consumer.hpp>
+//#include <boost/dataflow/support/proxy_consumer.hpp>
+//#include <boost/dataflow/support/filter.hpp>
+//#include <boost/dataflow/support/invocable.hpp>
+//#include <boost/dataflow/support/connectable.hpp>
+//#include <boost/dataflow/support/only_connectable.hpp>
+//#include <boost/dataflow/support/disconnect_all_ins.hpp>
+//#include <boost/dataflow/support/disconnect_all_outs.hpp>
 
 #endif // BOOST_DATAFLOW_SUPPORT_HPP

Deleted: sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/consumer.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
+++ (empty file)
@@ -1,114 +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)
-
-#ifndef BOOST_DATAFLOW_SUPPORT_CONSUMER_HPP
-#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 {
-
-namespace concepts
-{
- struct consumer;
-}
-
-template<typename ConsumerConcept, typename OutConnectionsStored=connections::none>
-struct consumer_category
-{
- typedef ConsumerConcept consumer_concept;
- typedef OutConnectionsStored in_connections_stored;
-};
-
-template<typename ConsumerCategory, typename Enable=void>
-struct is_consumer_category : public boost::false_type
-{};
-
-template<typename ConsumerCategory>
-struct is_consumer_category<ConsumerCategory,
- typename detail::enable_if_defined<detail::all_of<
- typename ConsumerCategory::in_connections_stored,
- typename ConsumerCategory::consumer_concept
- > >::type>
- : public boost::mpl::true_
-{};
-
-/// Trait giving the consumer category of a type.
-template<typename Mechanism, typename T, typename Enable=void>
-struct consumer_category_of
-{};
-
-/// 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::template dataflow<Mechanism>::consumer_category type;
- BOOST_MPL_ASSERT(( is_consumer_category<type> ));
-};
-
-/// 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 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 {};
-
-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;
- };
-};
-
-} } // namespace boost::dataflow
-
-#define DATAFLOW_CONSUMER_CATEGORY(m,p,pc) \
-template<> \
-struct consumer_category_of<m, p> \
-{ \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_consumer_category<type> )); \
-};
-
-#define DATAFLOW_CONSUMER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
-template<typename P> \
-struct consumer_category_of<m, P, typename boost::enable_if< Cond >::type> \
-{ \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_consumer_category<type> )); \
-};
-
-#endif // BOOST_DATAFLOW_SUPPORT_CONSUMER_HPP

Copied: sandbox/SOC/2007/signals/boost/dataflow/support/port.hpp (from r39908, /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/port.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -3,121 +3,246 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
-#define BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
+#ifndef BOOST_DATAFLOW_SUPPORT_PORT_HPP
+#define BOOST_DATAFLOW_SUPPORT_PORT_HPP
 
 #include <boost/dataflow/detail/enable_if_defined.hpp>
-#include <boost/dataflow/support/common.hpp>
+//#include <boost/dataflow/support/common.hpp>
 
+#include <boost/mpl/and.hpp>
 #include <boost/mpl/assert.hpp>
-#include <boost/type_traits/integral_constant.hpp>
+#include <boost/mpl/bool.hpp>
 #include <boost/type_traits/is_same.hpp>
-
+#include <boost/type_traits/remove_cv.hpp>
 
 namespace boost { namespace dataflow {
 
+/// PortCategory types.
+namespace ports
+{
+ struct producer;
+ struct consumer;
+
+ struct producer
+ {
+ typedef consumer complement;
+ };
+
+ struct consumer
+ {
+ typedef producer complement;
+ };
+}
+
+/// Boolean metafunction determining whether a type is a PortCategory.
+template<typename T, typename Enable=void>
+struct is_port_category : public mpl::false_
+{};
+
+template<typename PortCategory>
+struct is_port_category<
+ PortCategory,
+ typename detail::enable_if_defined<
+ typename PortCategory::complement
+ >::type>
+ : public mpl::true_
+{};
+
 namespace concepts
 {
     /// Tag
     struct producer;
+ struct consumer;
 }
 
-/// Convenience class for ProducerCategory types.
-template<typename ProducerConcept, typename OutConnectionsStored=connections::none>
-struct producer_category
+/// Convenience class for PortTraits types.
+template<typename Mechanism, typename PortCategory, typename PortConcept>
+struct port_traits
 {
- typedef ProducerConcept producer_concept;
- typedef OutConnectionsStored out_connections_stored;
+ typedef Mechanism mechanism;
+ typedef PortCategory category;
+ typedef PortConcept concept;
 };
 
-/// Trait determining adherence to the ProducerCategory concept.
-template<typename ProducerCategory, typename Enable=void>
-struct is_producer_category : public boost::false_type
+/// Boolean metafunction determining whether a type is a PortTraits.
+template<typename PortTraits, typename Enable=void>
+struct is_port_traits : public mpl::false_
 {};
 
-template<typename ProducerCategory>
-struct is_producer_category<ProducerCategory,
- typename detail::enable_if_defined<detail::all_of<
- typename ProducerCategory::out_connections_stored,
- typename ProducerCategory::producer_concept
- > >::type>
- : public boost::mpl::true_
-{};
+template<typename PortTraits>
+struct is_port_traits<PortTraits,
+ typename detail::enable_if_defined<
+ detail::all_of<
+ typename PortTraits::mechanism,
+ typename PortTraits::category,
+ typename PortTraits::concept
+ >
+ >::type>
+ : public mpl::true_
+{
+ BOOST_MPL_ASSERT(( is_port_category<typename PortTraits::category> ));
+};
 
-/// Trait returning the producer category of a type.
-template<typename Mechanism, typename T, typename Enable=void>
-struct producer_category_of
+/// Metafunction returning the PortTraits of a type.
+template<typename Mechanism, typename PortCategory, typename T, typename Enable=void>
+struct port_traits_of
 {};
 
-/// Allows intrusive specification of the producer category.
-template<typename Mechanism, typename T>
-struct producer_category_of<Mechanism, T,
+/// Specialization allowing intrusive specification of the PortTraits.
+template<typename Mechanism, typename PortCategory, typename T>
+struct port_traits_of<Mechanism, PortCategory, T,
     typename detail::enable_if_defined<
- typename T::template dataflow<Mechanism>::producer_category>::type
+ typename T::template dataflow<Mechanism, PortCategory>::traits >::type
>
 {
- typedef typename T::template dataflow<Mechanism>::producer_category type;
- BOOST_MPL_ASSERT(( is_producer_category<type> ));
+ typedef typename T::template dataflow<Mechanism, PortCategory>::traits type;
+ BOOST_MPL_ASSERT(( is_port_traits<type> ));
 };
 
-/// Trait determining adherence to the Producer concept.
-template<typename Mechanism, typename T, typename Enable=void>
-struct is_producer
- : public boost::false_type {};
+/// Boolean metafunction determining whether a type is a Port.
+template<typename Mechanism, typename PortCategory, typename T, typename Enable=void>
+struct is_port
+ : public mpl::false_ {};
 
-template<typename Mechanism, typename T>
-struct is_producer<Mechanism, T,
+template<typename Mechanism, typename PortCategory, typename T>
+struct is_port<Mechanism, PortCategory, T,
         typename detail::enable_if_defined<
- typename producer_category_of<Mechanism, T>::type
+ typename port_traits_of<
+ Mechanism,
+ PortCategory,
+ typename remove_cv<T>::type
+ >::type
>::type >
- : public boost::true_type {};
+ : public mpl::true_ {};
 
-/// Convenience class for Producer types for a specific Mechanism.
-template<typename Mechanism, typename ProducerTag>
-struct producer
+/// Convenience base class for Port types.
+template<typename PortTraits>
+struct port
 {
- template<typename M, typename Enable=void>
- struct dataflow
- {
- };
+ template<typename Mechanism, typename PortCategory, typename Enable=void>
+ struct dataflow;
     
- template<typename M>
- struct dataflow<M, typename boost::enable_if<is_same<M, Mechanism> >::type>
+ template<typename Mechanism, typename PortCategory>
+ struct dataflow<
+ Mechanism,
+ PortCategory,
+ typename boost::enable_if<
+ mpl::and_<
+ is_same<Mechanism, typename PortTraits::mechanism>,
+ is_same<PortCategory, typename PortTraits::category>
+ >
+ >::type>
     {
- typedef ProducerTag producer_category;
+ typedef PortTraits traits;
     };
 };
 
+// trait determining whether a type is a port proxy.
+template<typename Mechanism, typename PortCategory, typename T, typename Enable=void>
+struct is_proxy_port
+ : public mpl::false_ {};
+
+namespace extension
+{
+ template<typename Traits>
+ struct get_port_impl
+ {
+ template<typename T>
+ struct apply
+ {
+ typedef T & type;
+
+ static type call(T &p)
+ {
+ BOOST_MPL_ASSERT(( is_port<typename Traits::mechanism, typename Traits::category, T> ));
+ return p;
+ }
+ };
+ };
+}
+
+template<typename Mechanism, typename PortCategory, typename T, typename Enable=void>
+struct get_port_result_type;
+/*{
+ typedef T & type;
+};*/
+
+template<typename Mechanism, typename PortCategory, typename T>
+struct get_port_result_type<
+ Mechanism,
+ PortCategory,
+ T,
+ typename disable_if<is_proxy_port<Mechanism, PortCategory, T> >::type>
+{
+ typedef
+ typename
+ extension::get_port_impl<
+ typename port_traits_of<
+ Mechanism,
+ PortCategory,
+ typename remove_cv<T>::type
+ >::type
+ >::template apply<T>::type type;
+};
+
+template<typename Mechanism, typename PortCategory, typename T>
+typename disable_if<
+ is_proxy_port<Mechanism, PortCategory, T>,
+ typename get_port_result_type<Mechanism, PortCategory, T>::type
+>::type
+get_port(T &p)
+{
+ return extension::get_port_impl<
+ typename port_traits_of<Mechanism, PortCategory, T>::type
+ >::template apply<T>::call(p);
+}
+
 /// Convenience class for Producer types for all Mechanisms.
-template<typename ProducerTag>
-struct producer<all_mechanisms, ProducerTag>
+/*template<typename PortCategory, typename PortTag>
+struct port<all_mechanisms, PortCategory, PortTag>
 {
     template<typename M>
     struct dataflow
     {
- typedef ProducerTag producer_category;
+ template<typename P, typename Enable=void>
+ struct port
+ {
+ };
+
+ template<typename P>
+ struct port<P, typename boost::enable_if<is_same<P, PortCategory> >::type>
+ {
+ typedef PortTag category;
+ };
     };
-};
+};*/
 
 } } // namespace boost::dataflow
 
-/// Macro simplifying non-intrusive specification of a type's producer category.
-#define DATAFLOW_PRODUCER_CATEGORY(m,p,pc) \
+/// Macro simplifying non-intrusive specification of a type's PortTraits.
+#define DATAFLOW_PORT_CATEGORY(Type,PortTraits) \
 template<> \
-struct producer_category_of<m, p> \
+struct port_traits_of< \
+ PortTraits::mechanism, \
+ PortTraits::category, \
+ Type> \
 { \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_producer_category<type> )); \
+ typedef PortTraits type; \
+ BOOST_MPL_ASSERT(( is_port_traits<type> )); \
 };
 
 /// Macro simplifying non-intrusive specification of multiple types'
-/// producer category, using a boost::enable_if condition.
-#define DATAFLOW_PRODUCER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
-template<typename P> \
-struct producer_category_of<m, P, typename boost::enable_if< Cond >::type> \
+/// PortTraits, using a boost::enable_if condition.
+#define DATAFLOW_PORT_CATEGORY_ENABLE_IF(Type,Cond,PortTraits) \
+template<typename Type> \
+struct port_traits_of< \
+ typename PortTraits::mechanism, \
+ typename PortTraits::category, \
+ Type, \
+ typename boost::enable_if< Cond >::type> \
 { \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_producer_category<type> )); \
+ typedef PortTraits type; \
+ BOOST_MPL_ASSERT(( is_port_traits<type> )); \
 };
 
-#endif // BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
+#endif // BOOST_DATAFLOW_SUPPORT_PORT_HPP

Deleted: sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/producer.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
+++ (empty file)
@@ -1,123 +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)
-
-#ifndef BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
-#define BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP
-
-#include <boost/dataflow/detail/enable_if_defined.hpp>
-#include <boost/dataflow/support/common.hpp>
-
-#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-
-namespace boost { namespace dataflow {
-
-namespace concepts
-{
- /// Tag
- struct producer;
-}
-
-/// Convenience class for ProducerCategory types.
-template<typename ProducerConcept, typename OutConnectionsStored=connections::none>
-struct producer_category
-{
- typedef ProducerConcept producer_concept;
- typedef OutConnectionsStored out_connections_stored;
-};
-
-/// Trait determining adherence to the ProducerCategory concept.
-template<typename ProducerCategory, typename Enable=void>
-struct is_producer_category : public boost::false_type
-{};
-
-template<typename ProducerCategory>
-struct is_producer_category<ProducerCategory,
- typename detail::enable_if_defined<detail::all_of<
- typename ProducerCategory::out_connections_stored,
- typename ProducerCategory::producer_concept
- > >::type>
- : public boost::mpl::true_
-{};
-
-/// Trait returning the producer category of a type.
-template<typename Mechanism, typename T, typename Enable=void>
-struct producer_category_of
-{};
-
-/// 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::template dataflow<Mechanism>::producer_category type;
- BOOST_MPL_ASSERT(( is_producer_category<type> ));
-};
-
-/// Trait determining adherence to the Producer concept.
-template<typename Mechanism, typename T, typename Enable=void>
-struct is_producer
- : public boost::false_type {};
-
-template<typename Mechanism, typename T>
-struct is_producer<Mechanism, T,
- typename detail::enable_if_defined<
- typename producer_category_of<Mechanism, T>::type
- >::type >
- : public boost::true_type {};
-
-/// Convenience class for Producer types for a specific Mechanism.
-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;
- };
-};
-
-/// Convenience class for Producer types for all Mechanisms.
-template<typename ProducerTag>
-struct producer<all_mechanisms, ProducerTag>
-{
- template<typename M>
- struct dataflow
- {
- typedef ProducerTag producer_category;
- };
-};
-
-} } // namespace boost::dataflow
-
-/// Macro simplifying non-intrusive specification of a type's producer category.
-#define DATAFLOW_PRODUCER_CATEGORY(m,p,pc) \
-template<> \
-struct producer_category_of<m, p> \
-{ \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_producer_category<type> )); \
-};
-
-/// Macro simplifying non-intrusive specification of multiple types'
-/// producer category, using a boost::enable_if condition.
-#define DATAFLOW_PRODUCER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
-template<typename P> \
-struct producer_category_of<m, P, typename boost::enable_if< Cond >::type> \
-{ \
- typedef pc type; \
- BOOST_MPL_ASSERT(( is_producer_category<type> )); \
-};
-
-#endif // BOOST_DATAFLOW_SUPPORT_PRODUCER_HPP

Deleted: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/proxy_consumer.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
+++ (empty file)
@@ -1,244 +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)
-
-#ifndef BOOST_DATAFLOW_SUPPORT_PROXY_CONSUMER_HPP
-#define BOOST_DATAFLOW_SUPPORT_PROXY_CONSUMER_HPP
-
-#include <boost/dataflow/detail/enable_if_defined.hpp>
-#include <boost/dataflow/support/consumer.hpp>
-
-#include <boost/type_traits/integral_constant.hpp>
-
-namespace boost { namespace dataflow {
-
-template<typename ProxiedConsumer>
-struct proxy_consumer_category
-{
- typedef ProxiedConsumer proxied_consumer;
-};
-
-template<typename T, typename Enable=void>
-struct is_proxy_consumer_category : public boost::false_type
-{};
-
-template<typename T>
-struct is_proxy_consumer_category<T,
- typename detail::enable_if_defined<
- typename T::proxied_consumer
- >::type >
- : public boost::true_type
-{};
-
-template<typename T>
-struct default_proxy_consumer : public proxy_consumer_category<T>
-{};
-
-template<typename T>
-struct mutable_proxy_consumer : public proxy_consumer_category<T>
-{};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct proxy_consumer_category_of;
-
-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::template dataflow<Mechanism>::proxy_consumer_category type;
-};
-
-// trait determining whether a type is a consumer proxy.
-template<typename Mechanism, typename T, typename Enable=void>
-struct is_proxy_consumer
- : public boost::false_type {};
-
-template<typename Mechanism, typename T>
-struct is_proxy_consumer<Mechanism, T,
- typename detail::enable_if_defined<
- typename proxy_consumer_category_of<Mechanism, T>::type
- >::type >
- : public boost::true_type {};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_consumer_type
-{
- typedef 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<
- Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type::proxied_consumer
- >::type type;
-};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_consumer_result_type;
-
-template<typename Mechanism, typename T>
-typename boost::disable_if<
- is_proxy_consumer<Mechanism, T>,
- T &
->::type
-get_proxied_consumer(T &t)
-{
- return t;
-}
-
-namespace extension
-{
- template<typename Mechanism, typename ProxyConsumerTag>
- struct get_proxied_consumer_impl
- {
- template<typename ProxyConsumer>
- struct apply
- {
- static void call(const ProxyConsumer &)
- {
- // Error: get_proxied_consumer_impl has not been implemented
- // for ProxyConsumerTag.
- BOOST_STATIC_ASSERT(sizeof(ProxyConsumer)==0);
- }
- };
- };
-
- template<typename Mechanism, typename ProxiedConsumer>
- struct get_proxied_consumer_impl<Mechanism, default_proxy_consumer<ProxiedConsumer> >
- {
- template<typename ProxyConsumer>
- struct apply
- {
- typedef typename
- get_proxied_consumer_result_type<
- Mechanism,
- ProxiedConsumer
- >::type type;
-
- static type call(ProxyConsumer &t)
- {
- return get_proxied_consumer<Mechanism>(
- ProxyConsumer::template dataflow<Mechanism>
- ::get_proxied_consumer(t));
- }
- };
- template<typename ProxyConsumer>
- struct apply<const ProxyConsumer>
- {
- typedef const typename
- get_proxied_consumer_result_type<
- Mechanism,
- ProxiedConsumer
- >::type type;
-
- static type call(const ProxyConsumer &t)
- {
- return get_proxied_consumer<Mechanism>(
- ProxyConsumer::template dataflow<Mechanism>
- ::get_proxied_consumer(t));
- }
- };
- };
-
- template<typename Mechanism, typename ProxiedConsumer>
- struct get_proxied_consumer_impl<Mechanism, mutable_proxy_consumer<ProxiedConsumer> >
- {
- template<typename ProxyConsumer>
- struct apply
- {
- typedef typename
- get_proxied_consumer_result_type<
- Mechanism,
- ProxiedConsumer
- >::type type;
-
- static type call(const ProxyConsumer &t)
- {
- return get_proxied_consumer<Mechanism>(
- ProxyConsumer::template dataflow<Mechanism>
- ::get_proxied_consumer(t));
- }
- };
- };
-}
-
-template<typename Mechanism, typename T>
-struct get_proxied_consumer_result_type<Mechanism, T,
- typename boost::disable_if<is_proxy_consumer<Mechanism, T> >::type>
-{
- typedef T & type;
-};
-
-template<typename Mechanism, typename T>
-struct get_proxied_consumer_result_type<Mechanism, T,
- typename boost::enable_if<is_proxy_consumer<Mechanism, T> >::type>
-{
- typedef
- typename extension::get_proxied_consumer_impl<
- Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type
- >::template apply<T>::type type;
-};
-
-template<typename Mechanism, typename T>
-typename boost::lazy_enable_if<
- is_proxy_consumer<Mechanism, T>,
- typename extension::get_proxied_consumer_impl<Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<T>
->::type
-get_proxied_consumer(T &t)
-{
- return extension::get_proxied_consumer_impl<Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<T>::call(t);
-}
-
-template<typename Mechanism, typename T>
-typename boost::lazy_enable_if<
- is_proxy_consumer<Mechanism, T>,
- typename extension::get_proxied_consumer_impl<
- Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<const T>
->::type
-get_proxied_consumer(const T &t)
-{
- return extension::get_proxied_consumer_impl<
- Mechanism,
- typename proxy_consumer_category_of<Mechanism, T>::type>::template apply<const T>::call(t);
-}
-
-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<
- Mechanism,
- typename get_proxied_consumer_type<Mechanism, T>::type
- >::type type;
-};
-
-} } // namespace boost::dataflow
-
-#define DATAFLOW_PROXY_CONSUMER_CATEGORY(m,p,pc) \
-template<> \
-struct proxy_consumer_category_of<m, p> \
-{ \
- typedef pc type; \
-};
-
-#define DATAFLOW_PROXY_CONSUMER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
-template<typename P> \
-struct proxy_consumer_category_of<m, P, \
- typename boost::enable_if< Cond >::type> \
-{ \
- typedef pc type; \
-};
-
-#endif // BOOST_DATAFLOW_SUPPORT_CONSUMER_HPP

Copied: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_port.hpp (from r39908, /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_port.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -3,242 +3,186 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP
-#define BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP
+#ifndef BOOST_DATAFLOW_SUPPORT_PROXY_PORT_HPP
+#define BOOST_DATAFLOW_SUPPORT_PROXY_PORT_HPP
 
-#include <boost/dataflow/support/producer.hpp>
-
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/static_assert.hpp>
+#include <boost/dataflow/support/port.hpp>
+#include <boost/dataflow/utility/copy_cv.hpp>
 #include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 
+#include <boost/static_assert.hpp>
 
 namespace boost { namespace dataflow {
 
-template<typename ProxiedProducer>
-struct proxy_producer_category
+template<typename Mechanism, typename PortCategory>
+struct proxy_port_traits
 {
- typedef ProxiedProducer proxied_producer;
+ typedef Mechanism mechanism;
+ typedef PortCategory category;
 };
 
 template<typename T, typename Enable=void>
-struct is_proxy_producer_category : public boost::false_type
+struct is_proxy_port_traits : public mpl::false_
 {};
 
 template<typename T>
-struct is_proxy_producer_category<T,
+struct is_proxy_port_traits<T,
     typename detail::enable_if_defined<
- typename T::proxied_producer
+ detail::all_of<
+ typename T::mechanism,
+ typename T::category
+ >
>::type >
- : public boost::true_type
+ : public mpl::true_
 {};
 
-template<typename T>
-struct default_proxy_producer : public proxy_producer_category<T>
+template<typename Mechanism, typename PortCategory, typename T>
+struct default_proxy_port : public proxy_port_traits<Mechanism, PortCategory>
 {};
 
-template<typename T>
-struct mutable_proxy_producer : public proxy_producer_category<T>
+template<typename Mechanism, typename PortCategory, typename T>
+struct mutable_proxy_port : public proxy_port_traits<Mechanism, PortCategory>
 {};
 
-template<typename Mechanism, typename T, typename Enable=void>
-struct proxy_producer_category_of;
+template<typename Mechanism, typename PortCategory, typename T, typename Enable=void>
+struct proxy_port_traits_of;
 
-template<typename Mechanism, typename T>
-struct proxy_producer_category_of<Mechanism, T,
+template<typename Mechanism, typename PortCategory, typename T>
+struct proxy_port_traits_of<Mechanism, PortCategory, T,
     typename detail::enable_if_defined<
- typename T::template dataflow<Mechanism>::proxy_producer_category
+ typename T::template dataflow<Mechanism, PortCategory>::proxy_port_traits
>::type >
 {
- typedef typename T::template dataflow<Mechanism>::proxy_producer_category type;
+ typedef typename T::template dataflow<Mechanism, PortCategory>::proxy_port_traits type;
 };
 
-// trait determining whether a type is a producer proxy.
-template<typename Mechanism, typename T, typename Enable=void>
-struct is_proxy_producer
- : public boost::false_type {};
-
-template<typename Mechanism, typename T>
-struct is_proxy_producer<Mechanism, T,
+template<typename Mechanism, typename PortCategory, typename T>
+struct is_proxy_port<Mechanism, PortCategory, T,
         typename detail::enable_if_defined<
- typename proxy_producer_category_of<
+ typename proxy_port_traits_of<
                 Mechanism,
+ PortCategory,
                 typename boost::remove_cv<T>::type
>::type
>::type >
- : public boost::true_type {};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_producer_type
-{
- typedef 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<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type::proxied_producer
- >::type type;
-};
+ : public mpl::true_ {};
 
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_producer_result_type;
-
-
-template<typename Mechanism, typename T>
-typename boost::disable_if<
- is_proxy_producer<Mechanism, T>,
- T &
+template<typename Mechanism, typename PortCategory, typename T>
+typename boost::enable_if<
+ is_proxy_port<Mechanism, PortCategory, T>,
+ typename get_port_result_type<Mechanism, PortCategory, T>::type
>::type
-get_proxied_producer(T &t)
+get_port(T &t)
 {
- return t;
+ return
+ extension::get_port_impl<
+ typename proxy_port_traits_of<Mechanism, PortCategory, T>::type
+ >::template apply<T>::call(t);
 }
 
 namespace extension
 {
- template<typename Mechanism, typename ProxyProducerTag>
- struct get_proxied_producer_impl
- {
- template<typename ProxyProducer>
- struct apply
- {
- static void call(ProxyProducer &p)
- {
- // Error: get_proxied_producer_impl has not been implemented
- // for ProxyProducerTag.
- BOOST_STATIC_ASSERT(sizeof(ProxyProducer)==0);
- }
- };
- };
-
- template<typename Mechanism, typename ProxiedProducer>
- struct get_proxied_producer_impl<Mechanism, default_proxy_producer<ProxiedProducer> >
+ template<typename Mechanism, typename PortCategory, typename ProxiedPort>
+ struct get_port_impl<default_proxy_port<Mechanism, PortCategory, ProxiedPort> >
     {
- template<typename ProxyProducer>
+ template<typename ProxyPort>
         struct apply
         {
             typedef typename
- get_proxied_producer_result_type<
- Mechanism,
- ProxiedProducer
- >::type type;
-
- static type call(ProxyProducer &t)
- {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
- }
- };
- template<typename ProxyProducer>
- struct apply<const ProxyProducer>
- {
- typedef const typename
- get_proxied_producer_result_type<
+ get_port_result_type<
                     Mechanism,
- ProxiedProducer
+ PortCategory,
+ typename utility::copy_cv<ProxiedPort,ProxyPort>::type
>::type type;
             
- static type call(const ProxyProducer &t)
+ static type call(ProxyPort &t)
             {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
+ return get_port<Mechanism, PortCategory>(
+ ProxyPort::template dataflow<Mechanism, PortCategory>
+ ::get_proxied_port(t));
             }
         };
     };
     
- template<typename Mechanism, typename ProxiedProducer>
- struct get_proxied_producer_impl<Mechanism, mutable_proxy_producer<ProxiedProducer> >
+ template<typename Mechanism, typename PortCategory, typename ProxiedPort>
+ struct get_port_impl<mutable_proxy_port<Mechanism, PortCategory, ProxiedPort> >
     {
- template<typename ProxyProducer>
+ template<typename ProxyPort>
         struct apply
         {
             typedef typename
- get_proxied_producer_result_type<
+ get_port_result_type<
                     Mechanism,
- ProxiedProducer
+ PortCategory,
+ ProxiedPort
>::type type;
             
- static type call(const ProxyProducer &t)
+ static type call(const ProxyPort &t)
             {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
+ return get_port<Mechanism, PortCategory>(
+ ProxyPort::template dataflow<Mechanism, PortCategory>
+ ::get_proxied_port(t));
             }
         };
     };
 }
 
-template<typename Mechanism, typename T>
-struct get_proxied_producer_result_type<Mechanism, T,
- typename boost::disable_if<is_proxy_producer<Mechanism, T> >::type>
-{
- typedef T & type;
-};
-
-template<typename Mechanism, typename T>
-struct get_proxied_producer_result_type<Mechanism, T,
- typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
+template<typename Mechanism, typename PortCategory, typename T>
+struct get_port_result_type<
+ Mechanism,
+ PortCategory,
+ T,
+ typename enable_if<is_proxy_port<Mechanism, PortCategory, T> >::type>
 {
     typedef
- typename extension::get_proxied_producer_impl<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type
+ typename
+ extension::get_port_impl<
+ typename proxy_port_traits_of<
+ Mechanism,
+ PortCategory,
+ typename remove_cv<T>::type
+ >::type
>::template apply<T>::type type;
 };
 
-template<typename Mechanism, typename T>
-typename boost::lazy_enable_if<
- is_proxy_producer<Mechanism, T>,
- typename extension::get_proxied_producer_impl<Mechanism,
- typename proxy_producer_category_of<
- Mechanism,
- typename boost::remove_cv<T>::type
- >::type
- >::template apply<T>
->::type
-get_proxied_producer(T &t)
-{
- return
- extension::get_proxied_producer_impl<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type
- >::template apply<T>::call(t);
-}
-
-template<typename Mechanism, typename T>
-struct producer_category_of<Mechanism, T,
- typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
+template<typename Mechanism, typename PortCategory, typename T>
+struct port_traits_of<Mechanism, T,
+ typename boost::enable_if<is_proxy_port<Mechanism, PortCategory, T> >::type>
 {
     typedef
- typename producer_category_of<
+ typename port_traits_of<
             Mechanism,
- typename get_proxied_producer_type<Mechanism, T>::type
+ PortCategory,
+ typename remove_cv<
+ typename remove_reference<
+ typename get_port_result_type<Mechanism, PortCategory, T>::type
+ >::type
+ >::type
>::type type;
 };
 
 } } // namespace boost::dataflow
 
-#define DATAFLOW_PROXY_PRODUCER_CATEGORY(m,p,pc) \
+#define DATAFLOW_PROXY_PORT_CATEGORY(ProxyPort,ProxyPortCategory) \
 template<> \
-struct proxy_producer_category_of<m, p> \
+struct proxy_port_traits_of< \
+ typename ProxyPortCategory::mechanism, \
+ typename ProxyPortCategory::category, \
+ ProxyPort> \
 { \
- typedef pc type; \
+ typedef ProxyPortCategory type; \
 };
 
-#define DATAFLOW_PROXY_PRODUCER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
+#define DATAFLOW_PROXY_PORT_CATEGORY_ENABLE_IF(P,Cond,ProxyPortCategory) \
 template<typename P> \
-struct proxy_producer_category_of<m, P, \
+struct proxy_port_traits_of< \
+ typename ProxyPortCategory::mechanism, \
+ typename ProxyPortCategory::category, \
+ P, \
     typename boost::enable_if< Cond >::type> \
 { \
- typedef pc type; \
+ typedef ProxyPortCategory type; \
 };
 
-#endif // BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP
+#endif // BOOST_DATAFLOW_SUPPORT_PROXY_PORT_HPP

Deleted: sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/dataflow/support/proxy_producer.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
+++ (empty file)
@@ -1,244 +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)
-
-#ifndef BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP
-#define BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP
-
-#include <boost/dataflow/support/producer.hpp>
-
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-
-
-namespace boost { namespace dataflow {
-
-template<typename ProxiedProducer>
-struct proxy_producer_category
-{
- typedef ProxiedProducer proxied_producer;
-};
-
-template<typename T, typename Enable=void>
-struct is_proxy_producer_category : public boost::false_type
-{};
-
-template<typename T>
-struct is_proxy_producer_category<T,
- typename detail::enable_if_defined<
- typename T::proxied_producer
- >::type >
- : public boost::true_type
-{};
-
-template<typename T>
-struct default_proxy_producer : public proxy_producer_category<T>
-{};
-
-template<typename T>
-struct mutable_proxy_producer : public proxy_producer_category<T>
-{};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct proxy_producer_category_of;
-
-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::template dataflow<Mechanism>::proxy_producer_category type;
-};
-
-// trait determining whether a type is a producer proxy.
-template<typename Mechanism, typename T, typename Enable=void>
-struct is_proxy_producer
- : public boost::false_type {};
-
-template<typename Mechanism, typename T>
-struct is_proxy_producer<Mechanism, T,
- typename detail::enable_if_defined<
- typename proxy_producer_category_of<
- Mechanism,
- typename boost::remove_cv<T>::type
- >::type
- >::type >
- : public boost::true_type {};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_producer_type
-{
- typedef 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<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type::proxied_producer
- >::type type;
-};
-
-template<typename Mechanism, typename T, typename Enable=void>
-struct get_proxied_producer_result_type;
-
-
-template<typename Mechanism, typename T>
-typename boost::disable_if<
- is_proxy_producer<Mechanism, T>,
- T &
->::type
-get_proxied_producer(T &t)
-{
- return t;
-}
-
-namespace extension
-{
- template<typename Mechanism, typename ProxyProducerTag>
- struct get_proxied_producer_impl
- {
- template<typename ProxyProducer>
- struct apply
- {
- static void call(ProxyProducer &p)
- {
- // Error: get_proxied_producer_impl has not been implemented
- // for ProxyProducerTag.
- BOOST_STATIC_ASSERT(sizeof(ProxyProducer)==0);
- }
- };
- };
-
- template<typename Mechanism, typename ProxiedProducer>
- struct get_proxied_producer_impl<Mechanism, default_proxy_producer<ProxiedProducer> >
- {
- template<typename ProxyProducer>
- struct apply
- {
- typedef typename
- get_proxied_producer_result_type<
- Mechanism,
- ProxiedProducer
- >::type type;
-
- static type call(ProxyProducer &t)
- {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
- }
- };
- template<typename ProxyProducer>
- struct apply<const ProxyProducer>
- {
- typedef const typename
- get_proxied_producer_result_type<
- Mechanism,
- ProxiedProducer
- >::type type;
-
- static type call(const ProxyProducer &t)
- {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
- }
- };
- };
-
- template<typename Mechanism, typename ProxiedProducer>
- struct get_proxied_producer_impl<Mechanism, mutable_proxy_producer<ProxiedProducer> >
- {
- template<typename ProxyProducer>
- struct apply
- {
- typedef typename
- get_proxied_producer_result_type<
- Mechanism,
- ProxiedProducer
- >::type type;
-
- static type call(const ProxyProducer &t)
- {
- return get_proxied_producer<Mechanism>(
- ProxyProducer::template dataflow<Mechanism>
- ::get_proxied_producer(t));
- }
- };
- };
-}
-
-template<typename Mechanism, typename T>
-struct get_proxied_producer_result_type<Mechanism, T,
- typename boost::disable_if<is_proxy_producer<Mechanism, T> >::type>
-{
- typedef T & type;
-};
-
-template<typename Mechanism, typename T>
-struct get_proxied_producer_result_type<Mechanism, T,
- typename boost::enable_if<is_proxy_producer<Mechanism, T> >::type>
-{
- typedef
- typename extension::get_proxied_producer_impl<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type
- >::template apply<T>::type type;
-};
-
-template<typename Mechanism, typename T>
-typename boost::lazy_enable_if<
- is_proxy_producer<Mechanism, T>,
- typename extension::get_proxied_producer_impl<Mechanism,
- typename proxy_producer_category_of<
- Mechanism,
- typename boost::remove_cv<T>::type
- >::type
- >::template apply<T>
->::type
-get_proxied_producer(T &t)
-{
- return
- extension::get_proxied_producer_impl<
- Mechanism,
- typename proxy_producer_category_of<Mechanism, T>::type
- >::template apply<T>::call(t);
-}
-
-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<
- Mechanism,
- typename get_proxied_producer_type<Mechanism, T>::type
- >::type type;
-};
-
-} } // namespace boost::dataflow
-
-#define DATAFLOW_PROXY_PRODUCER_CATEGORY(m,p,pc) \
-template<> \
-struct proxy_producer_category_of<m, p> \
-{ \
- typedef pc type; \
-};
-
-#define DATAFLOW_PROXY_PRODUCER_CATEGORY_ENABLE_IF(m,P,Cond,pc) \
-template<typename P> \
-struct proxy_producer_category_of<m, P, \
- typename boost::enable_if< Cond >::type> \
-{ \
- typedef pc type; \
-};
-
-#endif // BOOST_DATAFLOW_SUPPORT_PROXY_PRODUCER_HPP

Added: sandbox/SOC/2007/signals/boost/dataflow/utility/copy_cv.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/boost/dataflow/utility/copy_cv.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,56 @@
+// 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_UTILITY_TRANSFER_CV_HPP
+#define BOOST_DATAFLOW_UTILITY_TRANSFER_CV_HPP
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/add_volatile.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/remove_volatile.hpp>
+
+namespace boost { namespace dataflow { namespace utility {
+
+template<typename T_dst, typename T_src>
+struct copy_const
+{
+ typedef
+ typename mpl::if_<
+ is_const<T_src>,
+ add_const<T_dst>,
+ remove_const<T_dst>
+ >::type::type type;
+};
+
+template<typename T_dst, typename T_src>
+struct copy_volatile
+{
+ typedef
+ typename mpl::if_<
+ is_volatile<T_src>,
+ add_volatile<T_dst>,
+ remove_volatile<T_dst>
+ >::type::type type;
+};
+
+template<typename T_dst, typename T_src>
+struct copy_cv
+{
+ typedef
+ typename copy_volatile<
+ typename copy_const<
+ T_dst,
+ T_src
+ >::type,
+ T_src
+ >::type type;
+};
+
+} } }
+
+#endif // BOOST_DATAFLOW_UTILITY_TRANSFER_CV_HPP
\ No newline at end of file

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-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -80,6 +80,9 @@
                 0800AC390C8CAAC300994538 /* boost-build.jam */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.jam; name = "boost-build.jam"; path = "../../../../boost-build.jam"; sourceTree = SOURCE_ROOT; };
                 0800AC3A0C8CAAC300994538 /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = Jamfile.v2; path = ../../../../Jamfile.v2; sourceTree = SOURCE_ROOT; };
                 0800AC3B0C8CAAC300994538 /* project-root.jam */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.jam; name = "project-root.jam"; path = "../../../../project-root.jam"; sourceTree = SOURCE_ROOT; };
+ 08061C2D0CBEE985002DC710 /* binary_operation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = binary_operation.hpp; sourceTree = "<group>"; };
+ 08061C980CBEF0C6002DC710 /* keyed_port.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = keyed_port.hpp; sourceTree = "<group>"; };
+ 08061CC40CBEF3F7002DC710 /* port_map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = port_map.hpp; sourceTree = "<group>"; };
                 082761BB0C6037740030E557 /* producer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = producer.hpp; sourceTree = "<group>"; };
                 082761BC0C6037940030E557 /* consumer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = consumer.hpp; sourceTree = "<group>"; };
                 082761BD0C60379F0030E557 /* connectable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = connectable.hpp; sourceTree = "<group>"; };
@@ -151,11 +154,14 @@
                 08F2464D0CA86D85001C3D41 /* Cone4.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cone4.cxx; sourceTree = "<group>"; };
                 08F2464E0CA86D85001C3D41 /* Cone5.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cone5.cxx; sourceTree = "<group>"; };
                 08F2464F0CA86D85001C3D41 /* Cone6.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cone6.cxx; sourceTree = "<group>"; };
+ 08F26C8B0CBF1CBA00EDC3F6 /* test_port.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_port.cpp; sourceTree = "<group>"; };
+ 08F26D630CBF2D4100EDC3F6 /* test_proxy_port.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_proxy_port.cpp; sourceTree = "<group>"; };
                 08F2C31A0CAD961F00F9100C /* operators.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = operators.hpp; sourceTree = "<group>"; };
                 08F2C31B0CAD961F00F9100C /* support.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = support.hpp; sourceTree = "<group>"; };
                 08F308790CA6E54200652D11 /* keyed_producer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = keyed_producer.hpp; sourceTree = "<group>"; };
                 08F343460CAAEF92004F6DA7 /* disconnect_all_ins.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = disconnect_all_ins.hpp; sourceTree = "<group>"; };
                 08F348510C492B4B0096097F /* group.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = group.hpp; sourceTree = "<group>"; };
+ 08F348970CC021E0006D0A67 /* copy_cv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = copy_cv.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>"; };
@@ -163,6 +169,7 @@
                 08F404420CAA0C5200E80B8C /* only_connectable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = only_connectable.hpp; sourceTree = "<group>"; };
                 08F418060CBD69DC007E7F7A /* header.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = header.hpp; sourceTree = "<group>"; };
                 08F418080CBD69FE007E7F7A /* port.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = port.hpp; sourceTree = "<group>"; };
+ 08F418AB0CBD7668007E7F7A /* proxy_port.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = proxy_port.hpp; sourceTree = "<group>"; };
                 08F4533A0C92259D00877528 /* proxy_producer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = proxy_producer.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>"; };
@@ -262,6 +269,8 @@
                                 08F71D3D0CA3547C0010099E /* signals */,
                                 08C675970C13A03E00D85379 /* Jamfile.v2 */,
                                 08F8A00B0C3C879C007637A9 /* test_result_of_defined.cpp */,
+ 08F26C8B0CBF1CBA00EDC3F6 /* test_port.cpp */,
+ 08F26D630CBF2D4100EDC3F6 /* test_proxy_port.cpp */,
                         );
                         name = test;
                         path = ../../test;
@@ -371,6 +380,9 @@
                                 08F343460CAAEF92004F6DA7 /* disconnect_all_ins.hpp */,
                                 08F418060CBD69DC007E7F7A /* header.hpp */,
                                 08F418080CBD69FE007E7F7A /* port.hpp */,
+ 08F418AB0CBD7668007E7F7A /* proxy_port.hpp */,
+ 08061C2D0CBEE985002DC710 /* binary_operation.hpp */,
+ 08061C980CBEF0C6002DC710 /* keyed_port.hpp */,
                         );
                         path = support;
                         sourceTree = "<group>";
@@ -392,6 +404,7 @@
                                 08F022C70C47565600C0ED27 /* operators.hpp */,
                                 08F076F80C63C78C003D448D /* consumer_map.hpp */,
                                 089A9A150C931BDD00C6C5F1 /* producer_map.hpp */,
+ 08061CC40CBEF3F7002DC710 /* port_map.hpp */,
                         );
                         path = connection;
                         sourceTree = "<group>";
@@ -420,6 +433,14 @@
                         path = operator;
                         sourceTree = "<group>";
                 };
+ 08F348960CC021CE006D0A67 /* utility */ = {
+ isa = PBXGroup;
+ children = (
+ 08F348970CC021E0006D0A67 /* copy_cv.hpp */,
+ );
+ path = utility;
+ sourceTree = "<group>";
+ };
                 08F37EDE0C57A49500AC7FB8 /* detail */ = {
                         isa = PBXGroup;
                         children = (
@@ -468,6 +489,7 @@
                 08FC25BA0C45B60E00F59CDD /* dataflow */ = {
                         isa = PBXGroup;
                         children = (
+ 08F348960CC021CE006D0A67 /* utility */,
                                 08F079940CA88EAB001E6E24 /* templates */,
                                 08EF9B200C5D506A00D4D206 /* signal */,
                                 08F022C10C47556200C0ED27 /* connection */,

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-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -130,6 +130,39 @@
 
 [endsect][/mechanism]
 
+[section PortCategory]
+
+A [PortCategoryConcept] designates a type of port in the Dataflow library.
+The library currently defines two [PortCategoryConcept]s:
+
+ * `boost::dataflow::ports::producer`, and
+ * `boost::dataflow::ports::consumer`
+
+[heading Notation]
+The following expressions are used in this document:
+
+[variablelist
+ [[PT] [A [PortCategoryConcept] type.]]
+]
+
+[heading Requirements]
+[table
+ [[Name] [Expression] [Result Type] [Description]]
+ [
+ [Opposite PortCategory]
+ [`PT::complement`]
+ [[PortCategoryConcept] type]
+ [
+ The complementing [PortCategory] of `PT`, meaning that connections
+ can be made between [PortConcept]s of [PortCategoryConcept] `PT` and
+ [PortConcept]s of [PortCategoryConcept] `PT::complement`.
+ ]
+ ]
+]
+
+
+[endsect][/porttype]
+
 [include producer_concepts.qbk]
 
 [include consumer_concepts.qbk]

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-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -14,6 +14,7 @@
 
 [template concepts[] [link dataflow.concepts concepts]]
 [template MechanismConcept[] [link dataflow.concepts.mechanism [^Mechanism]]]
+[template PortCategoryConcept[] [link dataflow.concepts.porttype [^PortCategory]]]
 [template FilterConcept[] [link dataflow.concepts.filter [^Filter]]]
 [template ProducerCategoryConcept[] [link dataflow.concepts.producercategory [^ProducerCategory]]]
 [template ProducerConcept[] [link dataflow.concepts.producer [^Producer]]]

Added: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone3.cxx
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone3.cxx 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,121 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile: Cone3.cxx,v $
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+//
+// This example demonstrates how to use multiple renderers within a
+// render window. It is a variation of the Cone.cxx example. Please
+// refer to that example for additional documentation.
+//
+
+// First include the required header files for the VTK classes we are using.
+#include "vtkConeSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkRenderWindow.h"
+#include "vtkCamera.h"
+#include "vtkActor.h"
+#include "vtkRenderer.h"
+
+int main()
+{
+ //
+ // Next we create an instance of vtkConeSource and set some of its
+ // properties. The instance of vtkConeSource "cone" is part of a
+ // visualization pipeline (it is a source process object); it produces data
+ // (output type is vtkPolyData) which other filters may process.
+ //
+ vtkConeSource *cone = vtkConeSource::New();
+ cone->SetHeight( 3.0 );
+ cone->SetRadius( 1.0 );
+ cone->SetResolution( 10 );
+
+ //
+ // In this example we terminate the pipeline with a mapper process object.
+ // (Intermediate filters such as vtkShrinkPolyData could be inserted in
+ // between the source and the mapper.) We create an instance of
+ // vtkPolyDataMapper to map the polygonal data into graphics primitives. We
+ // connect the output of the cone souece to the input of this mapper.
+ //
+ vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
+ coneMapper->SetInputConnection( cone->GetOutputPort() );
+
+ //
+ // Create an actor to represent the cone. The actor orchestrates rendering
+ // of the mapper's graphics primitives. An actor also refers to properties
+ // via a vtkProperty instance, and includes an internal transformation
+ // matrix. We set this actor's mapper to be coneMapper which we created
+ // above.
+ //
+ vtkActor *coneActor = vtkActor::New();
+ coneActor->SetMapper( coneMapper );
+
+ //
+ // Create two renderers and assign actors to them. A renderer renders into
+ // a viewport within the vtkRenderWindow. It is part or all of a window on
+ // the screen and it is responsible for drawing the actors it has. We also
+ // set the background color here. In this example we are adding the same
+ // actor to two different renderers; it is okay to add different actors to
+ // different renderers as well.
+ //
+ vtkRenderer *ren1= vtkRenderer::New();
+ ren1->AddActor( coneActor );
+ ren1->SetBackground( 0.1, 0.2, 0.4 );
+ ren1->SetViewport(0.0, 0.0, 0.5, 1.0);
+
+ vtkRenderer *ren2= vtkRenderer::New();
+ ren2->AddActor( coneActor );
+ ren2->SetBackground( 0.2, 0.3, 0.5 );
+ ren2->SetViewport(0.5, 0.0, 1.0, 1.0);
+
+ //
+ // Finally we create the render window which will show up on the screen.
+ // We put our renderer into the render window using AddRenderer. We also
+ // set the size to be 300 pixels by 300.
+ //
+ vtkRenderWindow *renWin = vtkRenderWindow::New();
+ renWin->AddRenderer( ren1 );
+ renWin->AddRenderer( ren2 );
+ renWin->SetSize( 600, 300 );
+
+ //
+ // Make one view 90 degrees from other.
+ //
+ ren1->ResetCamera();
+ ren1->GetActiveCamera()->Azimuth(90);
+
+ //
+ // Now we loop over 360 degreeees and render the cone each time.
+ //
+ int i;
+ for (i = 0; i < 360; ++i)
+ {
+ // render the image
+ renWin->Render();
+ // rotate the active camera by one degree
+ ren1->GetActiveCamera()->Azimuth( 1 );
+ ren2->GetActiveCamera()->Azimuth( 1 );
+ }
+
+ //
+ // Free up any objects we created. All instances in VTK are deleted by
+ // using the Delete() method.
+ //
+ cone->Delete();
+ coneMapper->Delete();
+ coneActor->Delete();
+ ren1->Delete();
+ ren2->Delete();
+ renWin->Delete();
+
+ return 0;
+}

Added: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone4.cxx
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone4.cxx 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,134 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile: Cone4.cxx,v $
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+//
+// This example demonstrates the creation of multiple actors and the
+// manipulation of their properties and transformations. It is a
+// derivative of Cone.tcl, see that example for more information.
+//
+
+// First include the required header files for the VTK classes we are using.
+#include "vtkConeSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkRenderWindow.h"
+#include "vtkCamera.h"
+#include "vtkActor.h"
+#include "vtkRenderer.h"
+#include "vtkProperty.h"
+
+int main()
+{
+ //
+ // Next we create an instance of vtkConeSource and set some of its
+ // properties. The instance of vtkConeSource "cone" is part of a
+ // visualization pipeline (it is a source process object); it produces data
+ // (output type is vtkPolyData) which other filters may process.
+ //
+ vtkConeSource *cone = vtkConeSource::New();
+ cone->SetHeight( 3.0 );
+ cone->SetRadius( 1.0 );
+ cone->SetResolution( 10 );
+
+ //
+ // In this example we terminate the pipeline with a mapper process object.
+ // (Intermediate filters such as vtkShrinkPolyData could be inserted in
+ // between the source and the mapper.) We create an instance of
+ // vtkPolyDataMapper to map the polygonal data into graphics primitives. We
+ // connect the output of the cone souece to the input of this mapper.
+ //
+ vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
+ coneMapper->SetInputConnection( cone->GetOutputPort() );
+
+ //
+ // Create an actor to represent the first cone. The actor's properties are
+ // modified to give it different surface properties. By default, an actor
+ // is create with a property so the GetProperty() method can be used.
+ //
+ vtkActor *coneActor = vtkActor::New();
+ coneActor->SetMapper( coneMapper );
+ coneActor->GetProperty()->SetColor(0.2, 0.63, 0.79);
+ coneActor->GetProperty()->SetDiffuse(0.7);
+ coneActor->GetProperty()->SetSpecular(0.4);
+ coneActor->GetProperty()->SetSpecularPower(20);
+
+ //
+ // Create a property and directly manipulate it. Assign it to the
+ // second actor.
+ //
+ vtkProperty *property = vtkProperty::New();
+ property->SetColor(1.0, 0.3882, 0.2784);
+ property->SetDiffuse(0.7);
+ property->SetSpecular(0.4);
+ property->SetSpecularPower(20);
+
+ //
+ // Create a second actor and a property. The property is directly
+ // manipulated and then assigned to the actor. In this way, a single
+ // property can be shared among many actors. Note also that we use the
+ // same mapper as the first actor did. This way we avoid duplicating
+ // geometry, which may save lots of memory if the geoemtry is large.
+ vtkActor *coneActor2 = vtkActor::New();
+ coneActor2->SetMapper(coneMapper);
+ coneActor2->GetProperty()->SetColor(0.2, 0.63, 0.79);
+ coneActor2->SetProperty(property);
+ coneActor2->SetPosition(0, 2, 0);
+
+ //
+ // Create the Renderer and assign actors to it. A renderer is like a
+ // viewport. It is part or all of a window on the screen and it is
+ // responsible for drawing the actors it has. We also set the background
+ // color here.
+ //
+ vtkRenderer *ren1= vtkRenderer::New();
+ ren1->AddActor( coneActor );
+ ren1->AddActor( coneActor2 );
+ ren1->SetBackground( 0.1, 0.2, 0.4 );
+
+ //
+ // Finally we create the render window which will show up on the screen.
+ // We put our renderer into the render window using AddRenderer. We also
+ // set the size to be 300 pixels by 300.
+ //
+ vtkRenderWindow *renWin = vtkRenderWindow::New();
+ renWin->AddRenderer( ren1 );
+ renWin->SetSize( 300, 300 );
+
+ //
+ // Now we loop over 360 degreeees and render the cone each time.
+ //
+ int i;
+ for (i = 0; i < 360; ++i)
+ {
+ // render the image
+ renWin->Render();
+ // rotate the active camera by one degree
+ ren1->GetActiveCamera()->Azimuth( 1 );
+ }
+
+ //
+ // Free up any objects we created. All instances in VTK are deleted by
+ // using the Delete() method.
+ //
+ cone->Delete();
+ coneMapper->Delete();
+ coneActor->Delete();
+ property->Delete();
+ coneActor2->Delete();
+ ren1->Delete();
+ renWin->Delete();
+
+ return 0;
+}
+
+

Added: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone5.cxx
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone5.cxx 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,136 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile: Cone5.cxx,v $
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+//
+// This example introduces the concepts of interaction into the
+// C++ environment. A different interaction style (than
+// the default) is defined.
+//
+
+// First include the required header files for the VTK classes we are using.
+#include "vtkConeSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkCamera.h"
+#include "vtkActor.h"
+#include "vtkRenderer.h"
+#include "vtkInteractorStyleTrackballCamera.h"
+
+int main()
+{
+ //
+ // Next we create an instance of vtkConeSource and set some of its
+ // properties. The instance of vtkConeSource "cone" is part of a
+ // visualization pipeline (it is a source process object); it produces data
+ // (output type is vtkPolyData) which other filters may process.
+ //
+ vtkConeSource *cone = vtkConeSource::New();
+ cone->SetHeight( 3.0 );
+ cone->SetRadius( 1.0 );
+ cone->SetResolution( 10 );
+
+ //
+ // In this example we terminate the pipeline with a mapper process object.
+ // (Intermediate filters such as vtkShrinkPolyData could be inserted in
+ // between the source and the mapper.) We create an instance of
+ // vtkPolyDataMapper to map the polygonal data into graphics primitives. We
+ // connect the output of the cone souece to the input of this mapper.
+ //
+ vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
+ coneMapper->SetInputConnection( cone->GetOutputPort() );
+
+ //
+ // Create an actor to represent the cone. The actor orchestrates rendering
+ // of the mapper's graphics primitives. An actor also refers to properties
+ // via a vtkProperty instance, and includes an internal transformation
+ // matrix. We set this actor's mapper to be coneMapper which we created
+ // above.
+ //
+ vtkActor *coneActor = vtkActor::New();
+ coneActor->SetMapper( coneMapper );
+
+ //
+ // Create the Renderer and assign actors to it. A renderer is like a
+ // viewport. It is part or all of a window on the screen and it is
+ // responsible for drawing the actors it has. We also set the background
+ // color here.
+ //
+ vtkRenderer *ren1= vtkRenderer::New();
+ ren1->AddActor( coneActor );
+ ren1->SetBackground( 0.1, 0.2, 0.4 );
+
+ //
+ // Finally we create the render window which will show up on the screen.
+ // We put our renderer into the render window using AddRenderer. We also
+ // set the size to be 300 pixels by 300.
+ //
+ vtkRenderWindow *renWin = vtkRenderWindow::New();
+ renWin->AddRenderer( ren1 );
+ renWin->SetSize( 300, 300 );
+
+ //
+ // The vtkRenderWindowInteractor class watches for events (e.g., keypress,
+ // mouse) in the vtkRenderWindow. These events are translated into
+ // event invocations that VTK understands (see VTK/Common/vtkCommand.h
+ // for all events that VTK processes). Then observers of these VTK
+ // events can process them as appropriate.
+ vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+ iren->SetRenderWindow(renWin);
+
+ //
+ // By default the vtkRenderWindowInteractor instantiates an instance
+ // of vtkInteractorStyle. vtkInteractorStyle translates a set of events
+ // it observes into operations on the camera, actors, and/or properties
+ // in the vtkRenderWindow associated with the vtkRenderWinodwInteractor.
+ // Here we specify a particular interactor style.
+ vtkInteractorStyleTrackballCamera *style =
+ vtkInteractorStyleTrackballCamera::New();
+ iren->SetInteractorStyle(style);
+
+ //
+ // Unlike the previous scripts where we performed some operations and then
+ // exited, here we leave an event loop running. The user can use the mouse
+ // and keyboard to perform the operations on the scene according to the
+ // current interaction style. When the user presses the "e" key, by default
+ // an ExitEvent is invoked by the vtkRenderWindowInteractor which is caught
+ // and drops out of the event loop (triggered by the Start() method that
+ // follows.
+ //
+ iren->Initialize();
+ iren->Start();
+
+ //
+ // Final note: recall that an observers can watch for particular events and
+ // take appropriate action. Pressing "u" in the render window causes the
+ // vtkRenderWindowInteractor to invoke a UserEvent. This can be caught to
+ // popup a GUI, etc. So the Tcl Cone5.tcl example for an idea of how this
+ // works.
+
+ //
+ // Free up any objects we created. All instances in VTK are deleted by
+ // using the Delete() method.
+ //
+ cone->Delete();
+ coneMapper->Delete();
+ coneActor->Delete();
+ ren1->Delete();
+ renWin->Delete();
+ iren->Delete();
+ style->Delete();
+
+ return 0;
+}
+
+

Added: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone6.cxx
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone6.cxx 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,183 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile: Cone6.cxx,v $
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+//
+// This example introduces 3D widgets. 3D widgets take advantage of the
+// event/observer design pattern introduced previously. They typically
+// have a particular representation in the scene which can be interactively
+// selected and manipulated using the mouse and keyboard. As the widgets
+// are manipulated, they in turn invoke events such as StartInteractionEvent,
+// InteractionEvent, and EndInteractionEvent which can be used to manipulate
+// the scene that the widget is embedded in. 3D widgets work in the context
+// of the event loop which was set up in the previous example.
+//
+// Note: there are more 3D widget examples in VTK/Examples/GUI/.
+//
+
+// First include the required header files for the VTK classes we are using.
+#include "vtkConeSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkCamera.h"
+#include "vtkActor.h"
+#include "vtkRenderer.h"
+#include "vtkCommand.h"
+#include "vtkBoxWidget.h"
+#include "vtkTransform.h"
+#include "vtkInteractorStyleTrackballCamera.h"
+
+//
+// Similar to Cone2.cxx, we define a callback for interaction.
+//
+class vtkMyCallback : public vtkCommand
+{
+public:
+ static vtkMyCallback *New()
+ { return new vtkMyCallback; }
+ virtual void Execute(vtkObject *caller, unsigned long, void*)
+ {
+ vtkTransform *t = vtkTransform::New();
+ vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
+ widget->GetTransform(t);
+ widget->GetProp3D()->SetUserTransform(t);
+ t->Delete();
+ }
+};
+
+int main()
+{
+ //
+ // Next we create an instance of vtkConeSource and set some of its
+ // properties. The instance of vtkConeSource "cone" is part of a
+ // visualization pipeline (it is a source process object); it produces data
+ // (output type is vtkPolyData) which other filters may process.
+ //
+ vtkConeSource *cone = vtkConeSource::New();
+ cone->SetHeight( 3.0 );
+ cone->SetRadius( 1.0 );
+ cone->SetResolution( 10 );
+
+ //
+ // In this example we terminate the pipeline with a mapper process object.
+ // (Intermediate filters such as vtkShrinkPolyData could be inserted in
+ // between the source and the mapper.) We create an instance of
+ // vtkPolyDataMapper to map the polygonal data into graphics primitives. We
+ // connect the output of the cone souece to the input of this mapper.
+ //
+ vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
+ coneMapper->SetInputConnection( cone->GetOutputPort() );
+
+ //
+ // Create an actor to represent the cone. The actor orchestrates rendering
+ // of the mapper's graphics primitives. An actor also refers to properties
+ // via a vtkProperty instance, and includes an internal transformation
+ // matrix. We set this actor's mapper to be coneMapper which we created
+ // above.
+ //
+ vtkActor *coneActor = vtkActor::New();
+ coneActor->SetMapper( coneMapper );
+
+ //
+ // Create the Renderer and assign actors to it. A renderer is like a
+ // viewport. It is part or all of a window on the screen and it is
+ // responsible for drawing the actors it has. We also set the background
+ // color here.
+ //
+ vtkRenderer *ren1= vtkRenderer::New();
+ ren1->AddActor( coneActor );
+ ren1->SetBackground( 0.1, 0.2, 0.4 );
+
+ //
+ // Finally we create the render window which will show up on the screen.
+ // We put our renderer into the render window using AddRenderer. We also
+ // set the size to be 300 pixels by 300.
+ //
+ vtkRenderWindow *renWin = vtkRenderWindow::New();
+ renWin->AddRenderer( ren1 );
+ renWin->SetSize( 300, 300 );
+
+ //
+ // The vtkRenderWindowInteractor class watches for events (e.g., keypress,
+ // mouse) in the vtkRenderWindow. These events are translated into
+ // event invocations that VTK understands (see VTK/Common/vtkCommand.h
+ // for all events that VTK processes). Then observers of these VTK
+ // events can process them as appropriate.
+ vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+ iren->SetRenderWindow(renWin);
+
+ //
+ // By default the vtkRenderWindowInteractor instantiates an instance
+ // of vtkInteractorStyle. vtkInteractorStyle translates a set of events
+ // it observes into operations on the camera, actors, and/or properties
+ // in the vtkRenderWindow associated with the vtkRenderWinodwInteractor.
+ // Here we specify a particular interactor style.
+ vtkInteractorStyleTrackballCamera *style =
+ vtkInteractorStyleTrackballCamera::New();
+ iren->SetInteractorStyle(style);
+
+ //
+ // Here we use a vtkBoxWidget to transform the underlying coneActor (by
+ // manipulating its transformation matrix). Many other types of widgets
+ // are available for use, see the documentation for more details.
+ //
+ // The SetInteractor method is how 3D widgets are associated with the render
+ // window interactor. Internally, SetInteractor sets up a bunch of callbacks
+ // using the Command/Observer mechanism (AddObserver()). The place factor
+ // controls the initial size of the widget with respect to the bounding box
+ // of the input to the widget.
+ vtkBoxWidget *boxWidget = vtkBoxWidget::New();
+ boxWidget->SetInteractor(iren);
+ boxWidget->SetPlaceFactor(1.25);
+
+ //
+ // Place the interactor initially. The input to a 3D widget is used to
+ // initially position and scale the widget. The EndInteractionEvent is
+ // observed which invokes the SelectPolygons callback.
+ //
+ boxWidget->SetProp3D(coneActor);
+ boxWidget->PlaceWidget();
+ vtkMyCallback *callback = vtkMyCallback::New();
+ boxWidget->AddObserver(vtkCommand::InteractionEvent, callback);
+
+ //
+ // Normally the user presses the "i" key to bring a 3D widget to life. Here
+ // we will manually enable it so it appears with the cone.
+ //
+ boxWidget->On();
+
+ //
+ // Start the event loop.
+ //
+ iren->Initialize();
+ iren->Start();
+
+ //
+ // Free up any objects we created. All instances in VTK are deleted by
+ // using the Delete() method.
+ //
+ cone->Delete();
+ coneMapper->Delete();
+ coneActor->Delete();
+ callback->Delete();
+ boxWidget->Delete();
+ ren1->Delete();
+ renWin->Delete();
+ iren->Delete();
+ style->Delete();
+
+ return 0;
+}
+
+

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Jamfile.v2 (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Jamfile.v2 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -31,9 +31,9 @@
     ;
 
 exe Cone : Cone.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
-exe Cone2 : Cone2.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
-exe Cone3 : Cone3.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
-exe Cone4 : Cone4.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
-exe Cone5 : Cone5.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
-exe Cone6 : Cone6.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics vtkWidgets GL ;
+#exe Cone2 : Cone2.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
+#exe Cone3 : Cone3.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
+#exe Cone4 : Cone4.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
+#exe Cone5 : Cone5.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics GL ;
+#exe Cone6 : Cone6.cxx X11 Xt vtkCommon vtkRendering vtkFiltering vtkGraphics vtkWidgets GL ;
 

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/operators.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/operators.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/operators.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -20,8 +20,8 @@
 template<typename Input, typename Output>
 typename boost::enable_if<
     boost::mpl::and_<
- boost::dataflow::is_producer<boost::dataflow::vtk::mechanism, Input>,
- boost::dataflow::is_consumer<boost::dataflow::vtk::mechanism, Output>
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::producer, Input>,
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::consumer, Output>
>,
     Input &
>::type
@@ -32,8 +32,8 @@
 template<typename Input, typename Output>
 typename boost::enable_if<
     boost::mpl::and_<
- boost::dataflow::is_producer<boost::dataflow::vtk::mechanism, Input>,
- boost::dataflow::is_consumer<boost::dataflow::vtk::mechanism, Output>
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::producer, Input>,
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::consumer, Output>
>,
     Input &
>::type
@@ -49,8 +49,8 @@
 template<typename Input, typename Output>
 typename boost::enable_if<
     boost::mpl::and_<
- boost::dataflow::is_producer<boost::dataflow::vtk::mechanism, Input>,
- boost::dataflow::is_consumer<boost::dataflow::vtk::mechanism, Output>
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::producer, Input>,
+ boost::dataflow::is_port<boost::dataflow::vtk::mechanism, boost::dataflow::ports::consumer, Output>
>,
     Input &
>::type

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/support.hpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -12,7 +12,7 @@
 #include "vtkRenderWindow.h"
 
 #include <boost/dataflow/support.hpp>
-#include <boost/dataflow/connection/producer_map.hpp>
+#include <boost/dataflow/connection/port_map.hpp>
 
 #include <boost/assert.hpp>
 #include <boost/mpl/and.hpp>
@@ -39,11 +39,11 @@
 namespace vtk {
 
 struct vtk_algorithm_output_producer
- : public producer_category<concepts::producer, connections::none> {};
+ : public port_traits<mechanism, ports::producer, concepts::producer> {};
     
 } // namespace boost::dataflow::vtk
 
-DATAFLOW_PRODUCER_CATEGORY(vtk::mechanism, vtkAlgorithmOutput, vtk::vtk_algorithm_output_producer)
+DATAFLOW_PORT_CATEGORY(vtkAlgorithmOutput, vtk::vtk_algorithm_output_producer)
 
 //]
 
@@ -52,11 +52,12 @@
 namespace vtk {
 
 struct vtk_algorithm_consumer
- : public consumer_category<concepts::consumer> {};
+ : public port_traits<mechanism, ports::consumer, concepts::consumer> {};
     
 } // namespace boost::dataflow::vtk
 
-DATAFLOW_CONSUMER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
     boost::is_base_of<vtkAlgorithm BOOST_PP_COMMA() T>,
     vtk::vtk_algorithm_consumer)
 
@@ -66,7 +67,7 @@
 namespace extension {
 
     template<>
- struct connect_impl<vtk::mechanism, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
+ struct binary_impl<vtk::mechanism, operations::connect, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -79,7 +80,7 @@
     };
     
     template<>
- struct connect_only_impl<vtk::mechanism, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
+ struct binary_impl<vtk::mechanism, operations::connect_only, vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -101,11 +102,12 @@
 namespace vtk {
 
 struct vtk_algorithm_proxy_producer
- : public proxy_producer_category<vtkAlgorithmOutput> {};
+ : public proxy_port_traits<vtkAlgorithmOutput> {};
 
 } // namespace boost::dataflow::vtk
 
-DATAFLOW_PROXY_PRODUCER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PROXY_PORT_CATEGORY_ENABLE_IF(vtk::mechanism, ports::producer,
+ T,
     mpl::and_<
         typename boost::is_base_of<vtkAlgorithm BOOST_PP_COMMA() T> BOOST_PP_COMMA()
         mpl::not_<boost::is_base_of<vtkMapper BOOST_PP_COMMA() T> >
@@ -115,7 +117,7 @@
 namespace extension {
 
     template<>
- struct get_proxied_producer_impl<vtk::mechanism, vtk::vtk_algorithm_proxy_producer>
+ struct get_proxied_port_impl<vtk::mechanism, ports::producer, vtk::vtk_algorithm_proxy_producer>
     {
         template<typename ProxyProducer>
         struct apply
@@ -136,16 +138,25 @@
 
 namespace vtk {
 
-struct vtk_actor_filter
- : public producer_category<concepts::producer>
- , public consumer_category<concepts::consumer>
+struct vtk_actor_producer
+ : public port_traits<mechanism, ports::producer, concepts::producer>
+{};
+
+struct vtk_actor_consumer
+ : public port_traits<mechanism, ports::consumer, concepts::consumer>
 {};
 
 }
 
-DATAFLOW_FILTER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
     boost::is_base_of<vtkActor BOOST_PP_COMMA() T>,
- vtk::vtk_actor_filter)
+ vtk::vtk_actor_producer)
+
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
+ boost::is_base_of<vtkActor BOOST_PP_COMMA() T>,
+ vtk::vtk_actor_consumer)
     
 //]
 
@@ -154,9 +165,9 @@
 namespace vtk {
 
 struct vtk_mapper_producer
- : public producer_category<concepts::producer> {};
+ : public port_traits<mechanism, ports::producer, concepts::producer> {};
 
-struct vtk_mapper_proxy : public producer<mechanism, vtk_mapper_producer>
+struct vtk_mapper_proxy : public port<vtk_mapper_producer>
 {
     vtkMapper *ptr;
     vtk_mapper_proxy(vtkMapper *mapper) : ptr(mapper) {}
@@ -165,29 +176,31 @@
 
 typedef boost::fusion::map<
             boost::fusion::pair<vtk::vtk_algorithm_consumer, vtkAlgorithmOutput &>,
- boost::fusion::pair<vtk::vtk_actor_filter, vtk_mapper_proxy>
+ boost::fusion::pair<vtk::vtk_actor_consumer, vtk_mapper_proxy>
> vtk_mapper_map;
 
 struct vtk_mapper_proxy_producer
- : public proxy_producer_category<
- producer_map<vtk_mapper_map>
+ : public proxy_port_traits<
+ //ports::producer,
+ port_map<mechanism, ports::producer, vtk_mapper_map>
> {};
     
 }
 
-DATAFLOW_PROXY_PRODUCER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PROXY_PORT_CATEGORY_ENABLE_IF(vtk::mechanism, ports::producer,
+ T,
     boost::is_base_of<vtkMapper BOOST_PP_COMMA() T>,
     vtk::vtk_mapper_proxy_producer)
 
 namespace extension {
 
     template<>
- struct get_proxied_producer_impl<vtk::mechanism, vtk::vtk_mapper_proxy_producer>
+ struct get_proxied_port_impl<vtk::mechanism, ports::producer, vtk::vtk_mapper_proxy_producer>
     {
         template<typename ProxyProducer>
         struct apply
         {
- typedef const producer_map<vtk::vtk_mapper_map> type;
+ typedef const port_map<vtk::mechanism, ports::producer, vtk::vtk_mapper_map> type;
             
             static type call(ProxyProducer &t)
             {
@@ -199,7 +212,7 @@
     };
     
     template<>
- struct connect_only_impl<vtk::mechanism, vtk::vtk_mapper_producer, vtk::vtk_actor_filter>
+ struct binary_impl<vtk::mechanism, operations::connect_only, vtk::vtk_mapper_producer, vtk::vtk_actor_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -212,7 +225,7 @@
     };
     
     template<>
- struct connect_impl<vtk::mechanism, vtk::vtk_mapper_producer, vtk::vtk_actor_filter>
+ struct binary_impl<vtk::mechanism, operations::connect, vtk::vtk_mapper_producer, vtk::vtk_actor_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -233,22 +246,33 @@
 
 namespace vtk {
 
-struct vtk_renderer_filter
- : public producer_category<concepts::producer>
- , public consumer_category<concepts::consumer>
+struct vtk_renderer_producer
+ : public port_traits<mechanism, ports::producer, concepts::producer>
+{};
+
+struct vtk_renderer_consumer
+ : public port_traits<mechanism, ports::consumer, concepts::consumer>
 {};
 
+
 struct vtk_rendererwindow_consumer
- : public consumer_category<concepts::consumer>
+ : public port_traits<mechanism, ports::consumer, concepts::consumer>
 {};
 
 }
 
-DATAFLOW_FILTER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
     boost::is_base_of<vtkRenderer BOOST_PP_COMMA() T>,
- vtk::vtk_renderer_filter)
+ vtk::vtk_renderer_producer)
 
-DATAFLOW_CONSUMER_CATEGORY_ENABLE_IF(vtk::mechanism, T,
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
+ boost::is_base_of<vtkRenderer BOOST_PP_COMMA() T>,
+ vtk::vtk_renderer_consumer)
+
+DATAFLOW_PORT_CATEGORY_ENABLE_IF(
+ T,
     boost::is_base_of<vtkRenderWindow BOOST_PP_COMMA() T>,
     vtk::vtk_rendererwindow_consumer)
 
@@ -257,7 +281,7 @@
 namespace extension {
 
     template<>
- struct connect_impl<vtk::mechanism, vtk::vtk_actor_filter, vtk::vtk_renderer_filter>
+ struct binary_impl<vtk::mechanism, operations::connect, vtk::vtk_actor_producer, vtk::vtk_renderer_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -270,7 +294,7 @@
     };
 
     template<>
- struct connect_impl<vtk::mechanism, vtk::vtk_renderer_filter, vtk::vtk_rendererwindow_consumer>
+ struct binary_impl<vtk::mechanism, operations::connect, vtk::vtk_renderer_producer, vtk::vtk_rendererwindow_consumer>
     {
         template<typename Producer, typename Consumer>
         struct apply
@@ -290,29 +314,29 @@
 namespace vtk {
 
 template<typename T>
-struct pointer_proxy_producer : public proxy_producer_category<T> {};
+struct pointer_proxy_port : public proxy_port_traits<T> {};
 
-template<typename T>
-struct pointer_proxy_consumer : public proxy_consumer_category<T> {};
+//template<typename T>
+//struct pointer_proxy_port : public proxy_port_traits<T> {};
 
 }
 
 template<typename T>
-struct proxy_producer_category_of<vtk::mechanism, T *>
+struct proxy_port_traits_of<vtk::mechanism, ports::producer, T *>
 {
- typedef vtk::pointer_proxy_producer<T> type;
+ typedef vtk::pointer_proxy_port<T> type;
 };
 
 template<typename T>
-struct proxy_consumer_category_of<vtk::mechanism, T *>
+struct proxy_port_traits_of<vtk::mechanism, ports::consumer, T *>
 {
- typedef vtk::pointer_proxy_consumer<T> type;
+ typedef vtk::pointer_proxy_port<T> type;
 };
 
 namespace extension {
 
     template<typename T>
- struct get_proxied_producer_impl<vtk::mechanism, vtk::pointer_proxy_producer<T> >
+ struct get_proxied_port_impl<vtk::mechanism, ports::producer, vtk::pointer_proxy_port<T> >
     {
         template<typename ProxyProducer>
         struct apply
@@ -327,7 +351,7 @@
     };
 
     template<typename T>
- struct get_proxied_consumer_impl<vtk::mechanism, vtk::pointer_proxy_consumer<T> >
+ struct get_proxied_port_impl<vtk::mechanism, ports::consumer, vtk::pointer_proxy_port<T> >
     {
         template<typename ProxyConsumer>
         struct apply

Added: sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/Jamfile.v2 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,20 @@
+# 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)
+
+#build-project signals ;
+
+import testing ;
+
+project dataflow/test
+ : requirements
+ <include>../../..
+ <include>$(BOOST_ROOT)
+ <define>BOOST_ALL_NO_LIB=1
+ ;
+
+#run test_result_of_defined.cpp ;
+run test_port.cpp ;
+run test_proxy_port.cpp ;
+

Added: sandbox/SOC/2007/signals/libs/dataflow/test/test_port.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_port.cpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 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)
+
+#include <boost/dataflow/support/port.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+
+namespace df = boost::dataflow;
+
+struct incomplete;
+struct empty {};
+
+struct my_mechanism;
+
+struct my_producer_traits
+ : public df::port_traits<
+ my_mechanism,
+ df::ports::producer,
+ df::concepts::producer>
+{};
+
+struct my_consumer_traits
+ : public df::port_traits<
+ my_mechanism,
+ df::ports::consumer,
+ df::concepts::consumer>
+{};
+
+struct my_producer : public df::port<my_producer_traits>
+{};
+
+struct my_consumer : public df::port<my_consumer_traits>
+{};
+
+int test_main(int, char* [])
+{
+ BOOST_CHECK(df::is_port_category<df::ports::producer>::value);
+ BOOST_CHECK(df::is_port_category<df::ports::consumer>::value);
+
+ BOOST_CHECK(!df::is_port_category<incomplete>::value);
+ BOOST_CHECK(!df::is_port_category<empty>::value);
+
+ BOOST_CHECK(df::is_port_traits<my_producer_traits>::value);
+ BOOST_CHECK(df::is_port_traits<my_consumer_traits>::value);
+
+ BOOST_CHECK(!df::is_port_traits<incomplete>::value);
+ BOOST_CHECK(!df::is_port_traits<empty>::value);
+
+ BOOST_CHECK(( df::is_port<my_mechanism, df::ports::producer, my_producer>::value ));
+ BOOST_CHECK(( df::is_port<my_mechanism, df::ports::consumer, my_consumer>::value ));
+
+ BOOST_CHECK(( !df::is_port<my_mechanism, df::ports::producer, incomplete>::value ));
+ BOOST_CHECK(( !df::is_port<my_mechanism, df::ports::producer, empty>::value ));
+
+ my_producer p;
+
+ BOOST_CHECK_EQUAL(&p, (&df::get_port<my_mechanism, df::ports::producer>(p) ));
+ BOOST_CHECK(( boost::is_same<df::get_port_result_type<my_mechanism, df::ports::producer, my_producer>::type, my_producer &>::value ));
+
+ const volatile my_producer cp(p);
+
+ BOOST_CHECK_EQUAL(&cp, (&df::get_port<my_mechanism, df::ports::producer>(cp)));
+ BOOST_CHECK(( boost::is_same<df::get_port_result_type<my_mechanism, df::ports::producer, const volatile my_producer>::type, const volatile my_producer &>::value ));
+
+ return 0;
+} // int test_main(int, char* [])

Added: sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_proxy_port.cpp 2007-10-15 12:40:19 EDT (Mon, 15 Oct 2007)
@@ -0,0 +1,104 @@
+// 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/support/proxy_port.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+
+namespace df = boost::dataflow;
+
+struct incomplete;
+struct empty {};
+
+struct my_mechanism;
+
+struct my_producer_traits
+ : public df::port_traits<
+ my_mechanism,
+ df::ports::producer,
+ df::concepts::producer>
+{};
+
+struct my_producer : public df::port<my_producer_traits>
+{};
+
+struct my_proxy_producer
+{
+public:
+ my_producer p;
+
+ template<typename Mechanism, typename PortCategory>
+ struct dataflow;
+};
+
+template<>
+struct my_proxy_producer::dataflow<my_mechanism, df::ports::producer>
+{
+ typedef df::default_proxy_port<
+ my_mechanism,
+ df::ports::producer,
+ my_producer> proxy_port_traits;
+
+ template<typename T>
+ static typename boost::dataflow::utility::copy_cv<my_producer, T>::type &
+ get_proxied_port(T &t)
+ {
+ return t.p;
+ };
+};
+
+struct my_proxy_proxy_producer
+{
+public:
+ my_proxy_producer proxy;
+
+ template<typename Mechanism, typename PortCategory>
+ struct dataflow;
+};
+
+template<>
+struct my_proxy_proxy_producer::dataflow<my_mechanism, df::ports::producer>
+{
+ typedef df::default_proxy_port<
+ my_mechanism,
+ df::ports::producer,
+ my_proxy_producer> proxy_port_traits;
+
+ template<typename T>
+ static typename boost::dataflow::utility::copy_cv<my_proxy_producer, T>::type &
+ get_proxied_port(T &t)
+ {
+ return t.proxy;
+ };
+};
+
+
+int test_main(int, char* [])
+{
+ BOOST_CHECK(( df::is_proxy_port_traits<
+ df::default_proxy_port<
+ my_mechanism,
+ df::ports::producer,
+ my_producer>
+ >::value ));
+
+ BOOST_CHECK(( df::is_proxy_port<my_mechanism, df::ports::producer, my_proxy_producer>::value ));
+
+ my_proxy_producer pp;
+ BOOST_CHECK_EQUAL(&pp.p, (&df::get_port<my_mechanism, df::ports::producer>(pp)));
+
+ const volatile my_proxy_producer cv_pp(pp);
+ BOOST_CHECK_EQUAL(&cv_pp.p, (&df::get_port<my_mechanism, df::ports::producer>(cv_pp)));
+
+ BOOST_CHECK(( df::is_proxy_port<my_mechanism, df::ports::producer, my_proxy_proxy_producer>::value ));
+
+ my_proxy_proxy_producer ppp;
+ BOOST_CHECK_EQUAL(&ppp.proxy.p, (&df::get_port<my_mechanism, df::ports::producer>(ppp)));
+
+ const volatile my_proxy_proxy_producer cv_ppp(ppp);
+ BOOST_CHECK_EQUAL(&cv_ppp.proxy.p, (&df::get_port<my_mechanism, df::ports::producer>(cv_ppp)));
+
+ return 0;
+} // int test_main(int, char* [])


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