Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63233 - in sandbox/SOC/2010/bit_masks: boost/integer boost/integer/details/bft/ext boost/integer/details/bft/ext/fusion lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-06-22 10:37:47


Author: bbartman
Date: 2010-06-22 10:37:46 EDT (Tue, 22 Jun 2010)
New Revision: 63233
URL: http://svn.boost.org/trac/boost/changeset/63233

Log:
fixed the naming of the reference type to bitfield_reference
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp | 81 ++++++++++++++++-----------------------
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp | 2
   sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp | 2
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/ref_type_testing.cpp | 14 +++---
   4 files changed, 43 insertions(+), 56 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp 2010-06-22 10:37:46 EDT (Tue, 22 Jun 2010)
@@ -122,12 +122,12 @@
  *
  *
  * bitfield_tuple internal Class templates
- * bit_ref - Template is a reference type which takes one
+ * bitfield_ref - Template is a reference type which takes one
  * parameter which is expected to be of type
  * bitfield_element and creates a proxy reference type
  * to the element specified by the bitfield_element.
  *
- * bit_ref interface
+ * bitfield_ref interface
  * public typedefs
  * return_type - The type which is to be returned from a specified
  * bitfield.
@@ -137,20 +137,20 @@
  * as endianness within the internal storage type.
  *
  * constructors
- * bit_ref( bit_ref<MaskInfo> const&);
- * bit_ref( storage_type& ref);
+ * bitfield_ref( bitfield_ref<MaskInfo> const&);
+ * bitfield_ref( storage_type& ref);
  * private constructors
- * bit_ref();
+ * bitfield_ref();
  *
  * functions
  * operator return_type() // implicit conversion operator
- * bit_ref<MaskInfo> const& operator=(return_type const& rhs);
+ * bitfield_ref<MaskInfo> const& operator=(return_type const& rhs);
  *
  *
- * const_bit_ref - Similar to the bit_ref class template how ever this
+ * const_bitfield_ref - Similar to the bitfield_ref class template how ever this
  * is a const representation a reference.
- * The only difference between const_bit_ref and bit_ref is that
- * const_bit_ref does not define an assignment operator.
+ * The only difference between const_bitfield_ref and bitfield_ref is that
+ * const_bitfield_ref does not define an assignment operator.
  *
  *
  * bitfield_tuple constructors
@@ -201,19 +201,19 @@
  * - returns a reference to the data inside of the bitfield_tuple.
  *
  * get function
- * - The get function returns a bit_ref or const_bit_ref which is
+ * - The get function returns a bitfield_ref or const_bitfield_ref which is
  * convertible to the type specified in the first template parameter of the
  * member type, that corresponds to the bit field being accessed. For
  * example, using example_type from the first example, if the get function
  * is called in the following manner, temp.get<bool_one>(), the return type
- * for get in this case is a bit_ref type thats convertible to bool and
+ * for get in this case is a bitfield_ref type thats convertible to bool and
  * information retrieving data or storing data in the correct bitfield.
  *
- * bit_ref<typename> get<typenam>(); // access by name.
- * const_bit_ref<typename> get<typenam>() const; // access by name.
+ * bitfield_ref<typename> get<typenam>(); // access by name.
+ * const_bitfield_ref<typename> get<typenam>() const; // access by name.
  *
- * bit_ref<typename> get<size_t>(); // access by index.
- * const_bit_ref<typename> get<size_t>() const; // access by index.
+ * bitfield_ref<typename> get<size_t>(); // access by index.
+ * const_bitfield_ref<typename> get<size_t>() const; // access by index.
  *
  *
  * All get functions provide constant time run time access to the bitfield to
@@ -310,7 +310,7 @@
  * 6) For second draft I would like to restructure the way the parsed
  * arguments are stored. Change from bitfield_elements to a pair
  * the first item being the key/name the second item being a bitfield.
- * Instead of returning a bit_ref class return a bitfield class.
+ * Instead of returning a bitfield_ref class return a bitfield class.
  * this may be slightly more difficult then needed, because I need to store
  * both a const and non const version of a bitfield. But even I don't do
  * that I would like to change the way the reference class works.
@@ -345,9 +345,9 @@
      * This serves as the go between things within this class.
      */
     template <typename MaskInfo>
