STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType > Class Template Reference

Detailed Description

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
class stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >

External vector container.
Introduction to vector container: see STXXL Vector tutorial.
Design and Internals of vector container: see Vector.

For semantics of the methods see documentation of the STL std::vector

Template Parameters
ValueTypetype of contained objects (POD with no references to internal memory)
PageSizenumber of blocks in a page
PagerTypepager type, random_pager<x> or lru_pager<x>, where x is the default number of pages, default is lru_pager<8>
BlockSizeexternal block size in bytes, default is 2 MiB
AllocStrone of allocation strategies: striping , RC , SR , or FR default is RC

Memory consumption: BlockSize*x*PageSize bytes

Warning
Do not store references to the elements of an external vector. Such references might be invalidated during any following access to elements of the vector
Examples:
examples/algo/copy_and_sort_file.cpp, examples/algo/phonebills.cpp, examples/algo/phonebills_genlog.cpp, examples/algo/sort_file.cpp, examples/applications/skew3.cpp, examples/containers/copy_file.cpp, examples/containers/vector1.cpp, examples/containers/vector2.cpp, examples/containers/vector_buf.cpp, and examples/stream/stream1.cpp.

Definition at line 255 of file vector.h.

+ Inheritance diagram for stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >:
+ Collaboration diagram for stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >:

Classes

class  bid_vector
 

Public Types

Extra Types
typedef vector_bufwriter
< iterator
bufwriter_type
 vector_bufwriter compatible with this vector More...
 
typedef vector_bufreader
< const_iterator
bufreader_type
 vector_bufreader compatible with this vector More...
 
typedef
vector_bufreader_reverse
< const_iterator
bufreader_reverse_type
 vector_bufreader compatible with this vector More...
 
typedef bid_vector bids_container_type
 
typedef
bids_container_type::iterator 
bids_container_iterator
 
typedef
bids_container_type::const_iterator 
const_bids_container_iterator
 
typedef typed_block< BlockSize,
ValueType > 
block_type
 type of the block used in disk-memory transfers More...
 
typedef double_blocked_index
< SizeType, PageSize,
block_type::size
blocked_index_type
 double-index type to reference individual elements in a block More...
 

Public Member Functions

Constructors/Destructors
 vector (size_type n=0, unsigned_type npages=pager_type().size())
 Constructs external vector with n elements. More...
 
 vector (file *from, size_type size=size_type(-1), unsigned_type npages=pager_type().size())
 Construct vector from a file. More...
 
 vector (const vector &obj)
 copy-constructor More...
 
 ~vector ()
 
Modifier
void swap (vector &obj)
 swap content More...
 
Miscellaneous
void allocate_page_cache () const
 Allocate page cache, must be called to allow access to elements. More...
 
void deallocate_page_cache () const
 allows to free the cache, but you may not access any element until call allocate_page_cache() again More...
 
void export_files (std::string filename_prefix)
 Export data such that it is persistent on the file system. Resulting files will be numbered ascending. More...
 
fileget_file () const
 Get the file associated with this vector, or NULL. More...
 
Size and Capacity
size_type size () const
 return the size of the vector. More...
 
bool empty () const
 true if the vector's size is zero. More...
 
size_type capacity () const
 Return the number of elelemtsn for which external memory has been allocated. capacity() is always greator than or equal to size(). More...
 
size_type raw_capacity () const
 Returns the number of bytes that the vector has allocated on disks. More...
 
void reserve (size_type n)
 Reserves at least n elements in external memory. More...
 
void resize (size_type n)
 Resize vector contents to n items. More...
 
void resize (size_type n, bool shrink_capacity)
 Resize vector contents to n items, and allow the allocated external memory to shrink. Internal memory allocation remains unchanged. More...
 
Modifiers
void clear ()
 Erases all of the elements and deallocates all external memory that is occupied. More...
 
void flush () const
 Flushes the cache pages to the external memory. More...
 
Front and Back Access
void push_back (const_reference obj)
 Append a new element at the end. More...
 
void pop_back ()
 Removes the last element (without returning it, see back()). More...
 
