Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64953 - in sandbox/SOC/2010/bit_masks: . lib/integer/doc/bft_doc/reference lib/integer/doc/bft_doc/reference/class_reference lib/integer/doc/bft_doc/reference/function_reference lib/integer/doc/bft_doc/reference/fusion_extension_reference lib/integer/doc/bft_doc/reference/metafunction_reference lib/integer/doc/html lib/integer/test lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-08-22 10:25:16


Author: bbartman
Date: 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
New Revision: 64953
URL: http://svn.boost.org/trac/boost/changeset/64953

Log:
added more documentation as well as another test
Added:
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/get_free_function.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/at.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/begin.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/bitfield_tuple_iterator.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/category_of.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/end.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/is_sequence.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/is_view.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/size.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element_n.qbk (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/building_views_test.cpp (contents, props changed)
Removed:
   sandbox/SOC/2010/bit_masks/lib/integer/doc/html/
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/align.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/bitfield_tuple.qbk | 10 +++++-----
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/custom.qbk | 4 ++--
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/flag.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/member.qbk | 4 ++--
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/padding.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/pointer.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/storage.qbk | 3 ++-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference.qbk | 1 +
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/make_bitfield_tuple_doc.qbk | 4 ++--
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference.qbk | 11 +++++++++++
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/macro_reference.qbk | 2 +-
   sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference.qbk | 3 +++
   sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 1 +
   sandbox/SOC/2010/bit_masks/notes.txt | 27 ++++++++-------------------
   16 files changed, 43 insertions(+), 37 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `bitfield_tuple` Class Reference]
+[section bitfield_tuple Class Reference]
 This section contains information about the interface provided by the
 `bitfield_tuple` struct and the different structs which can be used to compose
 it.

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/align.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/align.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/align.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct align`]
+[section align]
 [h4 Description]
 Adjusts the next `member` or `flag` template inside of the `bitfield_tuple`'s
 template parameter to a multiple of the `AlignTo` parameter. If the current

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/bitfield_tuple.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/bitfield_tuple.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/bitfield_tuple.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,8 +4,8 @@
 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)
 ]
-[section `bitfield_tuple` and `bitfield_reference`]
-[h4 `bitfield_tuple` interface]
+[section bitfield_tuple and bitfield_reference]
+[h4 bitfield_tuple interface]
 There are two main sections to the interface of a `bitfield_tuple`. The first
 part of a `bitfield_tuple`'s interface is how its specified and how those
 specifications effect its behavior and composition. The second part of the
@@ -54,7 +54,7 @@
 For additional information on creating specilizations over the
 `bitfield_tuple`'s implementation documentation reguarding macros.
 
-[h5 types]
+[h5 Typedefs]
 `N` is used to represent a `bitfield_tuple`.
 
 [table
@@ -115,7 +115,7 @@
     ]
 ]
 
-[h5 `bitfield_reference` Internal Types]
+[h5 bitfield_reference Internal Types]
 `ref` refers to a `bitfield_reference` type
 [table
     [
@@ -270,7 +270,7 @@
     ]
 ]
 
-[h5 Preconditions on the `bitfield_tuple` template]
+[h5 Preconditions on the bitfield_tuple template]
 The following is a list of documented and/or enforeced preconditions for
 constructing a `bitfield_tuple`. All of the preconditions will be noted as
 either being documentation only or enfocred. For documentation only

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/custom.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/custom.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/custom.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct custom`]
+[section custom]
 [h4 Description]
 The `custom` member is a template which is used to do to integers what `pointer`
 does to pointers. That being said, the custom class allows for semi-intrusive
@@ -86,7 +86,7 @@
 
 
 
-[h4 Header file Locaton]
+[h4 Header file Location]
 This header file is included with the <boost/integer/bitfield_tuple.hpp> header
 file.
 ``

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/flag.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/flag.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/flag.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct flag`]
+[section flag]
 [h4 Description]
 `flag` is used to specify a boolean member of width one. This is a simplification
 of `member<bool,NameType,1>` and does the exact same thing.

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/member.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/member.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/member.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct member`]
+[section member]
 
 [h4 Description]
 `member` is used for specifying different bitfields within a `bitfield_tuple`. A
@@ -74,7 +74,7 @@
 
 
 