- struct bit_ref {
+ struct bitfield_ref {
     private:
- typedef bit_ref<MaskInfo> _self;
+ typedef bitfield_ref<MaskInfo> _self;
         typedef typename make_unsigned<
             storage_type
>::type unsigned_storage_type;
@@ -367,7 +367,7 @@
 
 
         /** Reference constructor. */
- bit_ref(storage_type& ref)
+ bitfield_ref(storage_type& ref)
             :_ref( *reinterpret_cast<unsigned_storage_type*>(&ref) )
         { }
 
@@ -375,7 +375,7 @@
         /** copy constructor.
          * This is because references are copy constructible.
          */
- bit_ref( bit_ref<MaskInfo> const& x)
+ bitfield_ref( bitfield_ref<MaskInfo> const& x)
            :_ref( x._ref )
         { }
         
@@ -400,7 +400,7 @@
         bitfield_type _ref;
 
         // not default constructible because this is a reference type
- bit_ref();
+ bitfield_ref();
     };
 
     /** Const reference type.
@@ -408,9 +408,9 @@
      * can be removed from the reference type.
      */
     template <typename MaskInfo>
- struct const_bit_ref {
+ struct const_bitfield_ref {
     private:
- typedef bit_ref<MaskInfo> _self;
+ typedef bitfield_ref<MaskInfo> _self;
         typedef typename make_unsigned<
             storage_type
>::type const unsigned_storage_type;
@@ -429,14 +429,14 @@
 
 
         /** Reference constructor. */
- const_bit_ref(storage_type const& ref)
+ const_bitfield_ref(storage_type const& ref)
             :_ref( *reinterpret_cast<unsigned_storage_type*>(&ref) )
         { }
 
         /** copy constructor.
          * This is because references are copy constructible.
          */
- const_bit_ref( bit_ref<MaskInfo> const& x)
+ const_bitfield_ref( bitfield_ref<MaskInfo> const& x)
             :_ref( x.ref )
         { }
         
@@ -452,7 +452,7 @@
         bitfield_type _ref;
 
         // not default constructible because this is a reference type
- const_bit_ref();
+ const_bitfield_ref();
     };
 
     /** Fusion Friends.
@@ -479,19 +479,6 @@
         :_data( x.data() )
     { }
 
- /** "Identical members" copy constructor.
- * Basically this is used to get the data within a structure whose
- * bitfields are the same (in the same order) but the storage is
- * specified in a different place within the template arguments.
- *
- * XXX
- * TODO: The signature of this will need to change possibly to
- * use enable_if or some form of internal dispatching.
- * XXX
- */
- template <typename T> bitfield_tuple(T const& x);
-
- // TODO: look into the creation of a member wise constructor.
 
 
     /** Assignment from an integer
@@ -568,7 +555,7 @@
                 members
>::type
>,
- bit_ref<
+ bitfield_ref<
             typename mpl::deref<
                 typename mpl::find_if<
                     members,
@@ -581,7 +568,7 @@
>
>::type
     get() {
- typedef bit_ref<
+ typedef bitfield_ref<
             typename mpl::deref<
                 typename mpl::find_if<
                     members,
@@ -610,7 +597,7 @@
                 members
>::type
>,
- const_bit_ref<
+ const_bitfield_ref<
             typename mpl::deref<
                 typename mpl::find_if<
                     members,
@@ -623,7 +610,7 @@
>
>::type const
     get() const {
- typedef const_bit_ref<
+ typedef const_bitfield_ref<
             typename mpl::deref<
                 typename mpl::find_if<
                     members,
@@ -647,7 +634,7 @@
                 members
>
>,
- bit_ref<
+ bitfield_ref<
             typename mpl::at_c<
                 members,
                 Index
@@ -655,7 +642,7 @@
>
>::type
     get() {
- typedef bit_ref<
+ typedef bitfield_ref<
             typename mpl::at_c<
                 members,
                 Index
@@ -674,7 +661,7 @@
                     members
>
>,
- const_bit_ref<
+ const_bitfield_ref<
                 typename mpl::at_c<
                     members,
                     Index
@@ -682,7 +669,7 @@
>
>::type
     get() const {
- typedef const_bit_ref<
+ typedef const_bitfield_ref<
             typename mpl::at_c<
                 members,
                 Index

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_iterator.hpp 2010-06-22 10:37:46 EDT (Tue, 22 Jun 2010)
@@ -54,7 +54,7 @@
     /** Fusion Extension: value_of */
     template<typename Iter>
     struct value_of {
- typedef typename Iter::bitfield_tuple_type::template bit_ref<
+ typedef typename Iter::bitfield_tuple_type::template bitfield_ref<
             typename mpl::at<
                 typename Iter::bitfield_tuple_type::members,
                 typename Iter::index

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/at_impl.hpp 2010-06-22 10:37:46 EDT (Tue, 22 Jun 2010)
@@ -22,7 +22,7 @@
     template <typename BitfieldTuple, typename N>
     struct apply {
         typedef typename BitfieldTuple::
- template bit_ref<
+ template bitfield_ref<
                 typename mpl::at<
                     typename BitfieldTuple::members,
                     N

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/ref_type_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/ref_type_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/ref_type_testing.cpp 2010-06-22 10:37:46 EDT (Tue, 22 Jun 2010)
@@ -39,7 +39,7 @@
 
     // simple test entery and retreval.
     {
- typedef bft::bit_ref<element_1> ref_type_1;
+ typedef bft::bitfield_ref<element_1> ref_type_1;
 
     ref_type_1 test_1( data_storage );
 
@@ -53,8 +53,8 @@
     // slightly more complex.
     // multiple fields which arn't next to one another.
     {
- typedef bft::bit_ref<element_2> ref_type_1;
- typedef bft::bit_ref<element_4> ref_type_2;
+ typedef bft::bitfield_ref<element_2> ref_type_1;
+ typedef bft::bitfield_ref<element_4> ref_type_2;
 
         // constructing reference types.
         ref_type_1 ref_1(data_storage);
@@ -71,10 +71,10 @@
     // case the integer storage type is completely filled with fields.
     {
         // create fake reference type to test..
- typedef bft::bit_ref<element_2> ref_type_1;
- typedef bft::bit_ref<element_3> ref_type_2;
- typedef bft::bit_ref<element_4> ref_type_3;
- typedef bft::bit_ref<element_5> ref_type_4;
+ typedef bft::bitfield_ref<element_2> ref_type_1;
+ typedef bft::bitfield_ref<element_3> ref_type_2;
+ typedef bft::bitfield_ref<element_4> ref_type_3;
+ typedef bft::bitfield_ref<element_5> ref_type_4;
         //
         ref_type_1 ref_1(data_storage);
         ref_type_2 ref_2(data_storage);


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