disk_vector represents a large constant-size vector that does not necessarily fit in memory.
More...
#include <disk_vector.h>
|
std::string | path_ |
| the path to the file this disk_vector uses for storage
|
|
T * | start_ |
| the beginning of where the storage file is memory mapped
|
|
uint64_t | size_ |
| this size of the memory-mapped file (in regards to T objects)
|
|
int | file_desc_ |
| the file descriptor used to open and close the mmap file
|
|
template<class T>
class meta::util::disk_vector< T >
disk_vector represents a large constant-size vector that does not necessarily fit in memory.
- Parameters
-
path | The path to save this vector as. If the file exists, it is treated as disk_vector. If the file doesn't exist, a new one is created. |
size | The number of elements that will be in this vector. If not specified, the disk_vector assumes that the file already exists. |
- Parameters
-
idx | The index of the vector to retrieve |
- Returns
- a reference to the element at position idx in the vector container
- Parameters
-
idx | The index of the vector to retrieve |
- Returns
- a reference to the element at position idx in the vector container
- Parameters
-
idx | The index of the vector to retrieve |
- Returns
- a reference to the element at position idx in the vector
The function automatically checks whether idx is within the bounds of valid elements in the vector, throwing an exception if it is not (i.e., if idx is greater or equal than its size). This is in contrast with member operator[], that does not check against bounds.
- Parameters
-
idx | The index of the vector to retrieve |
- Returns
- a reference to the element at position idx in the vector
The function automatically checks whether idx is within the bounds of valid elements in the vector, throwing an exception if it is not (i.e., if idx is greater or equal than its size). This is in contrast with member operator[], that does not check against bounds.
- Returns
- the number of elements this vector stores
- Returns
- an iterator to the beginning of this container
- Returns
- an iterator to the end of this container
The documentation for this class was generated from the following files: