From 78b0a8f6b90497cb1d86e0da8c1dfe9b016efbd2 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 13 Sep 2015 17:52:23 +0300 Subject: [PATCH] Removed unused helper BoundedArray class --- cds/details/bounded_array.h | 117 ------------------------------------ 1 file changed, 117 deletions(-) diff --git a/cds/details/bounded_array.h b/cds/details/bounded_array.h index 2ac88948..71ddf781 100644 --- a/cds/details/bounded_array.h +++ b/cds/details/bounded_array.h @@ -17,123 +17,6 @@ //@cond namespace cds { namespace details { - - /// Upper bounded dynamic array - /** - BoundedArray is dynamic allocated C-array of item of type T with the interface like STL. - The max size (capacity) of array is defined at ctor time and cannot be changed during object's lifetime - - \par Template parameters - - \p T type of elements - - \p Allocator dynamic memory allocator class (std::allocator semantics) - - This class is deprecated: it is based on std::vector and does not support non-copyable type \p T. - See \ref bounded_array. - */ - template - class BoundedArray: private std::vector< T, typename Allocator::template rebind::other > - { - public: - typedef T value_type ; ///< value type stored in the array - typedef Allocator allocator_type ; ///< allocator type - typedef std::vector::other> vector_type ; ///< underlying vector type - - typedef typename vector_type::iterator iterator ; ///< item iterator - typedef typename vector_type::const_iterator const_iterator ; ///< item const iterator - - public: - /// Default ctor - explicit BoundedArray( - size_t nCapacity ///< capacity - ) - { - vector_type::resize( nCapacity ); - assert( size() == capacity() ); - } - - /// Ctor with item's initialization - BoundedArray( - size_t nCapacity, ///< capacity of array - const value_type& init, ///< initial value of any item - size_t nInitCount = 0 ///< how many items will be initialized; 0 - all items - ) - { - assert( nInitCount <= nCapacity ); - vector_type::resize( nCapacity ); - assign( nInitCount ? nInitCount : vector_type::capacity(), init ); - assert( size() == capacity() ); - } - - const value_type& operator []( size_t nItem ) const - { - return vector_type::operator[](nItem); - } - - value_type& operator []( size_t nItem ) - { - return vector_type::operator[](nItem); - } - - size_t size() const - { - return vector_type::size(); - } - - size_t capacity() const - { - return vector_type::capacity(); - } - - /// Returns sizeof(T) - static size_t itemSize() - { - return sizeof(T); - } - - /// Returns pointer to the first item in the array - value_type * top() - { - return & vector_type::front(); - } - - friend value_type * operator +( BoundedArray& arr, size_t i ) - { - return &( arr[i] ); - } - - /// Get begin iterator - const_iterator begin() const - { - return vector_type::begin(); - } - iterator begin() - { - return vector_type::begin(); - } - - /// Get end iterator - const_iterator end() const - { - return vector_type::end(); - } - iterator end() - { - return vector_type::end(); - } - - /// Get end iterator for \p nMax-th item - const_iterator end( size_t nMax ) const - { - assert( nMax <= vector_type::capacity()); - return vector_type::begin() + nMax; - } - iterator end( size_t nMax ) - { - assert( nMax <= vector_type::capacity()); - return vector_type::begin() + nMax; - } - }; - /// Bounded dynamic array /** The class template is intended for storing fixed-size sequences of objects. -- 2.34.1