Implementation of 1-D std::vector like structure. More...
Implementation of 1-D std::vector like structure.
this implementation is just a wrapper for the std::vector. It work a little different from vector. In general for a normal vector of objects A vector if you resize to zero, the destructor of the object A is called.This vector differ in this behaviour. the destructor is not called. This give the possibility to have a set of fully retained objects. This class is just a simple wrapper for the normal openfpm::vector where size and resize are redefined to change the behaviour. A destructive resize is callable with resize_base(), and the internal size of the base vactor can be queried with size_base()
T | base type |
Definition at line 930 of file map_vector_std.hpp.
#include <map_vector_std.hpp>
Public Member Functions | |
size_t | size () |
return the size of the vector | |
size_t | size_base () |
return the base size of the vector | |
void | resize (size_t sz) |
resize the vector retaining the objects | |
void | clear () |
Eliminate all elements. | |
void | add () |
Add another element. | |
void | resize_base (size_t sz) |
resize the base vector (this kill the objects) | |
T & | get (size_t id) |
Get an element of the vector. | |
T & | operator[] (size_t id) |
Get an element of the vector. | |
T & | last () |
Get an element of the vector. | |
void | swap (openfpm::vector_fr< T > &v) |
Private Types | |
typedef vector< T, HeapMemory, memory_traits_lin, grow_policy_double, STD_VECTOR > | base_type |
Private Attributes | |
size_t | v_size = 0 |
size of the vector | |
|
private |
Definition at line 933 of file map_vector_std.hpp.
|
inline |
Add another element.
Definition at line 991 of file map_vector_std.hpp.
|
inline |
Eliminate all elements.
Definition at line 982 of file map_vector_std.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 1014 of file map_vector_std.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 1038 of file map_vector_std.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 1026 of file map_vector_std.hpp.
|
inline |
resize the vector retaining the objects
new | size of the vector |
Definition at line 965 of file map_vector_std.hpp.
|
inline |
resize the base vector (this kill the objects)
new | size of the vector |
Definition at line 1001 of file map_vector_std.hpp.
|
inline |
|
inline |
return the base size of the vector
Definition at line 955 of file map_vector_std.hpp.
|
inline |
swap the content of the vector
v | vector to be swapped with |
Definition at line 1048 of file map_vector_std.hpp.
|
private |
size of the vector
Definition at line 936 of file map_vector_std.hpp.