Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48761 - in sandbox/dataflow-rewrite: boost/dataflow/generic boost/dataflow/generic/framework_entity libs/dataflow/build/xcodeide/dataflow.xcodeproj libs/dataflow/test/generic
From: stipe_at_[hidden]
Date: 2008-09-12 18:32:25


Author: srajko
Date: 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
New Revision: 48761
URL: http://svn.boost.org/trac/boost/changeset/48761

Log:
renamed / moved things to default_framework_of / traits_of
Added:
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework_of.hpp (contents, props changed)
      - copied, changed from r48760, /sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits_of.hpp (contents, props changed)
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework_of.cpp (contents, props changed)
      - copied, changed from r48760, /sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits_of.cpp (contents, props changed)
Removed:
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp
Text files modified:
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity.hpp | 4
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework_of.hpp | 11 +++-
   sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits.hpp | 99 ---------------------------------------
   sandbox/dataflow-rewrite/libs/dataflow/build/xcodeide/dataflow.xcodeproj/project.pbxproj | 12 +++-
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/Jamfile | 4
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework_of.cpp | 3
   sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits.cpp | 7 ++
   7 files changed, 28 insertions(+), 112 deletions(-)

Modified: sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity.hpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -10,8 +10,9 @@
 #define BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY_HPP
 
 
-#include <boost/dataflow/generic/framework_entity/default_framework.hpp>
+#include <boost/dataflow/generic/framework_entity/default_framework_of.hpp>
 #include <boost/dataflow/generic/framework_entity/traits.hpp>
+#include <boost/dataflow/generic/framework_entity/traits_of.hpp>
 #include <boost/dataflow/utility/enable_if_type.hpp>
 
 #include <boost/mpl/bool.hpp>

