STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::simple_vector< ValueType > Class Template Reference

Detailed Description

template<typename ValueType>
class stxxl::simple_vector< ValueType >

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.

+ Inheritance diagram for stxxl::simple_vector< ValueType >:
+ Collaboration diagram for stxxl::simple_vector< ValueType >:

Public Types

typedef const value_typeconst_iterator
 
typedef const value_typeconst_reference
 
typedef value_typeiterator
 
typedef value_typereference
 
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_typem_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 ()
 

Member Typedef Documentation

template<typename ValueType>
typedef const value_type* stxxl::simple_vector< ValueType >::const_iterator

Definition at line 56 of file simple_vector.h.

template<typename ValueType>
typedef const value_type& stxxl::simple_vector< ValueType >::const_reference

Definition at line 58 of file simple_vector.h.

template<typename ValueType>
typedef value_type* stxxl::simple_vector< ValueType >::iterator

Definition at line 55 of file simple_vector.h.

template<typename ValueType>
typedef value_type& stxxl::simple_vector< ValueType >::reference

Definition at line 57 of file simple_vector.h.

template<typename ValueType>
typedef size_t stxxl::simple_vector< ValueType >::size_type

Definition at line 43 of file simple_vector.h.

template<typename ValueType>
typedef ValueType stxxl::simple_vector< ValueType >::value_type

Definition at line 42 of file simple_vector.h.

Constructor & Destructor Documentation

template<typename ValueType>
stxxl::simple_vector< ValueType >::simple_vector ( )
inline

allocate empty simple vector

Definition at line 62 of file simple_vector.h.

template<typename ValueType>
stxxl::simple_vector< ValueType >::simple_vector ( size_type  sz)
inline

allocate vector's memory

Definition at line 66 of file simple_vector.h.

template<typename ValueType>
stxxl::simple_vector< ValueType >::~simple_vector ( )
inline

delete vector

Definition at line 79 of file simple_vector.h.

Member Function Documentation

template<typename ValueType>
const_iterator stxxl::simple_vector< ValueType >::begin ( ) const
inline

return constant iterator to first element

Definition at line 99 of file simple_vector.h.

template<typename ValueType>
const_iterator stxxl::simple_vector< ValueType >::cbegin ( ) const
inline

return constant iterator to first element

Definition at line 104 of file simple_vector.h.

template<typename ValueType>
const_iterator stxxl::simple_vector< ValueType >::cend ( ) const
inline

return constant iterator beyond last element

Definition at line 119 of file simple_vector.h.

template<typename ValueType>
iterator stxxl::simple_vector< ValueType >::data ( )
inline

return iterator to beginning of vector

Definition at line 84 of file simple_vector.h.

template<typename ValueType>
const_iterator stxxl::simple_vector< ValueType >::data ( ) const
inline

return iterator to beginning of vector

Definition at line 89 of file simple_vector.h.

template<typename ValueType>
iterator stxxl::simple_vector< ValueType >::end ( )
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[]().

template<typename ValueType>
const_iterator stxxl::simple_vector< ValueType >::end ( ) const
inline

return constant iterator beyond last element

Definition at line 114 of file simple_vector.h.

template<typename ValueType>
void stxxl::simple_vector< ValueType >::memzero ( )
inline

Zero the whole array content.

Definition at line 160 of file simple_vector.h.

Referenced by stxxl::block_manager::new_blocks_int().

template<typename ValueType>
reference stxxl::simple_vector< ValueType >::operator[] ( size_type  i)
inline

return the i-th position of the vector

Definition at line 129 of file simple_vector.h.

template<typename ValueType>
const_reference stxxl::simple_vector< ValueType >::operator[] ( size_type  i) const
inline

return constant reference to the i-th position of the vector

Definition at line 135 of file simple_vector.h.

template<typename ValueType>
void stxxl::simple_vector< ValueType >::resize ( size_type  newsize)
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().

template<typename ValueType>
size_type stxxl::simple_vector< ValueType >::size ( ) const
inline

return number of items in vector

Definition at line 124 of file simple_vector.h.

template<typename ValueType>
void stxxl::simple_vector< ValueType >::swap ( simple_vector< ValueType > &  obj)
inline

swap vector with another one

Definition at line 73 of file simple_vector.h.

Member Data Documentation

template<typename ValueType>
value_type* stxxl::simple_vector< ValueType >::m_array
protected

pointer to allocated memory area

Definition at line 50 of file simple_vector.h.

Referenced by stxxl::simple_vector< BID< BlockSize > >::swap().

template<typename ValueType>
size_type stxxl::simple_vector< ValueType >::m_size
protected

size of allocated memory

Definition at line 47 of file simple_vector.h.

Referenced by stxxl::simple_vector< BID< BlockSize > >::swap().


The documentation for this class was generated from the following file: