Stxxl
1.3.2
|
External vector container. More...
#include <vector.h>
Public Types | |
enum | constants { block_size = BlkSize_, page_size = PgSz_, n_pages = pager_type::n_pages, on_disk = -1 } |
typedef Tp_ | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef SzTp_ | size_type |
typedef stxxl::int64 | difference_type |
typedef const value_type * | const_pointer |
typedef PgTp_ | 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 |
typedef const_vector_iterator < value_type, alloc_strategy_type, size_type, difference_type, block_size, pager_type, page_size > | const_iterator |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef bid_vector< block_size > | bids_container_type |
typedef bids_container_type::iterator | bids_container_iterator |
typedef bids_container_type::const_iterator | const_bids_container_iterator |
typedef typed_block< BlkSize_, Tp_ > | block_type |
typedef double_blocked_index < SzTp_, PgSz_, block_type::size > | blocked_index_type |
Public Member Functions | |
vector (size_type n=0) | |
void | swap (vector &obj) |
void | allocate_page_cache () const |
void | deallocate_page_cache () const |
size_type | capacity () const |
size_type | raw_capacity () const |
Returns the number of bytes that the vector has allocated on disks. More... | |
void | reserve (size_type n) |
void | resize (size_type n) |
void | resize (size_type n, bool shrink_capacity) |
void | clear () |
void | push_back (const_reference obj) |
void | pop_back () |
reference | back () |
reference | front () |
const_reference | back () const |
const_reference | front () const |
vector (file *from, size_type size=size_type(-1)) | |
Construct vector from a file. More... | |
vector (const vector &obj) | |
vector & | operator= (const vector &obj) |
size_type | size () const |
bool | empty () const |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
const_reverse_iterator | crend () const |
reference | operator[] (size_type offset) |
const_reference | operator[] (size_type offset) const |
bool | is_element_cached (size_type offset) const |
void | flush () const |
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... | |
file * | get_file () const |
Get the file associated with this vector, or NULL. More... | |
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... | |
External vector container.
For semantics of the methods see documentation of the STL std::vector
Tp_ | type of contained objects (POD with no references to internal memory) |
PgSz_ | number of blocks in a page |
PgTp_ | pager type, random_pager<x> or lru_pager<x> , where x is number of pages, default is lru_pager<8> |
BlkSize_ | external block size in bytes, default is 2 MiB |
AllocStr_ | one of allocation strategies: striping , RC , SR , or FR default is RC |
Memory consumption: BlkSize_*x*PgSz_ bytes
|
inline |
Construct vector from a file.
from | file to be constructed from |
vector
can be assigned to a particular (physical) file. The block size of the vector must be a multiple of the element size sizeof(Tp_)
and the page size (4096). References typed_block< RawSize_, T_, NRef_, InfoType_ >::has_only_data, and file::set_size().
|
inline |
Export data such that it is persistent on the file system. Resulting files will be numbered ascending.
References typed_block< RawSize_, T_, NRef_, InfoType_ >::size.
|
inline |
Get the file associated with this vector, or NULL.
|
inline |
Returns the number of bytes that the vector has allocated on disks.
References typed_block< RawSize_, T_, NRef_, InfoType_ >::raw_size.
|
inline |
Set the blocks and the size of this container explicitly. The vector must be completely empty before.
References typed_block< RawSize_, T_, NRef_, InfoType_ >::size.