Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64795 - in sandbox/SOC/2010/bit_masks: boost/integer boost/integer/detail/bitfield_vector lib/integer/test lib/integer/test/bitfield_vector_testing
From: bbartmanboost_at_[hidden]
Date: 2010-08-14 08:07:04


Author: bbartman
Date: 2010-08-14 08:07:02 EDT (Sat, 14 Aug 2010)
New Revision: 64795
URL: http://svn.boost.org/trac/boost/changeset/64795

Log:
creating a header file + test suite for the bitfield_iterator's base class
Added:
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/iterator_base.hpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/iterator_base_test.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp | 4 ++--
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp | 19 +++----------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 1 +
   3 files changed, 6 insertions(+), 18 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp 2010-08-14 08:07:02 EDT (Sat, 14 Aug 2010)
@@ -6,9 +6,9 @@
 #ifndef BOOST_BITFIELD_VECTOR_HPP
 #define BOOST_BITFIELD_VECTOR_HPP
 #include <memory>
-#include <boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp>
 #include <boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp>
-#include <cstring>
+#include <boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp>
+#include <boost/integer/detail/bitfield_vector/iterator_base.hpp>
 
 namespace boost {
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp 2010-08-14 08:07:02 EDT (Sat, 14 Aug 2010)
@@ -17,20 +17,9 @@
 #include <cstring>
 #include <boost/integer/high_low_bits.hpp>
 #include <boost/integer/bit_width.hpp>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <bitset>
 
-namespace boost { namespace detail {
 
-template <typename T>
-std::string to_binary_2(T x) {
- std::stringstream ss(std::stringstream::in|std::stringstream::out);
- ss << std::setfill('0') << std::setw(boost::bit_width<T>::value)
- << std::bitset< boost::bit_width<T>::value >(x).to_string();
- return std::string(ss.str());
-}
+namespace boost { namespace detail {
 
 template <std::size_t Width, bool = bool((Width%8) > 0)>
 struct next_allocation_size;
@@ -210,14 +199,12 @@
 
     /** value_type storage assignement operator.*/
     _self& operator=(value_type x) {
- std::cout << "called assignment operator" << std::endl;
- //std::cout << "x initial value: " << to_binary_2(x) <<std::endl;
+
         unsigned_value_type x_adjusted = ((unsigned_value_type(x & sign_bit) >>
                 (bit_width<value_type>::value - width))
             |
         (low_bits_mask<value_type, std::size_t(width-1)>::value & x) );
- //std::cout << "x new value: " << to_binary_2(x_new) <<std::endl;
-
+
         if(_mask._size == 1) {
             storage_t previous_values = *_ptr & ~_mask._first_byte;
             storage_t new_value = low_bits_mask<value_type, width>::value &

Added: sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/iterator_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/iterator_base.hpp 2010-08-14 08:07:02 EDT (Sat, 14 Aug 2010)
@@ -0,0 +1,20 @@
+// 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_BITFIELD_ITERATOR_BASE_HPP
+#define BOOST_BITFIELD_ITERATOR_BASE_HPP
+#include "bitfield_vector_member_impl.hpp"
+#include <cstddef>
+
+namespace boost { namespace detail {
+
+template <typename T, std::size_t Width>
+struct bitfield_vector_iterator_base {
+};
+
+}} // end boost::detail
+
+
+#endif

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-08-14 08:07:02 EDT (Sat, 14 Aug 2010)
@@ -77,5 +77,6 @@
         [ run bitfield_vector_testing/proxy_reference_test.cpp ]
         [ run bitfield_vector_testing/member_impl_test.cpp ]
         [ run bitfield_vector_testing/mask_creator_test.cpp ]
+ [ run bitfield_vector_testing/iterator_base_test.cpp ]
     ;
 

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/iterator_base_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/iterator_base_test.cpp 2010-08-14 08:07:02 EDT (Sat, 14 Aug 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_vector.hpp>
+#include "test_utility.hpp"
+
+int main() {
+ return boost::report_errors();
+}


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