-[h4 Header file Locaton]
+[h4 Header file Location]
 This header file is included with the <boost/integer/bitfield_tuple.hpp> header
 file.
 ``

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/padding.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/padding.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/padding.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct padding`]
+[section padding]
 [h4 Description]
 `padding` specifies a number of empty bits to be ignored. Another good way to
 think about this is as bit padding, it adds the number of bits in padding when

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/pointer.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/pointer.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/pointer.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `struct pointer`]
+[section pointer]
 [h4 Description]
 The pointer member is a member of a bitfield_tuple which allows the user to
 use a bitfield to store a pointer. This is useful when a user has allocated

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/storage.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/storage.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/class_reference/storage.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,8 @@
 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)
 ]
-[section `struct storage`]
+
+[section storage]
 [h4 Description]
 The `storage` template is optional (you don't have to have one in the template
 parameter list of a `bitfield_tuple`). You may use it to specify that type you

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -6,4 +6,5 @@
 ]
 [section Function Reference]
 [include function_reference/make_bitfield_tuple_doc.qbk]
+[include function_reference/get_free_function.qbk]
 [endsect]

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/get_free_function.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/get_free_function.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -0,0 +1,69 @@
+[/
+Copyright (c) 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)
+]
+
+[section:get get Free Function]
+[h5 Description]
+There are two variations on the `get` function overloads. The first, is a member
+function of `bitfield_tuple`. The second, is a free function with similar
+interface. The free function version of `get` simplifies things for writing
+inside of a template scope. The member function version of `get` requires
+the user to constantly put the word template before it, while the free function
+version does not require the word template inside of a template scope.
+
+[h5 get Free Function Overloads]
+``
+template <std::size_t Index, typename BitfieldTuple>
+inline (Implementation Defined proxy_reference_type) get(BitfieldTuple& bft);
+
+template <typename Name, typename BitfieldTuple>
+inline (Implementation Defined proxy_reference_type) get(BitfieldTuple& bft);
+
+template <std::size_t Index, typename BitfieldTuple>
+inline (Implementation Defined proxy_reference_type) get(BitfieldTuple const& bft);
+
+template <typename Name, typename BitfieldTuple>
+inline (Implementation Defined proxy_reference_type) get(BitfieldTuple const& bft);
+
+``
+
+[h5 Examples]
+``
+#include <boost/integer/bitfield_tuple.hpp>
+#include <cassert>
+
+using namespace boost;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ storage<std::size_t>,
+ filler<3>,
+ member<int, salmon, 16>,
+ flag<blue>
+> get_free_function_example;
+
+int main(){
+
+ get_free_function_example t1;
+
+ // equivalent operations.
+ assert(get<red>(t1) == t1.get<red>());
+
+ // equivalent operations.
+ assert(get<0>(t1) == t1.get<0>());
+ return 0;
+}
+``
+
+
+[endsect]

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/make_bitfield_tuple_doc.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/make_bitfield_tuple_doc.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/function_reference/make_bitfield_tuple_doc.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -5,14 +5,14 @@
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ]
 
-[section Function `make_bitfield_tuple`]
+[section:make_bitfield_tuple make_bitfield_tuple Free Function]
 The `make_bitfield_tuple` function is included with the bitfield_tuple header.
 `make_bitfield_tuple` like `make_tuple` takes a variadic number of parameters.
 However, differing from the `make_tuple`, `make_bitfield_tuple` requires one to
 specify the `bitfield_tuple` the wish to create.
 
 
-
+[h5 Function Signature]
 Function signature for `make_bitfield_tuple`:
 
 `template <typename BitfieldTuple>

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -7,5 +7,16 @@
 [section Boost.Fusion Sequence Extension]
 
 [include fusion_extension_reference/fusion_sequence_extension.qbk]
