STXXL  1.4.0
 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 37 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 54 of file simple_vector.h.

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

Definition at line 56 of file simple_vector.h.

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

Definition at line 53 of file simple_vector.h.

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

Definition at line 55 of file simple_vector.h.

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

Definition at line 41 of file simple_vector.h.

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

Definition at line 40 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 60 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 64 of file simple_vector.h.

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

delete vector

Definition at line 77 of file simple_vector.h.

Member Function Documentation

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

return constant iterator to first element

Definition at line 97 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 102 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 117 of file simple_vector.h.

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

return iterator to beginning of vector

Definition at line 82 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 87 of file simple_vector.h.

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

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

return constant iterator beyond last element

Definition at line 112 of file simple_vector.h.

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

Zero the whole array content.

Definition at line 158 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 127 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 133 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 139 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 122 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 71 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 48 of file simple_vector.h.

Referenced by stxxl::simple_vector< stxxl::counting_ptr >::swap().

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

size of allocated memory

Definition at line 45 of file simple_vector.h.

Referenced by stxxl::simple_vector< stxxl::counting_ptr >::swap().


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