Operators
reference back ()
 Returns a reference to the last element, see More Notes. More...
 
reference front ()
 Returns a reference to the first element, see More Notes. More...
 
const_reference back () const
 Returns a constant reference to the last element, see More Notes. More...
 
const_reference front () const
 Returns a constant reference to the first element, see More Notes. More...
 
vectoroperator= (const vector &obj)
 assignment operator More...
 
Iterator Construction
iterator begin ()
 returns an iterator pointing to the beginning of the vector, see More Notes. More...
 
const_iterator begin () const
 returns a const_iterator pointing to the beginning of the vector, see More Notes. More...
 
const_iterator cbegin () const
 returns a const_iterator pointing to the beginning of the vector, see More Notes. More...
 
iterator end ()
 returns an iterator pointing beyond the end of the vector, see More Notes. More...
 
const_iterator end () const
 returns a const_iterator pointing beyond the end of the vector, see More Notes. More...
 
const_iterator cend () const
 returns a const_iterator pointing beyond the end of the vector, see More Notes. More...
 
reverse_iterator rbegin ()
 returns a reverse_iterator pointing to the end of the vector. More...
 
const_reverse_iterator rbegin () const
 returns a reverse_iterator pointing to the end of the vector. More...
 
const_reverse_iterator crbegin () const
 returns a reverse_iterator pointing to the end of the vector. More...
 
reverse_iterator rend ()
 returns a reverse_iterator pointing beyond the beginning of the vector. More...
 
const_reverse_iterator rend () const
 returns a reverse_iterator pointing beyond the beginning of the vector. More...
 
const_reverse_iterator crend () const
 returns a reverse_iterator pointing beyond the beginning of the vector. More...
 
Direct Element Access
reference operator[] (size_type offset)
 access the element at the given vector's offset More...
 
const_reference operator[] (size_type offset) const
 access the element at the given vector's offset More...
 
reference at (size_type offset)
 access the element at the given vector's offset More...
 
const_reference at (size_type offset) const
 access the element at the given vector's offset More...
 
bool is_element_cached (size_type offset) const
 return true if the given vector offset is in cache More...
 
Capacity
template<typename ForwardIterator >
void set_content (const ForwardIterator &bid_begin, const ForwardIterator &bid_end, size_type n)
 Set the blocks and the size of this container explicitly. The vector must be completely empty before. More...
 
unsigned_type numpages () const
 Number of pages used by the pager. More...
 

Private Types

enum  { valid_on_disk = 0, uninitialized = 1, dirty = 2 }
 

Private Member Functions

void _resize (size_type n)
 Resize vector, only allow capacity growth. More...
 
void _resize_shrink_capacity (size_type n)
 Resize vector, also allow reduction of external memory capacity. More...
 
bids_container_iterator bid (const size_type &offset)
 
bids_container_iterator bid (const blocked_index_type &offset)
 
const_bids_container_iterator bid (const size_type &offset) const
 
const_bids_container_iterator bid (const blocked_index_type &offset) const
 
void block_externally_updated (size_type offset) const
 
void block_externally_updated (const blocked_index_type &offset) const
 
const_reference const_element (size_type offset) const
 
const_reference const_element (const blocked_index_type &offset) const
 
reference element (size_type offset)
 
reference element (const blocked_index_type &offset)
 
stxxl::uint64 file_length () const
 
bool is_page_cached (const blocked_index_type &offset) const
 
void page_externally_updated (unsigned_type page_no) const
 
void read_page (int_type page_no, int_type cache_slot) const
 
size_type size_from_file_length (stxxl::uint64 file_length) const
 
void write_page (int_type page_no, int_type cache_slot) const
 

Private Attributes

alloc_strategy_type m_alloc_strategy
 
bids_container_type m_bids
 
block_managerm_bm
 
simple_vector< block_type > * m_cache
 
bool m_exported
 
std::queue< int_typem_free_slots
 
filem_from
 
std::vector< unsigned char > m_page_status
 status of each page (valid_on_disk, uninitialized or dirty) More...
 
std::vector< int_typem_page_to_slot
 
pager_type m_pager
 
size_type m_size
 
