|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64499 - 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-07-31 09:17:12
Author: bbartman
Date: 2010-07-31 09:17:11 EDT (Sat, 31 Jul 2010)
New Revision: 64499
URL: http://svn.boost.org/trac/boost/changeset/64499
Log:
working on implementing a bitfield_vector
Added:
sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/
sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp (contents, props changed)
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/bitfield_vector.hpp | 134 ++++++++++++++++++++++++++++++++++++++++
sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 1
sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp | 12 +++
3 files changed, 147 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-07-31 09:17:11 EDT (Sat, 31 Jul 2010)
@@ -0,0 +1,134 @@
+// 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_HPP
+#define BOOST_BITFIELD_VECTOR_HPP
+#include <cstddef>
+#include <memory>
+
+namespace boost {
+
+template <typename,typename>
+class vector;
+
+template <typename T,std::size_t>
+struct bits;
+
+/** Iterators. */
+//@{
+template<typename T, std::size_t Width>
+struct bf_vector_iterator { };
+
+template<typename T, std::size_t Width>
+struct const_bf_vector_iterator { };
+
+
+template<typename T, std::size_t Width>
+struct bf_vector_reverse_iterator { };
+
+template<typename T, std::size_t Width>
+struct const_bf_vector_reverse_iterator { };
+//@}
+
+
+template <typename T, std::size_t Width, typename Allocator >
+class vector< bits<T,Width>, Allocator > {
+ typedef vector< bits<T,Width>, Allocator > _self;
+public:
+ typedef bf_vector_iterator<T,Width> iterator;
+ typedef const_bf_vector_iterator<T,Width> const_iterator;
+ typedef bf_vector_reverse_iterator<T,Width> reverse_iterator;
+ typedef const_bf_vector_reverse_iterator<T,Width> const_reverse_iterator;
+ typedef T value_type;
+
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename Allocator::pointer pointer;
+ typedef typename Allocator::const_pointer const_pointer;
+
+ class reference {
+ friend class vector;
+ reference();
+ public:
+ ~reference();
+ operator value_type () const;
+ reference& operator= (const value_type x);
+ reference& operator= (const reference& x);
+ void flip();
+ };
+
+ class const_reference {
+ friend class vector;
+ const_reference();
+ public:
+ ~const_reference();
+ // operator value_type () const;
+ const_reference& operator= (const value_type x);
+ const_reference& operator= (const const_reference& x);
+ void flip();
+ };
+
+
+ explicit vector(const Allocator& = Allocator() );
+ explicit vector(size_type n, const T& value= T(),
+ const Allocator& = Allocator() );
+ template <class InputIterator>
+ vector(InputIterator first, InputIterator last,
+ const Allocator& = Allocator());
+ vector( const vector<T,Allocator>& x );
+ ~vector();
+
+ _self& operator=(const _self& x);
+
+ iterator begin();
+ iterator end();
+ iterator rbegin();
+ iterator rend();
+ reference front();
+ reference back();
+
+ const_iterator begin() const;
+ const_iterator end() const;
+ const_iterator rbegin() const;
+ const_iterator rend() const;
+ const_reference front() const;
+ const_reference back() const;
+
+ size_type size() const;
+ size_type max_size() const;
+
+
+ void resize(size_type sz, value_type c = value_type() );
+ size_type capacity() const;
+ bool empty() const;
+ void reserve(size_type n);
+ reference operator[](size_type n);
+ const_reference operator[](size_type n) const;
+ const_reference at(size_type n) const;
+ reference at(size_type n);
+
+ template <class InputIterator>
+ void assign(InputIterator first, InputIterator last);
+
+ void assign(size_type n, const value_type& u);
+ void push_back(const value_type& x);
+ void pop_back();
+ iterator insert(iterator position, const value_type& x);
+ void insert(iterator position, size_type n, const value_type& x);
+
+ template <class InputIterator>
+ void insert(iterator position, InputIterator first, InputIterator last);
+
+ iterator erase(iterator position);
+ iterator erase(iterator first, iterator last);
+ void swap(_self& vec);
+ void clear();
+ allocator_type get_allocator() const;
+};
+
+} // end boost
+
+#endif
Added: sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp
==============================================================================
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-07-31 09:17:11 EDT (Sat, 31 Jul 2010)
@@ -71,5 +71,6 @@
[ run bft_testing/element_test.cpp ]
[ run bft_testing/element_n_test.cpp ]
[ run bft_testing/get_free_function_test.cpp ]
+ [ run bitfield_vector_testing/bitfield_vector_test.cpp ]
;
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp 2010-07-31 09:17:11 EDT (Sat, 31 Jul 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 <boost/detail/lightweight_test.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