STXXL
1.4-dev
|
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 39 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 56 of file simple_vector.h.
typedef const value_type& stxxl::simple_vector< ValueType >::const_reference |
Definition at line 58 of file simple_vector.h.
typedef value_type* stxxl::simple_vector< ValueType >::iterator |
Definition at line 55 of file simple_vector.h.
typedef value_type& stxxl::simple_vector< ValueType >::reference |
Definition at line 57 of file simple_vector.h.
typedef size_t stxxl::simple_vector< ValueType >::size_type |
Definition at line 43 of file simple_vector.h.
typedef ValueType stxxl::simple_vector< ValueType >::value_type |
Definition at line 42 of file simple_vector.h.
|
inline |
allocate empty simple vector
Definition at line 62 of file simple_vector.h.
|
inline |
allocate vector's memory
Definition at line 66 of file simple_vector.h.
|
inline |
delete vector
Definition at line 79 of file simple_vector.h.
|
inline |
return mutable iterator to first element
Definition at line 94 of file simple_vector.h.
Referenced by stxxl::compute_prefetch_schedule(), 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 99 of file simple_vector.h.
|
inline |
return constant iterator to first element
Definition at line 104 of file simple_vector.h.
|
inline |
return constant iterator beyond last element
Definition at line 119 of file simple_vector.h.
|
inline |
return iterator to beginning of vector
Definition at line 84 of file simple_vector.h.
|
inline |
return iterator to beginning of vector
Definition at line 89 of file simple_vector.h.
|
inline |
return mutable iterator beyond last element
Definition at line 109 of file simple_vector.h.
Referenced by stxxl::compute_prefetch_schedule(), and stxxl::stable_ksort_local::bid_sequence< BIDType, AllocStrategy >::operator[]().
|
inline |
return constant iterator beyond last element
Definition at line 114 of file simple_vector.h.
|
inline |
Zero the whole array content.
Definition at line 160 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 129 of file simple_vector.h.
|
inline |
return constant reference to the i-th position of the vector
Definition at line 135 of file simple_vector.h.
|
inline |
resize the array to contain exactly newsize items
Definition at line 141 of file simple_vector.h.
Referenced by stxxl::block_manager::new_blocks_int().
|
inline |
return number of items in vector
Definition at line 124 of file simple_vector.h.
|
inline |
swap vector with another one
Definition at line 73 of file simple_vector.h.
|
protected |
pointer to allocated memory area
Definition at line 50 of file simple_vector.h.
Referenced by stxxl::simple_vector< BID< BlockSize > >::swap().
|
protected |
size of allocated memory
Definition at line 47 of file simple_vector.h.
Referenced by stxxl::simple_vector< BID< BlockSize > >::swap().