Definition at line 14 of file map_vector.hpp.
Public Types | |
typedef int | yes_i_am_vector |
it define that it is a vector | |
typedef vector_key_iterator | iterator_key |
iterator for the vector | |
typedef T | value_type |
Type of the value the vector is storing. | |
Public Member Functions | |
size_t | size () const |
return the size of the vector | |
void | resize (size_t slot) |
void | clear () |
Remove all the element from the vector. More... | |
void | add (const T &v) |
It insert a new object on the vector, eventually it reallocate the grid. More... | |
void | add (T &&v) |
It insert a new object on the vector, eventually it reallocate the grid. More... | |
void | add () |
Add an empty object (it call the default constructor () ) at the end of the vector. More... | |
void | erase (typename std::vector< T >::iterator start, typename std::vector< T >::iterator end) |
Erase the elements from start to end. More... | |
void | remove (size_t key) |
Remove one entry from the vector. More... | |
T * | begin () |
Return an std compatible iterator to the first element. More... | |
T * | end () |
Return an std compatible iterator to the past the last element. More... | |
const T * | begin () const |
Return an std compatible iterator to the first element. More... | |
const T * | end () const |
Return an std compatible iterator to the past the last element. More... | |
T & | last () |
Get the last element. More... | |
const T & | last () const |
Get the last element. More... | |
template<unsigned int p> | |
T & | get (size_t id) |
Get an element of the vector. More... | |
void | setMemory (PtrMemory &mem) |
template<unsigned int p> | |
const T & | get (size_t id) const |
Get an element of the vector. More... | |
T & | get (size_t id) |
Get an element of the vector. More... | |
const T & | get (size_t id) const |
Get an element of the vector. More... | |
void | fill (unsigned char fl) |
it fill all the memory of fl patterns More... | |
void | reserve (size_t ns) |
reserve a memory space in advance to avoid reallocation More... | |
vector () noexcept | |
Constructor, vector of size 0. | |
vector (size_t sz) noexcept | |
Constructor, vector of size sz. | |
vector (const vector< T, PtrMemory, layout_base, gp, STD_VECTOR > &v) noexcept | |
Constructor from another vector. | |
vector (vector< T, PtrMemory, layout_base, gp, STD_VECTOR > &&v) noexcept | |
Constructor from another vector. | |
~vector () noexcept | |
destructor | |
void | swap (openfpm::vector< T, PtrMemory, layout_base, gp, STD_VECTOR > &v) |
vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > & | operator= (const vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > &v) |
Operator= copy the vector into another. More... | |
vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > & | operator= (vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > &&v) |
Operator= copy the vector into another. More... | |
bool | operator!= (const vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > &v) const |
Check that two vectors are equal. More... | |
bool | operator== (const vector< T, HeapMemory, layout_base, grow_policy_double, STD_VECTOR > &v) const |
Check that two vectors are not equal. More... | |
vector_key_iterator | getIterator () const |
Get iterator. More... | |
void * | getPointer () |
Return the pointer to the chunk of memory. More... | |
const void * | getPointer () const |
Return the pointer to the chunk of memory. More... | |
size_t | getLastError () |
Return the last error. More... | |
void | vector_overflow (size_t v1) const |
check that the id does not overflow the buffer More... | |
Static Public Member Functions | |
static bool | noPointers () |
This class has pointer inside. More... | |
Private Types | |
typedef memory_traits_lin< T >::type | layout |
Memory layout. | |
template<typename lb > | |
using | layout_base = memory_traits_lin< lb > |
function for memory layout | |
Private Attributes | |
size_t | v_size |
PtrMemory * | mem |
1-D static grid | |
size_t | err_code |
Error code. | |
|
inline |
It insert a new object on the vector, eventually it reallocate the grid.
v | element to add |
vector_isel<T>::value
Definition at line 80 of file map_vector.hpp.
|
inline |
It insert a new object on the vector, eventually it reallocate the grid.
v | element to add |
vector_isel<T>::value
Definition at line 94 of file map_vector.hpp.
|
inline |
Add an empty object (it call the default constructor () ) at the end of the vector.
Definition at line 103 of file map_vector.hpp.
|
inline |
Return an std compatible iterator to the first element.
Definition at line 140 of file map_vector.hpp.
|
inline |
Return an std compatible iterator to the first element.
Definition at line 160 of file map_vector.hpp.
|
inline |
Remove all the element from the vector.
Definition at line 66 of file map_vector.hpp.
|
inline |
Return an std compatible iterator to the past the last element.
Definition at line 150 of file map_vector.hpp.
|
inline |
Return an std compatible iterator to the past the last element.
Definition at line 170 of file map_vector.hpp.
|
inline |
Erase the elements from start to end.
start | element |
end | element |
Definition at line 117 of file map_vector.hpp.
|
inline |
it fill all the memory of fl patterns
WARNING does not assign a value to each element but it fill the memory Useful to fast set the memory to zero
fl | byte to fill |
Definition at line 290 of file map_vector.hpp.
|
inline |
Get an element of the vector.
p | must be 0 |
id | element to get |
Definition at line 212 of file map_vector.hpp.
|
inline |
Get an element of the vector.
p | must be 0 |
id | element to get |
Definition at line 238 of file map_vector.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 257 of file map_vector.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 273 of file map_vector.hpp.
|
inline |
|
inline |
|
inline |
Return the pointer to the chunk of memory.
Definition at line 439 of file map_vector.hpp.
|
inline |
Return the pointer to the chunk of memory.
Definition at line 449 of file map_vector.hpp.
|
inline |
Get the last element.
Definition at line 180 of file map_vector.hpp.
|
inline |
Get the last element.
Definition at line 194 of file map_vector.hpp.
|
inlinestatic |
|
inline |
Check that two vectors are equal.
vector | to compare |
Definition at line 380 of file map_vector.hpp.
|
inline |
Operator= copy the vector into another.
Definition at line 352 of file map_vector.hpp.
|
inline |
Operator= copy the vector into another.
v | vector to copy |
Definition at line 366 of file map_vector.hpp.
|
inline |
Check that two vectors are not equal.
vector | to compare |
Definition at line 394 of file map_vector.hpp.
|
inline |
Remove one entry from the vector.
key | element to remove |
Definition at line 127 of file map_vector.hpp.
|
inline |
reserve a memory space in advance to avoid reallocation
ns | number of element the memory has to store |
Definition at line 301 of file map_vector.hpp.
|
inline |
\ brief Resize the vector to contain n elements
slot | number of elements |
Definition at line 55 of file map_vector.hpp.
|
inline |
swap the content of the vector
v | vector to be swapped with |
Definition at line 342 of file map_vector.hpp.
|
inline |
check that the id does not overflow the buffer
v1 | to check |
Definition at line 479 of file map_vector.hpp.
|
private |
Actual size of the vector, warning: it is not the space allocated in grid grid size increase by a fixed amount every time we need a vector bigger than the actually allocated space
Definition at line 25 of file map_vector.hpp.