+[/
+ [include fusion_extension_reference/bitfield_tuple_iterator.qbk]
+ [include fusion_extension_reference/tag_of.qbk]
+ [include fusion_extension_reference/at.qbk]
+ [include fusion_extension_reference/begin.qbk]
+ [include fusion_extension_reference/category_of.qbk]
+ [include fusion_extension_reference/end.qbk]
+ [include fusion_extension_reference/is_sequence.qbk]
+ [include fusion_extension_reference/is_view.qbk]
+ [include fusion_extension_reference/size.qbk]
+]
 
 [endsect]

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/at.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/at.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -0,0 +1,50 @@
+[/
+Copyright (c) 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)
+]
+
+[section:at at and at_c]
+[h5 Description]
+
+
+[h5 Template Parameters]
+[table
+ [
+ [Parameter]
+ [Description]
+ ]
+ [
+ []
+ []
+ ]
+]
+
+
+[h5 Interface]
+[table
+ [
+ [Operation]
+ [Description]
+ ]
+ [
+ [ ]
+ [ ]
+ ]
+]
+
+
+[h5 Header File Location]
+This fusion extension is included along with the
+<boost/integer/bitfield_tuple.hpp> header file. There is no need to directly
+include it within your code.
+[pre
+#include <boost/integer/bitfield_tuple/ext/.hpp>
+]
+
+[h5 Example]
+
+``
+``
+[endsect]

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/begin.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/bitfield_tuple_iterator.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/category_of.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/end.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/is_sequence.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/is_view.qbk
==============================================================================

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/fusion_extension_reference/size.qbk
==============================================================================

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/macro_reference.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/macro_reference.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/macro_reference.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -4,7 +4,7 @@
 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)
 ]
-[section `bitfield_tuple` Macro Reference]
+[section bitfield_tuple Macro Reference]
 
 [include macro_reference/bitfield_tuple_macros.qbk]
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference.qbk
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference.qbk (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -5,4 +5,7 @@
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ]
 [section Meta-Function Reference]
+[include metafunction_reference/name_exists.qbk]
+[include metafunction_reference/element.qbk]
+[include metafunction_reference/element_n.qbk]
 [endsect]

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -0,0 +1,161 @@
+[/
+Copyright (c) 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)
+]
+
+[section:element struct element]
+[h5 Description]
+The `element` meta-function, is a template which behaves the in a similar
+fashion to that of Boost.Tuple's `element`. It takes a `bitfield_tuple` followed
+by an index and returns the proxy reference type that would be returned from
+calling the `get` function with the same index. It is possible to use `element`
+to create a type of view into another integral type which is not a
+`bitfield_tuple`. This is done by using the proxy reference type to construct
+a proxy reference over an integral instead of over another proxy reference type
+which is the only other constructor, for the `bitfield_reference` type.
+
+
+[h5 Template Signature]
+``
+namespace boost { namespace bitfields {
+template<typename BitfieldTuple, std::size_t Index> struct element;
+}}
+``
+[h5 Template Parameters]
+[table
+ [
+ [Parameter]
+ [Description]
+ ]
+ [
+ [`BitfieldTuple`]
+ [The `bitfield_tuple` which is to be used to retrieve the proxy
+reference type from. ]
+ ]
+ [
+ [`Index`]
+ [The index to use for retrieving the proxy reference type.]
+ ]
+]
+[note If there is a need for retrieving a `const` version of a proxy reference
+type there is a convention for retrieving a `const` proxy reference type from
+the `element` meta-function. To retrieve a `const` proxy reference type all that
+needs to be done is to supply the `const` qualifier along with the
+`BitfieldTuple` template parameter. For an example, see below within the example
+section. ]
+
+[h5 Preconditions]
+[table
+ [
+ [Precondition]
+ [Description]
+ [Enforcement]
+ ]
+ [
+ [ `Index < mpl::size<BitfieldTuple::members>::type::value`]
+ [ The index supplied must be less then the number of members within the
+`bitfield_tuple` which is supplied as a template parameter. All this means is
+that if the `Index` supplied is not a valid index the `element` meta-function
+will statically assert. ]
+ [ Enforced by static assert. ]
+ ]
+ [
+ [ BitfieldTuple must be a `bitfield_tuple`. ]
+ [ Means that if something other then a `bitfield_tuple` is supplied
+for the `BitfieldTuple` template parameter that this meta-function will not work. ]
+ [ Documented requirement only. Not enforced. ]
+ ]
+]
+
+[h5 Interface]
+`N` is used for type `element` within the following interface documentation.
+[table
+ [
+ [Operation]
+ [Description]
+ ]
+ [
+ [ `N::type`]
+ [ This is set to the proxy reference type which would be returned from
+the get function at the specified `Index`.]
+ ]
+]
+
+
+[h5 Header File Location]
+This meta-function is included along with the <boost/integer/bitfield_tuple.hpp>
+header file. There is no need to directly include the element header file
+within your code.
+[pre
+#include <boost/integer/bitfield_tuple/element.hpp>
+]
+
+[h5 Example]
+Basic example of how to use the `element` meta-function to retrieve the
+return type of the `get` member or free function.
+``
+#include <boost/integer/bitfield_tuple.hpp>
+
+using namespace boost::bitfields;
+
+struct i;
+struct red;
+struct green;
+struct blue;
+
+typedef bitfield_tuple<
+ member<unsigned int,red,5>,
+ member<unsigned int, green, 6>,
+ member<unsinged int, blue,5>
+> rgb565;
+
+// write a function whose return type is the proxy reference type
+// which would be returned from calling get<0>() or get<red>()
+element<rgb565,0>::type my_func(rgb565 bft) {
+ return bft.get<red>(); // this could be replaced with get<0>()
+}
+
+// make a const version of my_func
+element<const rgb565,0>::type my_func(rgb565 const& bft) {
+ return bft.get<red>(); // this could be replaced with get<0>()
+}
+``
+
+How to use element to make views from a `bitfield_tuple` type.
+`const` still applies to the views, if one would like a `const` view into
+something simply supply the `const` qualifier to the BitfieldTuple template
+parameter and that's all that needs to be done.
+``
+#include <boost/integer/bitfield_tuple.hpp>
+#include <cassert>
+
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct blue;
+
+typedef bitfield_tuple<
+ storage<std::size_t>,
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ member<int, salmon, 16>
+> test_tuple_1;
+
+int main() {
+
+ typedef element<test_tuple_1,0>::type view_red;
+ std::size_t storage = 0;
+ // constructs the red view type over storage
+ // which is simply std::size_t.
+ view_red red_v(storage);
+ assert(red_v == 0);
+ red_v = 3;
+ assert(red_v == 3);
+ return 0;
+}
+``
+
+[endsect]

