Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64121 - in sandbox/SOC/2010/bit_masks: boost/integer/bitfield_tuple boost/integer/detail/bft lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-07-18 08:23:51


Author: bbartman
Date: 2010-07-18 08:23:49 EDT (Sun, 18 Jul 2010)
New Revision: 64121
URL: http://svn.boost.org/trac/boost/changeset/64121

Log:
working on testing and implementing the pointer member parsing
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple/pointer.hpp | 9 +++++++--
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_parsing_meta_functions.hpp | 11 +++++++++++
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp | 8 ++++++++
   3 files changed, 26 insertions(+), 2 deletions(-)

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-18 08:23:49 EDT (Sun, 18 Jul 2010)
@@ -7,7 +7,9 @@
 #ifndef BOOST_POINTER_MEMBER_FIELD_HPP
 #define BOOST_POINTER_MEMBER_FIELD_HPP
 #include <cstddef>
-
+#include <boost/integer/detail/bft/pointer_parsing_meta_functions.hpp>
+#include <boost/integer/high_bits_mask.hpp>
+#include <boost/integer/bit_width.hpp>
 
 
 namespace boost {
@@ -24,7 +26,10 @@
 template <
     typename ReturnType,
     typename Name,
- typename Mask
+ typename Mask = high_bits_mask<
+ typename ::boost::detail::pointer_member::get_mask_type<ReturnType>::type,
+ bit_width< typename ::boost::detail::pointer_member::get_mask_type<ReturnType>::type >::value - 2
+ >
>
 struct pointer;
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_parsing_meta_functions.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_parsing_meta_functions.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_parsing_meta_functions.hpp 2010-07-18 08:23:49 EDT (Sun, 18 Jul 2010)
@@ -7,16 +7,27 @@
 #ifndef BOOST_BITFIELD_TUPLE_POINTER_PARSING_HELPERS_HPP
 #define BOOST_BITFIELD_TUPLE_POINTER_PARSING_HELPERS_HPP
 
+#include <boost/cstdint.hpp>
 #include <boost/integer/bits_mask.hpp>
 #include <cstddef>
 #include <boost/mpl/size_t.hpp>
 #include <boost/type_traits/make_unsigned.hpp>
+#include <boost/mpl/if.hpp>
 
 /** This file contains metafunctions which are used to do complex operations
  * on the Mask provided by the user.
  */
 namespace boost { namespace detail { namespace pointer_member {
 
+template <typename T>
+struct get_mask_type {
+ typedef typename mpl::if_c<
+ bit_width<std::size_t>::value < bit_width<T*>::value,
+ uint64_t,
+ uint32_t
+ >::type type;
+};
+
 
 
 // this is ugly but I would like it for organizational purposes.

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/pointer_member_test.cpp 2010-07-18 08:23:49 EDT (Sun, 18 Jul 2010)
@@ -6,6 +6,14 @@
 #include <boost/integer/bitfield_tuple.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/type_traits/is_same.hpp>
+using namespace boost;
+using namespace boost::bitfields;
+struct rd;
+
+typedef bitfield_tuple<pointer<int, rd> > test_type;
+
 int main() {
+ test_type t;
+
     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