Deleted: sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
+++ (empty file)
@@ -1,92 +0,0 @@
-/*=================================---------------------------------------------
- Copyright 2007,2008 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__GENERIC__FRAMEWORK_ENTITY__DEFAULT_FRAMEWORK_HPP
-#define BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__DEFAULT_FRAMEWORK_HPP
-
-
-#include <boost/dataflow/generic/framework_entity/traits.hpp>
-
-
-namespace boost { namespace dataflow {
-
-/// Metafunction returing the default framework for a type.
-template<typename Entity, typename Enable=void>
-struct default_framework_of
-{
- /// The Framework of the port.
- typedef default_framework type;
-};
-
-
-/// INTERNAL ONLY
-template<typename Entity>
-struct default_framework_of<Entity,
- typename enable_if<
- mpl::not_<mpl::is_sequence<typename Entity::dataflow_traits> >
- >::type>
-{
- /// INTERNAL ONLY
- BOOST_MPL_ASSERT(( is_traits<typename Entity::dataflow_traits> ));
- /// INTERNAL ONLY
- typedef typename Entity::dataflow_traits::framework type;
-};
-
-/// Allows registration of the default framework for all cv-qualified versions of a type.
-template<typename Entity, typename Enable=void>
-struct register_default_framework
-{};
-
-/// INTERNAL ONLY
-template<typename Entity>
-struct default_framework_of<
- Entity,
- typename utility::enable_if_type<
- typename register_default_framework<
- typename remove_cv<Entity>::type
- >::type
- >::type
->
-{
- /// INTERNAL ONLY
- typedef
- typename register_default_framework<
- typename remove_cv<Entity>::type
- >::type type;
-};
-
-} } // namespace boost::dataflow
-
-/// Macro simplifying non-intrusive specification of a type's Traits.
-#define BOOST_DATAFLOW_DEFAULT_FRAMEWORK(Type,Framework) \
-namespace boost { namespace dataflow { \
-template<> \
-struct register_default_framework< \
- Type \
- > \
-{ \
- typedef Framework type; \
- BOOST_MPL_ASSERT(( is_framework<type> )); \
-}; \
-}}
-
-/// Macro simplifying non-intrusive specification of multiple types'
-/// Traits, using a boost::enable_if condition.
-#define BOOST_DATAFLOW_DEFAULT_FRAMEWORK_ENABLE_IF(Type,Cond,Framework) \
-namespace boost { namespace dataflow { \
-template<typename Type> \
-struct register_default_framework< \
- Type, \
- typename boost::enable_if< Cond >::type> \
-{ \
- typedef Framework type; \
- BOOST_MPL_ASSERT(( is_framework<Framework> )); \
-}; \
-}}
-
-#endif // BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__DEFAULT_FRAMEWORK_HPP

Copied: sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework_of.hpp (from r48760, /sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp)
==============================================================================
--- /sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/default_framework_of.hpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -10,7 +10,14 @@
 #define BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__DEFAULT_FRAMEWORK_HPP
 
 
-#include <boost/dataflow/generic/framework_entity/traits.hpp>
+#include <boost/dataflow/generic/framework.hpp>
+#include <boost/dataflow/utility/enable_if_type.hpp>
+
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/utility/enable_if.hpp>
 
 
 namespace boost { namespace dataflow {
@@ -32,8 +39,6 @@
>::type>
 {
     /// INTERNAL ONLY
- BOOST_MPL_ASSERT(( is_traits<typename Entity::dataflow_traits> ));
- /// INTERNAL ONLY
     typedef typename Entity::dataflow_traits::framework type;
 };
 

Modified: sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits.hpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -15,10 +15,6 @@
 
 #include <boost/mpl/assert.hpp>
 #include <boost/mpl/bool.hpp>
-#include <boost/mpl/is_sequence.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_cv.hpp>
 #include <boost/utility/enable_if.hpp>
 
 namespace boost { namespace dataflow {
@@ -60,99 +56,6 @@
     BOOST_MPL_ASSERT(( is_framework<typename Traits::framework> ));
 };
 
-/// Metafunction returning the Traits of a type.
-template<typename T, typename Framework=default_framework, typename Enable=void>
-struct traits_of
-{
-#ifdef DOXYGEN_DOCS_BUILD
- typedef detail::unspecified type; ///< Traits type.
-#endif
-};
-
-/// INTERNAL ONLY
-/** Specialization allowing intrusive specification of the Traits.
-*/
-template<typename T>
-struct traits_of<
- T,
- typename T::dataflow_traits::framework,
- typename enable_if<
- mpl::not_<mpl::is_sequence<typename T::dataflow_traits> >
- >::type
->
-{
- /// INTERNAL ONLY
- typedef typename T::dataflow_traits type;
- /// INTERNAL ONLY
- BOOST_MPL_ASSERT(( is_traits<type> ));
-};
-
-} }
-
-// Specialization allowing intrusive specification of a sequence of Traits.
-#include <boost/dataflow/generic/framework_entity/traits_sequence_intrusive_registration.hpp>
-
-namespace boost { namespace dataflow {
-
-/// Allows registration of Traits for all cv-qualified versions of a type.
-template<typename T, typename Framework=default_framework, typename Enable=void>
-struct register_traits
-{};
-
-
-// Specialization allowing non-intrusive specification of the Traits.
-
-/// INTERNAL ONLY
-template<typename T, typename Framework>
-struct traits_of<
- T,
- Framework,
- typename utility::enable_if_type<
- typename register_traits<
- typename remove_cv<T>::type,
- Framework
- >::type
- >::type
->
-{
- /// INTERNAL ONLY
- typedef
- typename register_traits<
- typename remove_cv<T>::type,
- Framework
- >::type type;
- /// INTERNAL ONLY
- BOOST_MPL_ASSERT(( is_traits<type> ));
-};
-
-} } // namespace boost::dataflow
-
-/// Macro simplifying non-intrusive specification of a type's Traits.
-#define BOOST_DATAFLOW_TRAITS(Type,Traits) \
-namespace boost { namespace dataflow { \
-template<> \
-struct register_traits< \
- Type, \
- Traits::framework> \
-{ \
- typedef Traits type; \
- BOOST_MPL_ASSERT(( is_traits<type> )); \
-}; \
-}}
-
-/// Macro simplifying non-intrusive specification of multiple types'
-/// Traits, using a boost::enable_if condition.
-#define BOOST_DATAFLOW_TRAITS_ENABLE_IF(Type,Cond,Traits) \
-namespace boost { namespace dataflow { \
-template<typename Type> \
-struct register_traits< \
- Type, \
- typename Traits::framework, \
- typename boost::enable_if< Cond >::type> \
-{ \
- typedef Traits type; \
- BOOST_MPL_ASSERT(( is_traits<type> )); \
-}; \
 }}
 
-#endif // BOOST__DATAFLOW__GENERIC__TRAITS_HPP
+#endif // BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__TRAITS_HPP