simple_vector< int_typem_slot_to_page
 

Standard Types

enum  constants { block_size = BlockSize, page_size = PageSize, on_disk = -1 }
 
typedef ValueType value_type
 The type of elements stored in the vector. More...
 
typedef value_typereference
 reference to value_type More...
 
typedef const value_typeconst_reference
 constant reference to value_type More...
 
typedef value_typepointer
 pointer to value_type More...
 
typedef const value_typeconst_pointer
 constant pointer to value_type More...
 
typedef SizeType size_type
 an unsigned 64-bit integral type More...
 
typedef stxxl::int64 difference_type
 
typedef PagerType pager_type
 
typedef AllocStr alloc_strategy_type
 
typedef vector_iterator
< value_type,
alloc_strategy_type, size_type,
difference_type, block_size,
pager_type, page_size
iterator
 iterator used to iterate through a vector, see More Notes. More...
 
typedef const_vector_iterator
< value_type,
alloc_strategy_type, size_type,
difference_type, block_size,
pager_type, page_size
const_iterator
 constant iterator used to iterate through a vector, see More Notes. More...
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 

Member Typedef Documentation

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef AllocStr stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::alloc_strategy_type

Definition at line 849 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef bids_container_type::iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bids_container_iterator

Definition at line 896 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef bid_vector stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bids_container_type

Definition at line 895 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef typed_block<BlockSize, ValueType> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::block_type

type of the block used in disk-memory transfers

Definition at line 900 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef double_blocked_index<SizeType, PageSize, block_type::size> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::blocked_index_type

double-index type to reference individual elements in a block

Definition at line 902 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef vector_bufreader_reverse<const_iterator> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bufreader_reverse_type

vector_bufreader compatible with this vector

Definition at line 881 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef vector_bufreader<const_iterator> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bufreader_type

vector_bufreader compatible with this vector

Definition at line 878 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef vector_bufwriter<iterator> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bufwriter_type

vector_bufwriter compatible with this vector

Definition at line 875 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef bids_container_type::const_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_bids_container_iterator

Definition at line 897 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef const_vector_iterator<value_type, alloc_strategy_type, size_type, difference_type, block_size, pager_type, page_size> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_iterator

constant iterator used to iterate through a vector, see More Notes.

Definition at line 864 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef const value_type* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_pointer

constant pointer to value_type

Definition at line 843 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef const value_type& stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_reference

constant reference to value_type

Definition at line 839 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef std::reverse_iterator<const_iterator> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_reverse_iterator

Definition at line 867 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef stxxl::int64 stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::difference_type

Definition at line 846 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef vector_iterator<value_type, alloc_strategy_type, size_type, difference_type, block_size, pager_type, page_size> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::iterator

iterator used to iterate through a vector, see More Notes.

Definition at line 859 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef PagerType stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::pager_type

Definition at line 848 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef value_type* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::pointer

pointer to value_type

Definition at line 841 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef value_type& stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::reference

reference to value_type

Definition at line 837 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef std::reverse_iterator<iterator> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::reverse_iterator

Definition at line 866 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef SizeType stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::size_type

an unsigned 64-bit integral type

Definition at line 845 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
typedef ValueType stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::value_type

The type of elements stored in the vector.

Definition at line 835 of file vector.h.

Member Enumeration Documentation

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
anonymous enum
private
Enumerator
valid_on_disk 
uninitialized 
dirty 

Definition at line 913 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
enum stxxl::vector::constants
Enumerator
block_size 
page_size 
on_disk 

Definition at line 851 of file vector.h.

Constructor & Destructor Documentation

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::vector ( size_type  n = 0,
unsigned_type  npages = pager_type().size() 
)
inline

Constructs external vector with n elements.

Parameters
nNumber of elements.
npagesNumber of cached pages.

Definition at line 953 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::vector ( file from,
size_type  size = size_type(-1),
unsigned_type  npages = pager_type().size() 
)
inline

Construct vector from a file.

Parameters
fromfile to be constructed from
sizeNumber of elements.
npagesNumber of cached pages.
Warning
Only one vector can be assigned to a particular (physical) file. The block size of the vector must be a multiple of the element size sizeof(ValueType) and the page size (4096).

