15 #ifndef STXXL_COMMON_SIMPLE_VECTOR_HEADER
16 #define STXXL_COMMON_SIMPLE_VECTOR_HEADER
36 template <
typename ValueType>
61 : m_size(0), m_array(NULL)
65 : m_size(sz), m_array(NULL)
73 std::swap(m_size, obj.
m_size);
74 std::swap(m_array, obj.
m_array);
109 return m_array + m_size;
114 return m_array + m_size;
130 return *(begin() + i);
136 return *(begin() + i);
143 STXXL_MSG(
"Warning: resizing non-empty simple_vector");
146 memcpy((
void*)m_array, (
void*)tmp,
160 memset(m_array, 0, m_size *
sizeof(
value_type));
167 template <
class ValueType>
176 #endif // !STXXL_COMMON_SIMPLE_VECTOR_HEADER
const_iterator end() const
return constant iterator beyond last element
const Tp & STXXL_MIN(const Tp &a, const Tp &b)
~simple_vector()
delete vector
simple_vector()
allocate empty simple vector
iterator data()
return iterator to beginning of vector
const value_type * const_iterator
const_iterator begin() const
return constant iterator to first element
High-performance smart pointer used as a wrapping reference counting pointer.
const value_type & const_reference
size_type size() const
return number of items in vector
iterator end()
return mutable iterator beyond last element
const_iterator cend() const
return constant iterator beyond last element
void memzero()
Zero the whole array content.
iterator begin()
return mutable iterator to first element
value_type * m_array
pointer to allocated memory area
const_iterator data() const
return iterator to beginning of vector
void swap(simple_vector &obj)
swap vector with another one
#define STXXL_BEGIN_NAMESPACE
simple_vector(size_type sz)
allocate vector's memory
size_type m_size
size of allocated memory
Simpler non-growing vector without initialization.
const_iterator cbegin() const
return constant iterator to first element
#define STXXL_END_NAMESPACE
void resize(size_type newsize)
resize the array to contain exactly newsize items