Added: sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits_of.hpp
==============================================================================
--- (empty file)
+++ sandbox/dataflow-rewrite/boost/dataflow/generic/framework_entity/traits_of.hpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -0,0 +1,122 @@
+/*=================================---------------------------------------------
+ Copyright 2007,2008 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__GENERIC__FRAMEWORK_ENTITY__TRAITS_OF_HPP
+#define BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__TRAITS_OF_HPP
+
+
+#include <boost/dataflow/generic/framework_entity/traits.hpp>
+#include <boost/dataflow/generic/framework_entity/default_framework_of.hpp>
+#include <boost/dataflow/utility/enable_if_type.hpp>
+
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/utility/enable_if.hpp>
+
+namespace boost { namespace dataflow {
+
+/// Metafunction returning the Traits of a type.
+template<typename T, typename Framework=typename default_framework_of<T>::type, typename Enable=void>
+struct traits_of
+{
+#ifdef DOXYGEN_DOCS_BUILD
+ typedef detail::unspecified type; ///< Traits type.
+#endif
+};
+
+/// INTERNAL ONLY
+/** Specialization allowing intrusive specification of the Traits.
+*/
+template<typename T>
+struct traits_of<
+ T,
+ typename T::dataflow_traits::framework,
+ typename enable_if<
+ mpl::not_<mpl::is_sequence<typename T::dataflow_traits> >
+ >::type
+>
+{
+ /// INTERNAL ONLY
+ typedef typename T::dataflow_traits type;
+ /// INTERNAL ONLY
+ BOOST_MPL_ASSERT(( is_traits<type> ));
+};
+
+} }
+
+// Specialization allowing intrusive specification of a sequence of Traits.
+#include <boost/dataflow/generic/framework_entity/traits_sequence_intrusive_registration.hpp>
+
+namespace boost { namespace dataflow {
+
+/// Allows registration of Traits for all cv-qualified versions of a type.
+template<typename T, typename Framework=default_framework, typename Enable=void>
+struct register_traits
+{};
+
+
+// Specialization allowing non-intrusive specification of the Traits.
+
+/// INTERNAL ONLY
+template<typename T, typename Framework>
+struct traits_of<
+ T,
+ Framework,
+ typename utility::enable_if_type<
+ typename register_traits<
+ typename remove_cv<T>::type,
+ Framework
+ >::type
+ >::type
+>
+{
+ /// INTERNAL ONLY
+ typedef
+ typename register_traits<
+ typename remove_cv<T>::type,
+ Framework
+ >::type type;
+ /// INTERNAL ONLY
+ BOOST_MPL_ASSERT(( is_traits<type> ));
+};
+
+} } // namespace boost::dataflow
+
+/// Macro simplifying non-intrusive specification of a type's Traits.
+#define BOOST_DATAFLOW_TRAITS(Type,Traits) \
+namespace boost { namespace dataflow { \
+template<> \
+struct register_traits< \
+ Type, \
+ Traits::framework> \
+{ \
+ typedef Traits type; \
+ BOOST_MPL_ASSERT(( is_traits<type> )); \
+}; \
+}}
+
+/// Macro simplifying non-intrusive specification of multiple types'
+/// Traits, using a boost::enable_if condition.
+#define BOOST_DATAFLOW_TRAITS_ENABLE_IF(Type,Cond,Traits) \
+namespace boost { namespace dataflow { \
+template<typename Type> \
+struct register_traits< \
+ Type, \
+ typename Traits::framework, \
+ typename boost::enable_if< Cond >::type> \
+{ \
+ typedef Traits type; \
+ BOOST_MPL_ASSERT(( is_traits<type> )); \
+}; \
+}}
+
+#endif // BOOST__DATAFLOW__GENERIC__FRAMEWORK_ENTITY__TRAITS_OF_HPP