Definition at line 1244 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::vector ( const vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType > &  obj)
inline

copy-constructor

Definition at line 1289 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::~vector ( )
inline

Definition at line 1478 of file vector.h.

Member Function Documentation

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::_resize ( size_type  n)
inlineprivate

Resize vector, only allow capacity growth.

Definition at line 1112 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::_resize_shrink_capacity ( size_type  n)
inlineprivate

Resize vector, also allow reduction of external memory capacity.

Definition at line 1130 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::allocate_page_cache ( ) const
inline

Allocate page cache, must be called to allow access to elements.

Definition at line 1007 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::at ( size_type  offset)
inline

access the element at the given vector's offset

Definition at line 1421 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::at ( size_type  offset) const
inline

access the element at the given vector's offset

Definition at line 1427 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::back ( )
inline

Returns a reference to the last element, see More Notes.

Definition at line 1212 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::back ( ) const
inline

Returns a constant reference to the last element, see More Notes.

Definition at line 1222 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::begin ( )
inline

returns an iterator pointing to the beginning of the vector, see More Notes.

Definition at line 1343 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::begin ( ) const
inline

returns a const_iterator pointing to the beginning of the vector, see More Notes.

Definition at line 1348 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bids_container_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bid ( const size_type offset)
inlineprivate

Definition at line 1574 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bids_container_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bid ( const blocked_index_type offset)
inlineprivate

Definition at line 1580 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_bids_container_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bid ( const size_type offset) const
inlineprivate

Definition at line 1586 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_bids_container_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::bid ( const blocked_index_type offset) const
inlineprivate

Definition at line 1592 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::block_externally_updated ( size_type  offset) const
inlineprivate

Definition at line 1714 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::block_externally_updated ( const blocked_index_type offset) const
inlineprivate

Definition at line 1721 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
size_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::capacity ( ) const
inline

Return the number of elelemtsn for which external memory has been allocated. capacity() is always greator than or equal to size().

Definition at line 1039 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::cbegin ( ) const
inline

returns a const_iterator pointing to the beginning of the vector, see More Notes.

Definition at line 1353 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::cend ( ) const
inline

returns a const_iterator pointing beyond the end of the vector, see More Notes.

Definition at line 1368 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::clear ( )
inline

Erases all of the elements and deallocates all external memory that is occupied.

Definition at line 1174 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_element ( size_type  offset) const
inlineprivate

Definition at line 1726 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::const_element ( const blocked_index_type offset) const
inlineprivate

Definition at line 1731 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::crbegin ( ) const
inline

returns a reverse_iterator pointing to the end of the vector.

Definition at line 1384 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::crend ( ) const
inline

returns a reverse_iterator pointing beyond the beginning of the vector.

Definition at line 1399 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::deallocate_page_cache ( ) const
inline

allows to free the cache, but you may not access any element until call allocate_page_cache() again

Definition at line 1016 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::element ( size_type  offset)
inlineprivate

Definition at line 1638 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::element ( const blocked_index_type offset)
inlineprivate

Definition at line 1646 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bool stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::empty ( ) const
inline

true if the vector's size is zero.

Definition at line 1032 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::end ( )
inline

returns an iterator pointing beyond the end of the vector, see More Notes.

Definition at line 1358 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::end ( ) const
inline

returns a const_iterator pointing beyond the end of the vector, see More Notes.

Definition at line 1363 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::export_files ( std::string  filename_prefix)
inline

Export data such that it is persistent on the file system. Resulting files will be numbered ascending.

Definition at line 1524 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
stxxl::uint64 stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::file_length ( ) const
inlineprivate

Definition at line 932 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::flush ( ) const
inline

Flushes the cache pages to the external memory.

Definition at line 1445 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::front ( )
inline

Returns a reference to the first element, see More Notes.

Definition at line 1217 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::front ( ) const
inline

Returns a constant reference to the first element, see More Notes.

Definition at line 1227 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
file* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::get_file ( ) const
inline

Get the file associated with this vector, or NULL.