Added: sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element_n.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/doc/bft_doc/reference/metafunction_reference/element_n.qbk 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -0,0 +1,155 @@
+[/
+Copyright (c) 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)
+]
+
+[section:element_n struct element_n]
+[h5 Description]
+`element_n` is a meta-function similar to the `element`. The only difference
+between this `element` and `element_n` is that `element_n` operates using the
+member's name instead of its index.
+
+
+[h5 Template Signature]
+``
+namespace boost { namespace bitfields {
+template<typename BitfieldTuple, typename Name> struct element_n;
+}}
+``
+[h5 Template Parameters]
+[table
+ [
+ [Parameter]
+ [Description]
+ ]
+ [
+ [`BitfieldTuple`]
+ [ The `bitfield_tuple` which is to be used to retrieve the proxy
+reference type from. ]
+ ]
+ [
+ [`Name`]
+ [ The `Name` supplied to the member when the `bitfield_tuple`. ]
+ ]
+]
+
+[note If there is a need for retrieving a `const` version of a proxy reference
+type there is a convention for retrieving a `const` proxy reference type from
+the `element_n` meta-function. To retrieve a `const` proxy reference type all that
+needs to be done is to supply the `const` qualifier along with the
+`BitfieldTuple` template parameter. For an example, see below within the example
+section. ]
+
+[h5 Preconditions]
+[table
+ [
+ [Precondition]
+ [Description]
+ [Enforcement]
+ ]
+ [
+ [ `Name` must exist ]
+ [ The `Name` template parameter must exist within the `BitfieldTuple`
+template parameter. ]
+ [ Enforced by static assert. ]
+ ]
+ [
+ [ BitfieldTuple must be a `bitfield_tuple`. ]
+ [ Means that if something other then a `bitfield_tuple` is supplied
+for the `BitfieldTuple` template parameter that this meta-function will not work. ]
+ [ Documented requirement only. Not enforced. ]
+ ]
+]
+
+[h5 Interface]
+`N` is used for type `element_n` within the following interface documentation.
+[table
+ [
+ [Operation]
+ [Description]
+ ]
+ [
+ [ `N::type`]
+ [ This is the type which would be returned from the `get` function
+when it is called with `Name`.]
+ ]
+]
+
+
+[h5 Header File Location]
+This meta-function is included along with the <boost/integer/bitfield_tuple.hpp>
+header file. There is no need to directly include the element header file
+within your code.
+[pre
+#include <boost/integer/bitfield_tuple/element.hpp>
+]
+
+[h5 Example]
+Basic example of how to use the `element_n` meta-function to retrieve the
+return type of the `get` member or free function.
+``
+#include <boost/integer/bitfield_tuple.hpp>
+
+using namespace boost::bitfields;
+
+struct i;
+struct red;
+struct green;
+struct blue;
+
+typedef bitfield_tuple<
+ member<unsigned int,red,5>,
+ member<unsigned int, green, 6>,
+ member<unsinged int, blue,5>
+> rgb565;
+
+// write a function whose return type is the proxy reference type
+// which would be returned from calling get<0>() or get<red>()
+element_n<rgb565,red>::type my_func(rgb565 bft) {
+ return bft.get<red>(); // this could be replaced with get<0>()
+}
+
+// make a const version of my_func
+element_n<const rgb565,red>::type my_func(rgb565 const& bft) {
+ return bft.get<red>(); // this could be replaced with get<0>()
+}
+``
+
+How to use element_n to make views from a `bitfield_tuple` type.
+`const` still applies to the views, if one would like a `const` view into
+something simply supply the `const` qualifier to the BitfieldTuple template
+parameter and that's all that needs to be done.
+``
+#include <boost/integer/bitfield_tuple.hpp>
+#include <cassert>
+
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct blue;
+
+typedef bitfield_tuple<
+ storage<std::size_t>,
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ member<int, salmon, 16>
+> test_tuple_1;
+
+int main() {
+
+ typedef element_n<test_tuple_1,red>::type view_red;
+ std::size_t storage = 0;
+ // constructs the red view type over storage
+ // which is simply std::size_t.
+ view_red red_v(storage);
+ assert(red_v == 0);
+ red_v = 3;
+ assert(red_v == 3);
+ return 0;
+}
+``
+
+[endsect]

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-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -72,6 +72,7 @@
         [ run bft_testing/element_test.cpp ]
         [ run bft_testing/element_n_test.cpp ]
         [ run bft_testing/get_free_function_test.cpp ]
