Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62442 - in sandbox/SOC/2010/bit_masks/boost/integer: . details
From: bbartmanboost_at_[hidden]
Date: 2010-06-05 10:12:38


Author: bbartman
Date: 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
New Revision: 62442
URL: http://svn.boost.org/trac/boost/changeset/62442

Log:
removing header file
Removed:
   sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp | 55 ++++++++++++++++++++++++++++++++++++++++
   sandbox/SOC/2010/bit_masks/boost/integer/compound_mask.hpp | 2
   sandbox/SOC/2010/bit_masks/boost/integer/details/high_low_impl.hpp | 5 ++
   sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp | 33 ++++++++++++++++++++++++
   sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp | 4 ++
   sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp | 32 +++++++++++++++++++++++
   6 files changed, 128 insertions(+), 3 deletions(-)

Deleted: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
+++ (empty file)
@@ -1,55 +0,0 @@
-// (C) Copyright Brian Bartman 2010.
-// 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)
-// See http://www.boost.org for updates, documentation, and revision history.
-
-#ifndef BOOST_INTEGER_BIT_MASK_HPP
-#define BOOST_INTEGER_BIT_MASK_HPP
-
-#include <boost/integer/high_low_bits.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/integer/bit_width.hpp>
-
-
-namespace boost {
-
-
-/** bit_mask.
- * Mask which creates a mask give type, offset and width of the mask.
- * Preconditions for bit_mask
- * Pre-Conditions
- *
- * 1. The width of the masked section must not be longer then the
- * mask itself.
- *
- * 2. Valid range for mask width is > 0.
- *
- * 3. The type which is being masked must satisfy the is_integral type trait.
- * NOTE: This is documented but not enforeced.
- *
- */
-template <typename T, unsigned int Offset, unsigned int Width = 1 >
-struct bit_mask
- :integral_mask<T, (low_bits<T,Width>::value << Offset) >
-{
- // precondition 1.
- BOOST_STATIC_ASSERT(( (Offset + Width) < ( bit_width<T>::value - 1) ));
-
- // precondition 2.
- BOOST_STATIC_ASSERT(( Width > 0 ));
-
- typedef bit_mask<T, Offset, Width> type;
-
- BOOST_STATIC_CONSTANT(unsigned int, offset = Offset);
-
- BOOST_STATIC_CONSTANT(unsigned int, width = Width);
-
-};
-
-} // namespace boost
-
-
-#endif
-

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -0,0 +1,55 @@
+// (C) Copyright Brian Bartman 2010.
+// 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)
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_BITS_MASK_HPP
+#define BOOST_BITS_MASK_HPP
+#include <boost/integer/high_bits_mask.hpp>
+#include <boost/integer/low_bits_mask.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/integer/bit_width.hpp>
+
+
+namespace boost {
+
+
+/** bit_mask.
+ * Mask which creates a mask give type, offset and width of the mask.
+ * Preconditions for bit_mask
+ * Pre-Conditions
+ *
+ * 1. The width of the masked section must not be longer then the
+ * mask itself.
+ *
+ * 2. Valid range for mask width is > 0.
+ *
+ * 3. The type which is being masked must satisfy the is_integral type trait.
+ * NOTE: This is documented but not enforeced.
+ *
+ */
+template <typename T, unsigned int Offset, unsigned int Width = 1 >
+struct bits_mask
+ :integral_mask<T, (low_bits_mask<T,Width>::value << Offset) >
+{
+ // precondition 1.
+ BOOST_STATIC_ASSERT(( (Offset + Width) < ( bit_width<T>::value - 1) ));
+
+ // precondition 2.
+ BOOST_STATIC_ASSERT(( Width > 0 ));
+
+ typedef bits_mask<T, Offset, Width> type;
+
+ BOOST_STATIC_CONSTANT(unsigned int, offset = Offset);
+
+ BOOST_STATIC_CONSTANT(unsigned int, width = Width);
+
+};
+
+} // namespace boost
+
+
+#endif
+

Modified: sandbox/SOC/2010/bit_masks/boost/integer/compound_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/compound_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/compound_mask.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -7,7 +7,7 @@
 #ifndef BOOST_COMPOIND_BIT_MASK_HPP
 #define BOOST_COMPOIND_BIT_MASK_HPP
 
-#include <boost/integer/bit_mask.hpp>
+#include <boost/integer/bits_mask.hpp>
 
 namespace boost {
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/high_low_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/high_low_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/high_low_impl.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -3,7 +3,8 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // See http://www.boost.org for updates, documentation, and revision history.
-
+#ifndef BOOST_HIGH_LOW_IMPL_HPP
+#define BOOST_HIGH_LOW_IMPL_HPP
 
 #include <boost/static_assert.hpp>
 #include <boost/integer/bit_width.hpp>
@@ -30,3 +31,5 @@
 
 
 } } // namespace boost::details
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -0,0 +1,33 @@
+// (C) Copyright Brian Bartman 2010.
+// 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)
+// See http://www.boost.org for updates, documentation, and revision history.
+
+
+#ifndef BOOST_HIGH_BITS_MASK_HPP
+#define BOOST_HIGH_BITS_MASK_HPP
+
+#include <boost/type_traits.hpp>
+#include <boost/integer/details/high_low_impl.hpp>
+#include <boost/integer/integral_mask.hpp>
+
+namespace boost {
+
+
+/** Creates a mask of the supplied width in side type T, from the lower portion
+ * of the integer starting from the left most bit moving towards the right.
+ */
+template <typename T, unsigned int Width>
+struct high_bits_mask
+ :details::high_bits_preconditions<T,Width>,
+ integral_mask<T, ~(~T(0) >> Width) >
+{
+ typedef high_bits_mask<T,Width> type;
+
+ BOOST_STATIC_CONSTANT(unsigned int, width = Width);
+};
+
+} // namespace boost
+
+#endif

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -12,8 +12,10 @@
 #include <boost/integer/details/high_low_impl.hpp>
 #include <boost/integer/integral_mask.hpp>
 
-namespace boost {
+#include <boost/integer/high_bits_mask.hpp>
+#include <boost/integer/low_bits_mask.hpp>
 
+namespace boost {
 
 /** Creates a mask of the supplied width in side type T, from the lower portion
  * of the integer starting from the right most bit moving towards the left.

Modified: sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp 2010-06-05 10:12:36 EDT (Sat, 05 Jun 2010)
@@ -0,0 +1,32 @@
+// (C) Copyright Brian Bartman 2010.
+// 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)
+// See http://www.boost.org for updates, documentation, and revision history.
+
+
+#ifndef BOOST_LOW_BITS_MASK_HPP
+#define BOOST_LOW_BITS_MASK_HPP
+
+#include <boost/type_traits.hpp>
+#include <boost/integer/details/high_low_impl.hpp>
+#include <boost/integer/integral_mask.hpp>
+
+namespace boost {
+
+/** Creates a mask of the supplied width in side type T, from the lower portion
+ * of the integer starting from the right most bit moving towards the left.
+ */
+template <typename T, unsigned int Width>
+struct low_bits_mask
+ :details::low_bits_preconditions<T,Width>,
+ integral_mask<T, ~(~T(0) << Width) >
+{
+ typedef low_bits_mask<T,Width> type;
+
+ BOOST_STATIC_CONSTANT(unsigned int, width = Width);
+};
+
+} // namespace boost
+
+#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