Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63050 - in sandbox/SOC/2010/bit_masks: boost/integer/details/bft/ext boost/integer/details/bft/ext/fusion lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-06-17 14:13:41


Author: bbartman
Date: 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
New Revision: 63050
URL: http://svn.boost.org/trac/boost/changeset/63050

Log:
completed the following fusion extensions is_sequence, at and category_of
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp | 10 +++++++---
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp | 8 ++++----
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/category_of_impl.hpp | 34 ++++++++++++++++++++++++++++++++++
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_sequence_impl.hpp | 23 +++++++++++++++++++++++
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_view_impl.hpp | 23 +++++++++++++++++++++++
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp | 32 ++++++++++++++++++++++++++++++++
   6 files changed, 123 insertions(+), 7 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -6,8 +6,15 @@
 
 #ifndef BOOST_BITFIELD_TUPLE_FUSION_INCLUDES_HPP
 #define BOOST_BITFIELD_TUPLE_FUSION_INCLUDES_HPP
+#include <boost/fusion/sequence/intrinsic.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/is_view.hpp>
+
 #include "tag_of.hpp"
 #include "bitfield_iterator.hpp"
+#include "fusion/is_sequence_impl.hpp"
+#include "fusion/is_view_impl.hpp"
+#include "fusion/category_of_impl.hpp"
 #include "fusion/at_impl.hpp"
 #include "fusion/end_impl.hpp"
 #include "fusion/size_impl.hpp"
@@ -15,9 +22,6 @@
 #include "fusion/has_key_impl.hpp"
 #include "fusion/value_at_impl.hpp"
 #include "fusion/begin_impl.hpp"
-#include "fusion/is_sequence_impl.hpp"
 #include "fusion/value_at_key_impl.hpp"
-#include "fusion/category_of_impl.hpp"
-#include "fusion/is_view_impl.hpp"
 #endif
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -5,10 +5,11 @@
 
 #ifndef BOOST_BITFIELD_TUPLE_FUSION_EXT_AT_IMPL_HPP
 #define BOOST_BITFIELD_TUPLE_FUSION_EXT_AT_IMPL_HPP
+#include <boost/mpl/at.hpp>
 
 namespace boost {
     
-struct bitfield_group_tag;
+struct bitfield_tuple_tag;
 
 namespace fusion { namespace extension {
 
@@ -16,18 +17,17 @@
 template <typename> struct at_impl;
 
 template <>
-struct at_impl< bitfield_group_tag > {
+struct at_impl< bitfield_tuple_tag > {
 
     template <typename BitfieldTuple, typename N>
     struct apply {
         typedef typename BitfieldTuple::
             template bit_ref<
- mpl::at<
+ typename mpl::at<
                     typename BitfieldTuple::members,
                     N
>::type
> type;
-
         // non-const at function.
         static type call(BitfieldTuple& bft) {
             return type( bft.data() );

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/category_of_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/category_of_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/category_of_impl.hpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -2,3 +2,37 @@
 // 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_BITFIELD_TUPLE_FUSION_EXT_CATEGORY_OF_HPP
+#define BOOST_BITFIELD_TUPLE_FUSION_EXT_CATEGORY_OF_HPP
+
+
+namespace boost {
+
+struct bitfield_tuple_tag;
+
+namespace fusion { namespace extension {
+
+/** The bft_category is composed of more then one category from the
+ * available fusion categories.
+ */
+struct bft_category
+ :fusion::random_access_traversal_tag,
+ fusion::associative_tag
+{ };
+
+
+template <typename>
+struct category_of_impl;
+
+template<>
+struct category_of_impl< bitfield_tuple_tag > {
+ template<typename T>
+ struct apply {
+ typedef bft_category type;
+ };
+};
+
+}}} // end boost::fusion::extension
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_sequence_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_sequence_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_sequence_impl.hpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -2,3 +2,26 @@
 // 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_BITFIELD_TUPLE_FUSION_EXT_IS_SEQUENCE_HPP
+#define BOOST_BITFIELD_TUPLE_FUSION_EXT_IS_SEQUENCE_HPP
+
+
+namespace boost {
+
+struct bitfield_tuple_tag;
+
+namespace fusion { namespace extension {
+
+template <typename>
+struct is_sequence_impl;
+
+template<>
+struct is_sequence_impl< bitfield_tuple_tag > {
+ template<typename T>
+ struct apply : mpl::true_ { };
+};
+
+}}} // end boost::fusion::extension
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_view_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_view_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/is_view_impl.hpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -2,3 +2,26 @@
 // 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_BITFIELD_TUPLE_FUSION_EXT_IS_VIEW_HPP
+#define BOOST_BITFIELD_TUPLE_FUSION_EXT_IS_VIEW_HPP
+
+
+namespace boost {
+
+struct bitfield_tuple_tag;
+
+namespace fusion { namespace extension {
+
+template <typename>
+struct is_view_impl;
+
+template<>
+struct is_view_impl< bitfield_tuple_tag > {
+ template<typename T>
+ struct apply : mpl::false_ { };
+};
+
+}}} // end boost::fusion::extension
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp 2010-06-17 14:13:40 EDT (Thu, 17 Jun 2010)
@@ -34,6 +34,37 @@
         BOOST_MPL_ASSERT(( is_same< tag, fusion::bitfield_tuple_tag> ));
     }
 
+ // at testing
+ {
+ test_tuple temp;
+ temp.get<green>() =3 ;
+ BOOST_ASSERT((fusion::at_c<1>(temp) == 3));
+ }
+
+ // is_sequence testing
+ {
+ BOOST_ASSERT(( fusion::traits::is_sequence<test_tuple>() ));
+ }
+
+ // is_view testing
+ {
+ BOOST_ASSERT(( !fusion::traits::is_view<test_tuple>() ));
+ }
+
+ // category_of testing
+ {
+ // using fusion;
+ // using extension;
+ BOOST_MPL_ASSERT((
+ is_same<
+ fusion::traits::category_of<
+ test_tuple
+ >::type,
+ fusion::extension::bft_category
+ >
+ ));
+ }
+
     /*
     bmg_t bmg;
 
@@ -56,3 +87,4 @@
 }
 
 
+


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