Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64093 - in sandbox/SOC/2010/bit_masks: boost/integer/bitfield_tuple boost/integer/detail/bft lib/integer/test lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-07-17 09:30:40


Author: bbartman
Date: 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
New Revision: 64093
URL: http://svn.boost.org/trac/boost/changeset/64093

Log:
working on implementing custom fields and pointer fields into the bitfield_tuple
Added:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/custom.hpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/pointer.hpp | 18 ++++++++++++------
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/bft_element.hpp | 8 +++++++-
   sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 1 +
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/bitfield_tuple_test.cpp | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/custom_member_test.cpp | 12 ++++++++++++
   5 files changed, 33 insertions(+), 8 deletions(-)

Added: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/custom.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/custom.hpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -0,0 +1,31 @@
+// 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_MEMBER_FIELD_HPP
+#define BOOST_MEMBER_FIELD_HPP
+#include <cstddef>
+
+
+
+namespace boost {
+namespace bitfields {
+
+/** The custom name means that the type being passed in is going to use
+ * custom packing and unpacking measures to store and retrieve its data.
+ * The policy type will be documented else where so as to show how it works
+ * and what it can/should be used for.
+ */
+template <
+ typename ReturnType,
+ typename Name,
+ typename Mask,
+ typename Policy
+>
+struct custom;
+
+}} // end boost::bitfields
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/pointer.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/pointer.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/pointer.hpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -13,13 +13,19 @@
 namespace boost {
 namespace bitfields {
 
-/** The purpose of the member struct is to provide a simple way of passing
- * parameters into a bitfield_tuple or bit_mask_tuple. The use of this is
- * specifically to associate a group of parameters to gather within a type
- * and make it easier for the data structure to figure out what to do with
- * those parameter.
+/** ReturnType in this case is the type that is having a pointer made to it.
+ * so putting int* will make the structure return int** to you because
+ * that wound indecate pointer to a pointer.
+ * Name - same as member and flag.
+ * Mask - This is the mask that returns the pointer itself and tells
+ * the user which parts of the pointer are to be stored/retrieved for
+ * stroage.
  */
-template <typename ReturnType, typename Name, std::size_t FieldWidth = 2>
+template <
+ typename ReturnType,
+ typename Name,
+ typename Mask
+>
 struct pointer;
 
 }} // end boost::bitfields

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/bft_element.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/bft_element.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/bft_element.hpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -5,6 +5,8 @@
 
 #ifndef BOOST_BITFIELD_TUPLE_BFT_ELEMENT_HPP
 #define BOOST_BITFIELD_TUPLE_BFT_ELEMENT_HPP
+#include <boost/mpl/void.hpp>
+
 
 namespace boost { namespace detail {
 
@@ -14,7 +16,9 @@
 template < typename ReturnType,
             typename NameType,
             typename Offset,
- typename FieldWidth
+ typename FieldWidth,
+ typename Mask = mpl::void_,
+ typename Policy = mpl::void_
>
 struct bitfield_element {
     typedef ReturnType return_type;
@@ -22,6 +26,8 @@
     typedef Offset offset;
     typedef FieldWidth field_width;
     typedef bitfield_element<return_type, name_type, offset, field_width> type;
+ typedef Mask mask;
+ typedef Policy policy;
 };
 
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -52,6 +52,7 @@
         [ run bft_testing/make_bft_testing.cpp ]
         [ run bft_testing/boost_endian_integration_test.cpp ]
         [ run bft_testing/custom_member_test.cpp ]
+ [ run bft_testing/pointer_member_test.cpp ]
         [ run ppb_testing/pointer_plus_bits_test.cpp ]
 
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/bitfield_tuple_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/bitfield_tuple_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/bitfield_tuple_test.cpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -4,7 +4,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 #include <boost/integer/bitfield_tuple.hpp>
-#include "test_type_list.hpp"
+#include "../test_type_list.hpp"
 #include <boost/mpl/front.hpp>
 #include <boost/mpl/find_if.hpp>
 #include <boost/mpl/end.hpp>

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/custom_member_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/custom_member_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/custom_member_test.cpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -0,0 +1,12 @@
+// 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)
+
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+int main() {
+ return 0;
+}

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp 2010-07-17 09:30:39 EDT (Sat, 17 Jul 2010)
@@ -0,0 +1,11 @@
+// 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)
+
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/type_traits/is_same.hpp>
+int main() {
+ return 0;
+}


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