Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65148 - in sandbox/SOC/2010/bit_masks/boost/integer: . detail/bitfield_vector
From: bbartmanboost_at_[hidden]
Date: 2010-08-31 09:23:50


Author: bbartman
Date: 2010-08-31 09:23:48 EDT (Tue, 31 Aug 2010)
New Revision: 65148
URL: http://svn.boost.org/trac/boost/changeset/65148

Log:
working on dispatching insert function
Added:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector_fwd.hpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_iterator_fwd.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp | 2
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_member_impl.hpp | 84 ++++++++++++++++++++++++++++++++++++++++
   2 files changed, 86 insertions(+), 0 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-31 09:23:48 EDT (Tue, 31 Aug 2010)
@@ -740,6 +740,8 @@
 protected:
 
 
+
+
     /** allocates a chunck of memory of the correct size and then
      * correctly fills that memory with value for each of the
      * bitfields within it.

Added: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector_fwd.hpp 2010-08-31 09:23:48 EDT (Tue, 31 Aug 2010)
@@ -0,0 +1,14 @@
+// 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_VECTOR_FWD_HPP
+#define BOOST_BITFIELD_VECTOR_FWD_HPP
+#include <cstddef>
+
+namespace boost {
+template <typename,std::size_t,typename> class bitfield_vector;
+
+} // end boost
+#endif

Added: sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_iterator_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_iterator_fwd.hpp 2010-08-31 09:23:48 EDT (Tue, 31 Aug 2010)
@@ -0,0 +1,19 @@
+// 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_VECTOR_ITERATOR_FWD_HPP
+#define BOOST_BITFIELD_VECTOR_ITERATOR_FWD_HPP
+#include <cstddef>
+
+namespace boost { namespace detail {
+
+template<typename, std::size_t> class bf_vector_iterator;
+template<typename, std::size_t> class const_bf_vector_iterator;
+template<typename, std::size_t> class bf_vector_reverse_iterator;
+template<typename, std::size_t> class const_bf_vector_reverse_iterator;
+
+}} // end boost::detail
+
+#endif

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-31 09:23:48 EDT (Tue, 31 Aug 2010)
@@ -20,6 +20,8 @@
 #include <climits>
 #include <limits>
 #include <boost/mpl/less.hpp>
+#include <iterator>
+#include "bitfield_vector_iterator_fwd.hpp"
 
 namespace boost { namespace detail {
 
@@ -463,6 +465,88 @@
 
 };
 
+
+/** Tags used for dispatching to the correct function and then allowing
+ * the dispatch work in a much easier fashion.
+ */
+struct constant_time_distance;
+struct other_iterator_type;
+#if 0
+/** Tag dispatch for iterator types. */
+template <typename Iter, typename BitfieldIter, typename Visitor, typename>
+struct bitfield_vector_insert_dispatch;
+
+/** random_access Dispatch. */
+template <typename Iter, typename BitfieldIter, typename Visitor>
+struct bitfield_vector_insert_dispatch <
+ Iter,
+ BitfieldIter,
+ Visitor,
+ std::random_access_iterator_tag
+> {
+};
+
+
+/** This is an implementation for insert dispatch for bitfield_vector.
+ * This is directly used for nothing but dispatching, overloading and using
+ * a visitor to do exactly what needs to be for a particular algorithm. This
+ * will hopfully work for all of the different scenarios which occur
+ * within bitfield_vector.
+ */
+template <typename T, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl {
+};
+
+/** Partical specializations for iterators from the bitfield_vector class.
+ * because they arn't actually bidirectional iterators, but they are classiffied
+ * as such, although they have a constant time size.
+ */
+/** const_bf_vector_iterator<T,Width> */
+template <typename T, std::size_t Width, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl <
+ bf_vector_iterator<T,Width>,
+ BitfieldIter,
+ Visitor
+> {
+};
+
+/** const_bf_vector_iterator<T,Width> */
+template <typename T, std::size_t Width, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl <
+ const_bf_vector_iterator<T,Width>,
+ BitfieldIter,
+ Visitor
+> {
+};
+
+/** bf_vector_reverse_iterator<T,Width> */
+template <typename T, std::size_t Width, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl <
+ bf_vector_reverse_iterator<T,Width>,
+ BitfieldIter,
+ Visitor
+> {
+};
+
+/** const_bf_vector_reverse_iterator<T,Width> */
+template <typename T, std::size_t Width, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl <
+ const_bf_vector_reverse_iterator<T,Width>,
+ BitfieldIter,
+ Visitor
+> {
+};
+
+/** pointer overload */
+template <typename T, typename BitfieldIter, typename Visitor>
+struct btifield_vector_insert_impl <
+ T*,
+ BitfieldIter,
+ Visitor
+> {
+};
+#endif
+
 }} // end boost::detail
 
 


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