STXXL
1.4.0
|
Simpler non-growing vector without initialization.
simple_vector can be used a replacement for std::vector when only a non-growing array is needed. The advantages of simple_vector are that it does not initilize memory for POD types (faster), allows simpler inlines and is less error prone to copying and other problems..
Definition at line 37 of file simple_vector.h.
Public Types | |
typedef const value_type * | const_iterator |
typedef const value_type & | const_reference |
typedef value_type * | iterator |
typedef value_type & | reference |
typedef size_t | size_type |
typedef ValueType | value_type |
Public Member Functions | |
simple_vector () | |
allocate empty simple vector More... | |
simple_vector (size_type sz) | |
allocate vector's memory More... | |
~simple_vector () | |
delete vector More... | |
iterator | begin () |
return mutable iterator to first element More... | |
const_iterator | begin () const |
return constant iterator to first element More... | |
const_iterator | cbegin () const |
return constant iterator to first element More... | |
const_iterator | cend () const |
return constant iterator beyond last element More... | |
iterator | data () |
return iterator to beginning of vector More... | |
const_iterator | data () const |
return iterator to beginning of vector More... | |
iterator | end () |
return mutable iterator beyond last element More... | |
const_iterator | end () const |
return constant iterator beyond last element More... | |
void | memzero () |
Zero the whole array content. More... | |
reference | operator[] (size_type i) |
return the i-th position of the vector More... | |
const_reference | operator[] (size_type i) const |
return constant reference to the i-th position of the vector More... | |
void | resize (size_type newsize) |
resize the array to contain exactly newsize items More... | |
size_type | size () const |
return number of items in vector More... | |
void | swap (simple_vector &obj) |
swap vector with another one More... | |
Protected Attributes | |
value_type * | m_array |
pointer to allocated memory area More... | |
size_type | m_size |
size of allocated memory More... | |
Additional Inherited Members | |
Private Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
typedef const value_type* stxxl::simple_vector< ValueType >::const_iterator |
Definition at line 54 of file simple_vector.h.
typedef const value_type& stxxl::simple_vector< ValueType >::const_reference |
Definition at line 56 of file simple_vector.h.
typedef value_type* stxxl::simple_vector< ValueType >::iterator |
Definition at line 53 of file simple_vector.h.
typedef value_type& stxxl::simple_vector< ValueType >::reference |
Definition at line 55 of file simple_vector.h.
typedef size_t stxxl::simple_vector< ValueType >::size_type |
Definition at line 41 of file simple_vector.h.
typedef ValueType stxxl::simple_vector< ValueType >::value_type |
Definition at line 40 of file simple_vector.h.
|
inline |
allocate empty simple vector
Definition at line 60 of file simple_vector.h.
|
inline |
allocate vector's memory
Definition at line 64 of file simple_vector.h.
|
inline |
delete vector
Definition at line 77 of file simple_vector.h.
|
inline |
return mutable iterator to first element
Definition at line 92 of file simple_vector.h.
Referenced by stxxl::stable_ksort_local::bid_sequence< BIDType_, AllocStrategy_ >::operator[](), stxxl::normal_stack< StackConfig >::pop(), stxxl::normal_stack< StackConfig >::push(), and stxxl::stl_in_memory_sort().
|
inline |
return constant iterator to first element
Definition at line 97 of file simple_vector.h.
|
inline |
return constant iterator to first element
Definition at line 102 of file simple_vector.h.
|
inline |
return constant iterator beyond last element
Definition at line 117 of file simple_vector.h.
|
inline |
return iterator to beginning of vector
Definition at line 82 of file simple_vector.h.
|
inline |
return iterator to beginning of vector
Definition at line 87 of file simple_vector.h.
|
inline |
return mutable iterator beyond last element
Definition at line 107 of file simple_vector.h.
Referenced by stxxl::stable_ksort_local::bid_sequence< BIDType_, AllocStrategy_ >::operator[]().
|
inline |
return constant iterator beyond last element
Definition at line 112 of file simple_vector.h.
|
inline |
Zero the whole array content.
Definition at line 158 of file simple_vector.h.
Referenced by stxxl::block_manager::new_blocks_int().
|
inline |
return the i-th position of the vector
Definition at line 127 of file simple_vector.h.
|
inline |
return constant reference to the i-th position of the vector
Definition at line 133 of file simple_vector.h.
|
inline |
resize the array to contain exactly newsize items
Definition at line 139 of file simple_vector.h.
Referenced by stxxl::block_manager::new_blocks_int().
|
inline |
return number of items in vector
Definition at line 122 of file simple_vector.h.
|
inline |
swap vector with another one
Definition at line 71 of file simple_vector.h.
|
protected |
pointer to allocated memory area
Definition at line 48 of file simple_vector.h.
Referenced by stxxl::simple_vector< stxxl::counting_ptr >::swap().
|
protected |
size of allocated memory
Definition at line 45 of file simple_vector.h.
Referenced by stxxl::simple_vector< stxxl::counting_ptr >::swap().