Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62455 - in sandbox/SOC/2010/bit_masks/boost/integer: . details
From: bbartmanboost_at_[hidden]
Date: 2010-06-05 14:42:54


Author: bbartman
Date: 2010-06-05 14:42:53 EDT (Sat, 05 Jun 2010)
New Revision: 62455
URL: http://svn.boost.org/trac/boost/changeset/62455

Log:
working on creating a sequence extention for bit_mask_group
Added:
   sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group_fwd.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp | 18 ++++++++++-----
   sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp | 48 ++++++++++++++++++++++++++++++++++++++++
   2 files changed, 60 insertions(+), 6 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group.hpp 2010-06-05 14:42:53 EDT (Sat, 05 Jun 2010)
@@ -9,6 +9,7 @@
 
 
 #include <boost/integer/compound_mask.hpp>
+#include <boost/integer/bit_mask_group_impl.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/mpl/map.hpp>
 #include <boost/mpl/insert.hpp>
@@ -21,6 +22,10 @@
 
 namespace boost {
 
+
+
+
+/** This is used for naming/tagging arguments within the bit_mask_group. */
 template <typename T, typename NameType>
 struct tagged {
     typedef NameType name;
@@ -28,6 +33,8 @@
     typedef tagged<NameType, T> type;
 };
 
+
+
 // TODO: move this into a sperate file
 namespace details {
 struct null_mask { };
@@ -50,8 +57,6 @@
     struct add {
         typedef bit_mask_group_impl_< NewT, type_vector, NamedTypeMap> type;
     };
-
-
 };
 
 /** Specialization for unused parameters.
@@ -107,6 +112,7 @@
 
 
 
+
 /** \name bit_mask_group
  * \brief This a psudo variadic class which uses default template parameters
  * and allows for both named and unnamed mask types to be stored within this
@@ -127,9 +133,9 @@
 struct bit_mask_group {
 
     /** This strange looking typedef is for adding all of the different mask
- * template parameters. This may one day be replaced by a macro for creating
- * psudo variadic behavior. (i.e. this will get more parameters via value
- * specific by another macro).
+ * template parameters. This may one day be replaced by a macro for
+ * creating psudo variadic behavior. (i.e. this will get more parameters
+ * via value specific by another macro).
      */
     typedef typename details::bit_mask_group_impl_<
         Mask0,
@@ -144,7 +150,7 @@
         template add<Mask6>::type::
         template add<Mask7>::type::
         template add<Mask8>::type::
- template add<Mask9>::type _impl_type;
+ template add<Mask9>::type _impl_type;
 
     typedef bit_mask_group<Mask0, Mask1, Mask2, Mask3, Mask4,
                            Mask5, Mask6, Mask7, Mask8, Mask9 > type;

Added: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask_group_fwd.hpp
==============================================================================

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_group_impl.hpp 2010-06-05 14:42:53 EDT (Sat, 05 Jun 2010)
@@ -0,0 +1,48 @@
+// Copyright 2010 Brian Bartman.
+// 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_BIT_MASK_GROUP_IMPL_HPP
+#define BOOST_BIT_MASK_GROUP_IMPL_HPP
+
+/** This is used for creating an extention into the boost fusion library for
+ * the bit_mask_group.
+ */
+namespace boost {
+namespace details {
+/** Sequence tag.
+ * This is used for the boost.fusion extention.
+ * Used for dispatching to function overloads.
+ * The only thing needed for this is the declaration but just in case I have
+ * provided an empty definition.
+ */
+struct bit_mask_group_tag { };
+
+}} // end boost::details
+
+
+
+/** Next step in sequence extention.
+ * Adding dispatch look up mechanism.
+ */
+#include <boost/fusion/support/tag_of_fwd.hpp>
+#include <boost/fusion/include/tag_of_fwd.hpp>
+
+namespace boost { namespace fusion { namespace traits {
+
+ template<>
+ template < typename Mask0, typename Mask1, typename Mask2, typename Mask3,
+ typename Mask4, typename Mask5, typename Mask6, typename Mask7,
+ typename Mask8,typename Mask9 >
+ struct tag_of< boost::bit_mask_group<Mask0, Mask1, Mask2, Mask3, Mask4,
+ Mask5, Mask6, Mask7, Mask8, Mask9 > >
+ {
+ typedef example::bit_mask_group_tag type;
+ };
+}}} // end boost::fusion::traits
+
+
+
+
+#endif


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