Modified: sandbox/dataflow-rewrite/libs/dataflow/build/xcodeide/dataflow.xcodeproj/project.pbxproj
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/build/xcodeide/dataflow.xcodeproj/project.pbxproj (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/build/xcodeide/dataflow.xcodeproj/project.pbxproj 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -76,7 +76,6 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXFileReference section */
- 08058A0F0E7B0D4600926321 /* default_framework.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = default_framework.hpp; sourceTree = "<group>"; };
                 08A77AB30E4F91AA00B8793E /* Jamroot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Jamroot; path = ../../../../Jamroot; sourceTree = SOURCE_ROOT; };
                 08A77AB40E4F91AB00B8793E /* LICENSE_1_0.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE_1_0.txt; path = ../../../../LICENSE_1_0.txt; sourceTree = SOURCE_ROOT; };
                 08A77ADC0E4FB06600B8793E /* framework.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = framework.hpp; sourceTree = "<group>"; };
@@ -90,7 +89,10 @@
                 08B8F1BE0E512E72000545B8 /* traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = traits.hpp; sourceTree = "<group>"; };
                 08B8F1C00E512F45000545B8 /* test_framework_entity_traits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_framework_entity_traits.cpp; sourceTree = "<group>"; };
                 08B8F1D00E513569000545B8 /* test_framework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_framework.cpp; sourceTree = "<group>"; };
- 08DD9D3E0E7B12CE008DC46A /* test_default_framework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_default_framework.cpp; sourceTree = "<group>"; };
+ 08DD9DF90E7B22CA008DC46A /* default_framework_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = default_framework_of.hpp; sourceTree = "<group>"; };
+ 08DD9DFA0E7B22DD008DC46A /* test_default_framework_of.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_default_framework_of.cpp; sourceTree = "<group>"; };
+ 08DD9DFB0E7B22EF008DC46A /* traits_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = traits_of.hpp; sourceTree = "<group>"; };
+ 08DD9E020E7B23AA008DC46A /* test_framework_entity_traits_of.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_framework_entity_traits_of.cpp; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXGroup section */
@@ -156,10 +158,11 @@
                         isa = PBXGroup;
                         children = (
                                 08A77B060E4FC58D00B8793E /* Jamfile */,
+ 08DD9DFA0E7B22DD008DC46A /* test_default_framework_of.cpp */,
                                 08B8F1D00E513569000545B8 /* test_framework.cpp */,
                                 08B8F1B60E512DA3000545B8 /* test_framework_entity.cpp */,
                                 08B8F1C00E512F45000545B8 /* test_framework_entity_traits.cpp */,
- 08DD9D3E0E7B12CE008DC46A /* test_default_framework.cpp */,
+ 08DD9E020E7B23AA008DC46A /* test_framework_entity_traits_of.cpp */,
                         );
                         path = generic;
                         sourceTree = "<group>";
@@ -167,9 +170,10 @@
                 08B8F1AB0E512CF7000545B8 /* framework_entity */ = {
                         isa = PBXGroup;
                         children = (
+ 08DD9DF90E7B22CA008DC46A /* default_framework_of.hpp */,
                                 08B8F1BE0E512E72000545B8 /* traits.hpp */,
                                 08B8F1AC0E512CF7000545B8 /* traits_sequence_intrusive_registration.hpp */,
- 08058A0F0E7B0D4600926321 /* default_framework.hpp */,
+ 08DD9DFB0E7B22EF008DC46A /* traits_of.hpp */,
                         );
                         path = framework_entity;
                         sourceTree = "<group>";

Modified: sandbox/dataflow-rewrite/libs/dataflow/test/generic/Jamfile
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/test/generic/Jamfile (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/test/generic/Jamfile 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -10,4 +10,5 @@
 run test_framework.cpp ;
 run test_framework_entity.cpp ;
 run test_framework_entity_traits.cpp ;
-run test_default_framework.cpp ;
+run test_framework_entity_traits_of.cpp ;
+run test_default_framework_of.cpp ;

Deleted: sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
+++ (empty file)
@@ -1,77 +0,0 @@
-/*=================================---------------------------------------------
- Copyright 2007,2008 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)
------------------------------------------------===============================*/
-
-
-#include <boost/dataflow/generic/framework_entity/default_framework.hpp>
-
-#include <boost/preprocessor/comma.hpp>
-
-#define BOOST_TEST_MAIN
-#include <boost/test/unit_test.hpp>
-
-
-namespace df = boost::dataflow;
-
-struct my_framework : public df::framework
-{};
-
-struct no_traits
-{};
-
-typedef df::traits<df::default_framework> default_traits;
-typedef df::traits<my_framework> my_traits;
-
-struct default_entity_intrusive
-{
- typedef default_traits dataflow_traits;
-};
-
-struct my_entity_intrusive
-{
- typedef my_traits dataflow_traits;
-};
-
-struct my_entity_nonintrusive
-{
-};
-
-BOOST_DATAFLOW_DEFAULT_FRAMEWORK(my_entity_nonintrusive, my_framework)
-
-struct my_entity_nonintrusive_enabled
-{
-};
-
-BOOST_DATAFLOW_DEFAULT_FRAMEWORK_ENABLE_IF(
- T,
- is_same<T BOOST_PP_COMMA() my_entity_nonintrusive_enabled>,
- my_framework)
-
-
-BOOST_AUTO_TEST_CASE( test )
-{
- BOOST_CHECK((boost::is_same<
- df::default_framework_of<no_traits>::type,
- df::default_framework>::value
- ));
- BOOST_CHECK((boost::is_same<
- df::default_framework_of<default_entity_intrusive>::type,
- df::default_framework>::value
- ));
- BOOST_CHECK((boost::is_same<
- df::default_framework_of<my_entity_intrusive>::type,
- my_framework>::value
- ));
- BOOST_CHECK((boost::is_same<
- df::default_framework_of<my_entity_nonintrusive>::type,
- my_framework>::value
- ));
- BOOST_CHECK((boost::is_same<
- df::default_framework_of<my_entity_nonintrusive_enabled>::type,
- my_framework>::value
- ));
-}

Copied: sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework_of.cpp (from r48760, /sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp)
==============================================================================
--- /sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework.cpp (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_default_framework_of.cpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -7,7 +7,8 @@
 -----------------------------------------------===============================*/
 
 
-#include <boost/dataflow/generic/framework_entity/default_framework.hpp>
+#include <boost/dataflow/generic/framework_entity/default_framework_of.hpp>
+#include <boost/dataflow/generic/framework_entity/traits.hpp>
 
 #include <boost/preprocessor/comma.hpp>
 

Modified: sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits.cpp
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits.cpp (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits.cpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -15,9 +15,12 @@
 
 namespace df = boost::dataflow;
 
-typedef df::traits<df::default_framework> my_traits;
+typedef df::traits<df::default_framework> default_traits;
+
+struct not_traits {};
 
 BOOST_AUTO_TEST_CASE( test )
 {
- BOOST_CHECK(df::is_traits<my_traits>::value);
+ BOOST_CHECK(df::is_traits<default_traits>::value);
+ BOOST_CHECK(!df::is_traits<not_traits>::value);
 }

Added: sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits_of.cpp
==============================================================================
--- (empty file)
+++ sandbox/dataflow-rewrite/libs/dataflow/test/generic/test_framework_entity_traits_of.cpp 2008-09-12 18:32:23 EDT (Fri, 12 Sep 2008)
@@ -0,0 +1,75 @@
+/*=================================---------------------------------------------
+ Copyright 2007,2008 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)
+-----------------------------------------------===============================*/
+
+
+#include <boost/dataflow/generic/framework_entity/traits_of.hpp>
+
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp>
+
+
+namespace df = boost::dataflow;
+
+struct my_framework : public df::framework
+{};
+
+typedef df::traits<df::default_framework> default_traits;
+typedef df::traits<my_framework> my_traits;
+
+struct default_entity_intrusive
+{
+ typedef default_traits dataflow_traits;
+};
+
+struct my_entity_intrusive
+{
+ typedef my_traits dataflow_traits;
+};
+
+struct my_entity_nonintrusive
+{
+};
+
+BOOST_DATAFLOW_TRAITS(my_entity_nonintrusive, my_traits)
+
+struct my_entity_nonintrusive_enabled
+{
+};
+
+BOOST_DATAFLOW_TRAITS_ENABLE_IF(
+ T,
+ is_same<T BOOST_PP_COMMA() my_entity_nonintrusive_enabled>,
+ my_traits)
+
+
+BOOST_AUTO_TEST_CASE( test )
+{
+ // specifying framework explicitly
+ BOOST_CHECK((boost::is_same<
+ df::traits_of<default_entity_intrusive, df::default_framework>::type,
+ default_traits>::value
+ ));
+ BOOST_CHECK((boost::is_same<
+ df::traits_of<my_entity_intrusive, my_framework>::type,
+ my_traits>::value
+ ));
+ BOOST_CHECK((boost::is_same<
+ df::traits_of<my_entity_nonintrusive, my_framework>::type,
+ my_traits>::value
+ ));
+ BOOST_CHECK((boost::is_same<
+ df::traits_of<my_entity_nonintrusive_enabled, my_framework>::type,
+ my_traits>::value
+ ));
+
+ // default framework deduction
+ BOOST_CHECK((boost::is_same<
+ df::traits_of<my_entity_intrusive>::type,
+ my_traits>::value
+ ));
+}


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