Definition at line 1541 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bool stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::is_element_cached ( size_type  offset) const
inline

return true if the given vector offset is in cache

Definition at line 1434 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bool stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::is_page_cached ( const blocked_index_type offset) const
inlineprivate

Definition at line 1772 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
unsigned_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::numpages ( ) const
inline

Number of pages used by the pager.

Definition at line 1566 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
vector& stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::operator= ( const vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType > &  obj)
inline

assignment operator

Definition at line 1327 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::operator[] ( size_type  offset)
inline

access the element at the given vector's offset

Definition at line 1410 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reference stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::operator[] ( size_type  offset) const
inline

access the element at the given vector's offset

Definition at line 1415 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::page_externally_updated ( unsigned_type  page_no) const
inlineprivate

Definition at line 1696 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::pop_back ( )
inline

Removes the last element (without returning it, see back()).

Definition at line 1201 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::push_back ( const_reference  obj)
inline

Append a new element at the end.

Examples:
examples/containers/vector1.cpp.

Definition at line 1194 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
size_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::raw_capacity ( ) const
inline

Returns the number of bytes that the vector has allocated on disks.

Definition at line 1044 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::rbegin ( )
inline

returns a reverse_iterator pointing to the end of the vector.

Definition at line 1374 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::rbegin ( ) const
inline

returns a reverse_iterator pointing to the end of the vector.

Definition at line 1379 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::read_page ( int_type  page_no,
int_type  cache_slot 
) const
inlineprivate

Definition at line 1599 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::rend ( )
inline

returns a reverse_iterator pointing beyond the beginning of the vector.

Definition at line 1389 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
const_reverse_iterator stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::rend ( ) const
inline

returns a reverse_iterator pointing beyond the beginning of the vector.

Definition at line 1394 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::reserve ( size_type  n)
inline

Reserves at least n elements in external memory.

If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional external memory. If the request is successful, then capacity() is greater than or equal to n; otherwise capacity() is unchanged. In either case, size() is unchanged.

Definition at line 1057 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::resize ( size_type  n)
inline

Resize vector contents to n items.

Warning
this will not call the constructor of objects in external memory!

Definition at line 1092 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::resize ( size_type  n,
bool  shrink_capacity 
)
inline

Resize vector contents to n items, and allow the allocated external memory to shrink. Internal memory allocation remains unchanged.

Warning
this will not call the constructor of objects in external memory!

Definition at line 1100 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
template<typename ForwardIterator >
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::set_content ( const ForwardIterator &  bid_begin,
const ForwardIterator &  bid_end,
size_type  n 
)
inline

Set the blocks and the size of this container explicitly. The vector must be completely empty before.

Definition at line 1554 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
size_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::size_from_file_length ( stxxl::uint64  file_length) const
inlineprivate

Definition at line 924 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::swap ( vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType > &  obj)
inline

swap content

Definition at line 986 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
void stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::write_page ( int_type  page_no,
int_type  cache_slot 
) const
inlineprivate

Definition at line 1617 of file vector.h.

Member Data Documentation

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
alloc_strategy_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_alloc_strategy
private

Definition at line 907 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bids_container_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_bids
private

Definition at line 909 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
block_manager* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_bm
private

Definition at line 921 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
simple_vector<block_type>* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_cache
mutableprivate

Definition at line 919 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
bool stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_exported
private

Definition at line 922 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
std::queue<int_type> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_free_slots
mutableprivate

Definition at line 918 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
file* stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_from
private

Definition at line 920 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
std::vector<unsigned char> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_page_status
mutableprivate

status of each page (valid_on_disk, uninitialized or dirty)

Definition at line 915 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
std::vector<int_type> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_page_to_slot
mutableprivate

Definition at line 916 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
pager_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_pager
mutableprivate

Definition at line 910 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
size_type stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_size
private

Definition at line 908 of file vector.h.

template<typename ValueType, unsigned PageSize, typename PagerType, unsigned BlockSize, typename AllocStr, typename SizeType>
simple_vector<int_type> stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::m_slot_to_page
mutableprivate

Definition at line 917 of file vector.h.


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