+ [ run bft_testing/building_views_test.cpp ]
         [ run bitfield_vector_testing/bitfield_vector_test.cpp ]
         [ run bitfield_vector_testing/bitfield_vector_base_test.cpp ]
         [ run bitfield_vector_testing/proxy_reference_test.cpp ]

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/building_views_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/building_views_test.cpp 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -0,0 +1,43 @@
+// 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>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ storage<std::size_t>,
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ member<int, salmon, 16>
+> test_tuple_1;
+
+
+/*
+using the bitfield_tuple test_tuple_1 to make "views" out of the proxy reference
+types.
+*/
+int main() {
+ {
+ typedef element<test_tuple_1,0>::type view_red;
+ std::size_t storage = 0;
+ view_red red_v(storage);
+ BOOST_TEST(red_v == 0);
+ red_v = 3;
+ BOOST_TEST(red_v == 3);
+
+ }
+ return boost::report_errors();
+}

Modified: sandbox/SOC/2010/bit_masks/notes.txt
==============================================================================
--- sandbox/SOC/2010/bit_masks/notes.txt (original)
+++ sandbox/SOC/2010/bit_masks/notes.txt 2010-08-22 10:25:06 EDT (Sun, 22 Aug 2010)
@@ -101,7 +101,7 @@
             * Add relevant links here. Need to think about more relevant links
                 and add them!!!!
 
- IV) Glossary
+ IV) Glossary - maybe switch this with external resources?
             * Add a link to Vicente's Bitfield within boost vault / sandbox.
 
     C) Reference
@@ -117,16 +117,18 @@
             h) struct custom
         III) bitfield_tuple Macro Reference
         IV) Function Reference
- b) get as a free function <- NEW
-
+ b) get as a free function
         V) Meta-Function Reference
- a) name_exists <- NEW
+
+
             b) find_by_element_name <- NEW
             c) find_by_element_index <- NEW
             d) get_proxy_reference_type_by_name <- NEW
             e) get_proxy_reference_type_by_index <- NEW
- f) element <- NEW
- g) element_n <- NEW
+
+ a) name_exists
+ f) element
+ g) element_n
 
         VI) Boost.Fusion Sequence Extension
             a) tag_of <- NEW
@@ -152,19 +154,6 @@
         III) Acknowledgments
         VI) Future Work
 
-
-
-
-Classes and components to be documented
- 1) bit_mask
- 1) integral_mask
- 2) bits_mask
- 3) high_bits_mask
- 4) low_bits_mask
-
- 2) bitfield_tuple
- 1
-
 --------------------------------------------------------------------------------
                             bitfield_vector
 --------------------------------------------------------------------------------


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