OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR > Class Template Reference

Implementation of 1-D std::vector like structure. More...

Detailed Description

template<typename T>
class openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >

Implementation of 1-D std::vector like structure.

this implementation is just a wrapper for the std::vector in the case of data where the members cannot be parsed see openFPM_data wiki for more information

Create add and access the elements

Parameters
Tbase type

Definition at line 100 of file map_vector.hpp.

#include <map_vector.hpp>

Data Structures

struct  pack_cond
 Structures that do a nested packing, depending on the existence of 'pack' function inside of the object. More...
 
struct  pack_cond< true, T1, Memory1, prp...>
 Structures that do a nested packing, depending on the existence of 'pack' function inside of the object. More...
 
struct  packMem_cond
 Structures that calculate memory for an object, depending on the existence of 'packMem' function inside the object. More...
 
struct  packMem_cond< true, T1, prp...>
 Structures that calculate memory for an object, depending on the existence of 'packMem' function inside the object. More...
 
struct  packRequest_cond
 Structures that do a pack request, depending on the existence of 'packRequest' function inside of the object. More...
 
struct  packRequest_cond< true, T1, prp...>
 Structures that do a pack request, depending on the existence of 'packRequest' function inside of the object. More...
 
struct  unpack_cond
 Structures that do a nested unpacking, depending on the existence of 'pack' function inside the object. More...
 
struct  unpack_cond< true, T1, Memory1, prp...>
 Structures that do a nested unpacking, depending on the existence of 'pack' function inside the object. More...
 

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.
 
typedef void base_to_copy
 

Public Member Functions

template<int... prp>
void pack (ExtPreAlloc< HeapMemory > &mem, Pack_stat &sts) const
 pack a vector More...
 
template<int... prp>
void packRequest (size_t &req) const
 Insert an allocation request into the vector. More...
 
template<unsigned int... prp>
void unpack (ExtPreAlloc< HeapMemory > &mem, Unpack_stat &ps)
 unpack a vector More...
 
bool save (const std::string &file) const
 Save this object into file. More...
 
bool load (const std::string &file)
 Load this object from file. More...
 
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...
 
template<typename Mem , typename l , template< typename > class lb, typename gp >
void add (const openfpm::vector< T, Mem, l, lb, gp > &eles)
 add elements to the vector More...
 
template<typename S >
void add (const S &v)
 It insert a new object on the vector, eventually it reallocate the grid. More...
 
template<typename S >
void add (const S &&v)
 It insert a new object on the vector, eventually it reallocate the grid. More...
 
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base, unsigned int... args>
void add_prp (const vector< S, M, typename layout_base< S >::type, layout_base, gp, impl > &v)
 It add the element of a source vector to this vector. More...
 
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base, unsigned int... args>
void add_prp (const T &v)
 It add the element it is equivalent to add. 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...
 
auto begin () -> decltype(base.begin())
 Return an std compatible iterator to the first element. More...
 
auto end () -> decltype(base.begin())
 Return an std compatible iterator to the last element. More...
 
auto begin () const -> const decltype(base.begin())
 Return an std compatible iterator to the first element. More...
 
auto end () const -> const decltype(base.begin())
 Return an std compatible iterator to the last element. More...
 
T & last ()
 Get the last element. More...
 
const T & last () const
 Get the last element. More...
 
openfpm::vector< T > duplicate () const
 Duplicate the vector. More...
 
void swap (std::vector< T > &&v)
 swap the memory between the two vector More...
 
void unique ()
 It eliminate double entries. More...
 
void sort ()
 It sort the vector. More...
 
template<unsigned int p>
T & get (size_t id)
 Get an element of the vector. More...
 
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, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &v) noexcept
 Constructor from another vector.
 
 vector (const std::initializer_list< T > &v)
 Initializer from constructor. More...
 
 vector (vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &&v) noexcept
 Constructor from another vector.
 
 ~vector () noexcept
 destructor
 
void swap (openfpm::vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &v)
 
void swap (openfpm::vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &&v)
 
vector< T, HeapMemory, layout,
memory_traits_lin,
grow_policy_double, STD_VECTOR > & 
operator= (const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &v)
 Operator= copy the vector into another. More...
 
template<typename Mem , typename gp >
vector< T, HeapMemory, layout,
memory_traits_lin,
grow_policy_double, STD_VECTOR > & 
operator= (const vector< T, Mem, layout, memory_traits_lin, gp, STD_VECTOR > &v)
 Operator= copy the vector into another. More...
 
vector< T, HeapMemory, layout,
memory_traits_lin,
grow_policy_double, STD_VECTOR > & 
operator= (vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &&v)
 Operator= copy the vector into another. More...
 
template<typename Mem , typename gp >
vector< T, HeapMemory, layout,
memory_traits_lin,
grow_policy_double, STD_VECTOR > & 
operator= (vector< T, Mem, layout, memory_traits_lin, gp, STD_VECTOR > &&v)
 Operator= copy the vector into another. More...
 
bool operator!= (const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &v) const
 Check that two vectors are equal. More...
 
bool operator== (const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &v) const
 Check that two vectors are not equal. More...
 
vector_key_iterator getIterator () const
 Get an iterator over all the elements of the vector. More...
 
vector_key_iterator getIteratorTo (size_t k) const
 Get iterator until a specified element. More...
 
template<int... prp>
size_t packMem (size_t n, size_t e) const
 Calculate the memory size required to allocate n elements. 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...
 
long int who ()
 

Static Public Member Functions

static bool pack ()
 Indicate that the vector has a packer function.
 
static bool packRequest ()
 Indicate that the vector has the function packRequest.
 
static bool packMem ()
 Indicate that the vector has the function pack Memory.
 
static size_t calculateMemDummy (size_t n, size_t e)
 Calculate the memory size required to allocate n elements. More...
 
static size_t calculateNMem (size_t n)
 How many allocation are required to create n-elements. More...
 
static bool noPointers ()
 This class has pointer inside. More...
 

Private Types

typedef memory_traits_lin< T >
::type 
layout
 

Private Attributes

std::vector< T > base
 1-D static grid
 
size_t err_code = 0
 Error code.
 

Constructor & Destructor Documentation

template<typename T >
openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::vector ( const std::initializer_list< T > &  v)
inline

Initializer from constructor.

Parameters
vInitializer list

Definition at line 716 of file map_vector.hpp.

Member Function Documentation

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( const T &  v)
inline

It insert a new object on the vector, eventually it reallocate the grid.

Parameters
velement to add
Warning
It is not thread safe should not be used in multi-thread environment reallocation, work only on cpu

vector_isel<T>::value

Definition at line 183 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( T &&  v)
inline

It insert a new object on the vector, eventually it reallocate the grid.

Parameters
velement to add
Warning
It is not thread safe should not be used in multi-thread environment reallocation, work only on cpu

vector_isel<T>::value

Definition at line 212 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( )
inline

Add an empty object (it call the default constructor () ) at the end of the vector.

Definition at line 235 of file map_vector.hpp.

template<typename T >
template<typename Mem , typename l , template< typename > class lb, typename gp >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( const openfpm::vector< T, Mem, l, lb, gp > &  eles)
inline

add elements to the vector

Parameters
eleselements to add

Definition at line 260 of file map_vector.hpp.

template<typename T >
template<typename S >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( const S &  v)
inline

It insert a new object on the vector, eventually it reallocate the grid.

Parameters
velement to add
Warning
It is not thread safe should not be used in multi-thread environment reallocation, work only on cpu

vector_isel<T>::value

Definition at line 294 of file map_vector.hpp.

template<typename T >
template<typename S >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add ( const S &&  v)
inline

It insert a new object on the vector, eventually it reallocate the grid.

Parameters
velement to add
Warning
It is not thread safe should not be used in multi-thread environment reallocation, work only on cpu

vector_isel<T>::value

Definition at line 323 of file map_vector.hpp.

template<typename T >
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base, unsigned int... args>
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add_prp ( const vector< S, M, typename layout_base< S >::type, layout_base, gp, impl > &  v)
inline

It add the element of a source vector to this vector.

The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required

Template Parameters
SBase object of the source vector
Mmemory type of the source vector
gpGrow policy of the source vector
argsone or more number that define which property to set-up
Parameters
vsource vector

Definition at line 363 of file map_vector.hpp.

template<typename T >
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base, unsigned int... args>
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::add_prp ( const T &  v)
inline

It add the element it is equivalent to add.

exist to respect a general interface template parameters are unused the explanation refer to the interface specification, but is unused in this case

Template Parameters
SBase object of the source vector
Mmemory type of the source vector
gpGrow policy of the source vector
argsone or more number that define which property to set-up
Parameters
vsource vector

Definition at line 391 of file map_vector.hpp.

template<typename T >
auto openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::begin ( ) -> decltype(base.begin())
inline

Return an std compatible iterator to the first element.

Returns
an iterator to the first element

Definition at line 435 of file map_vector.hpp.

template<typename T >
auto openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::begin ( ) const -> const decltype(base.begin())
inline

Return an std compatible iterator to the first element.

Returns
an iterator to the first element

Definition at line 455 of file map_vector.hpp.

template<typename T >
static size_t openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::calculateMemDummy ( size_t  n,
size_t  e 
)
inlinestatic

Calculate the memory size required to allocate n elements.

Calculate the total size required to store n-elements in a vector

Parameters
nnumber of elements
eunused
Returns
the size of the allocation number e

Definition at line 946 of file map_vector.hpp.

template<typename T >
static size_t openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::calculateNMem ( size_t  n)
inlinestatic

How many allocation are required to create n-elements.

Parameters
nnumber of elements
Returns
the number of allocations

Definition at line 958 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::clear ( )
inline

Remove all the element from the vector.

Definition at line 166 of file map_vector.hpp.

template<typename T >
openfpm::vector<T> openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::duplicate ( ) const
inline

Duplicate the vector.

Returns
the duplicated vector

Definition at line 509 of file map_vector.hpp.

template<typename T >
auto openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::end ( ) -> decltype(base.begin())
inline

Return an std compatible iterator to the last element.

Returns
an iterator to the last element

Definition at line 445 of file map_vector.hpp.

template<typename T >
auto openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::end ( ) const -> const decltype(base.begin())
inline

Return an std compatible iterator to the last element.

Returns
an iterator to the last element

Definition at line 465 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::erase ( typename std::vector< T >::iterator  start,
typename std::vector< T >::iterator  end 
)
inline

Erase the elements from start to end.

Parameters
startelement
endelement

Definition at line 405 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::fill ( unsigned char  fl)
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

Parameters
flbyte to fill

Definition at line 649 of file map_vector.hpp.

template<typename T >
template<unsigned int p>
T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::get ( size_t  id)
inline

Get an element of the vector.

Template Parameters
pmust be 0
Parameters
idelement to get
Returns
the reference to the element

Definition at line 566 of file map_vector.hpp.

template<typename T >
template<unsigned int p>
const T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::get ( size_t  id) const
inline

Get an element of the vector.

Template Parameters
pmust be 0
Parameters
idelement to get
Returns
the reference to the element

Definition at line 590 of file map_vector.hpp.

template<typename T >
T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::get ( size_t  id)
inline

Get an element of the vector.

Parameters
idelement to get
Returns
the element reference

Definition at line 612 of file map_vector.hpp.

template<typename T >
const T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::get ( size_t  id) const
inline

Get an element of the vector.

Parameters
idelement to get
Returns
the element value

Definition at line 630 of file map_vector.hpp.

template<typename T >
vector_key_iterator openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::getIterator ( ) const
inline

Get an iterator over all the elements of the vector.

Returns
an iterator

Definition at line 892 of file map_vector.hpp.

template<typename T >
vector_key_iterator openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::getIteratorTo ( size_t  k) const
inline

Get iterator until a specified element.

Parameters
kkey
Returns
an iterator

Definition at line 907 of file map_vector.hpp.

template<typename T >
size_t openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::getLastError ( )
inline

Return the last error.

Returns
erro code

Definition at line 1002 of file map_vector.hpp.

template<typename T >
void* openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::getPointer ( )
inline

Return the pointer to the chunk of memory.

Returns
the pointer to the chunk of memory

Definition at line 969 of file map_vector.hpp.

template<typename T >
const void* openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::getPointer ( ) const
inline

Return the pointer to the chunk of memory.

Returns
the pointer to the chunk of memory

Definition at line 982 of file map_vector.hpp.

template<typename T >
T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::last ( )
inline

Get the last element.

Returns
the last element as reference

Definition at line 475 of file map_vector.hpp.

template<typename T >
const T& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::last ( ) const
inline

Get the last element.

Returns
the last element as reference

Definition at line 492 of file map_vector.hpp.

template<typename T >
bool openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::load ( const std::string &  file)
inline

Load this object from file.

Parameters
filefilename
Returns
true if succed

Definition at line 248 of file map_vector.hpp.

template<typename T >
static bool openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::noPointers ( )
inlinestatic

This class has pointer inside.

Returns
false

Definition at line 992 of file map_vector.hpp.

template<typename T >
bool openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator!= ( const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &  v) const
inline

Check that two vectors are equal.

Parameters
vvector to compare
Returns
true if they differs

Definition at line 870 of file map_vector.hpp.

template<typename T >
vector<T,HeapMemory,layout,memory_traits_lin,grow_policy_double,STD_VECTOR>& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator= ( const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &  v)
inline

Operator= copy the vector into another.

Parameters
vvector to copy
Returns
itself

Definition at line 778 of file map_vector.hpp.

template<typename T >
template<typename Mem , typename gp >
vector<T,HeapMemory,layout,memory_traits_lin,grow_policy_double,STD_VECTOR>& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator= ( const vector< T, Mem, layout, memory_traits_lin, gp, STD_VECTOR > &  v)
inline

Operator= copy the vector into another.

Returns
itself

Definition at line 805 of file map_vector.hpp.

template<typename T >
vector<T,HeapMemory,layout,memory_traits_lin,grow_policy_double,STD_VECTOR>& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator= ( vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &&  v)
inline

Operator= copy the vector into another.

Parameters
vvector to copy
Returns
itself

Definition at line 836 of file map_vector.hpp.

template<typename T >
template<typename Mem , typename gp >
vector<T,HeapMemory,layout,memory_traits_lin,grow_policy_double,STD_VECTOR>& openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator= ( vector< T, Mem, layout, memory_traits_lin, gp, STD_VECTOR > &&  v)
inline

Operator= copy the vector into another.

Parameters
vvector to copy
Returns
itself

Definition at line 853 of file map_vector.hpp.

template<typename T >
bool openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::operator== ( const vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &  v) const
inline

Check that two vectors are not equal.

Parameters
vvector to compare
Returns
true if the vector match

Definition at line 882 of file map_vector.hpp.

template<typename T >
template<int... prp>
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::pack ( ExtPreAlloc< HeapMemory > &  mem,
Pack_stat sts 
) const
inline

pack a vector

Parameters
mempreallocated memory where to pack the vector
stspack-stat info

Definition at line 171 of file map_vector.hpp.

template<typename T >
template<int... prp>
size_t openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::packMem ( size_t  n,
size_t  e 
) const
inline

Calculate the memory size required to allocate n elements.

Calculate the total size required to store n-elements in a vector

Parameters
nnumber of elements
eunused
Returns
the size of the allocation number e

Definition at line 925 of file map_vector.hpp.

template<typename T >
template<int... prp>
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::packRequest ( size_t &  req) const
inline

Insert an allocation request into the vector.

Template Parameters
prpproperties to pack
Parameters
reqcounter with the byte required to pack the vector

Definition at line 186 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::remove ( size_t  key)
inline

Remove one entry from the vector.

Parameters
keyelement to remove

Definition at line 419 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::reserve ( size_t  ns)
inline

reserve a memory space in advance to avoid reallocation

Parameters
nsnumber of element the memory has to store

Definition at line 662 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::resize ( size_t  slot)
inline

\ brief Resize the vector to contain n elements

Parameters
slotnumber of elements

Definition at line 143 of file map_vector.hpp.

template<typename T >
bool openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::save ( const std::string &  file) const
inline

Save this object into file.

Parameters
filefilename
Returns
true if succed

Definition at line 216 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::sort ( )
inline

It sort the vector.

Note
The base object must have an operator< defined

Definition at line 549 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::swap ( std::vector< T > &&  v)
inline

swap the memory between the two vector

Parameters
vvector to swap

Definition at line 522 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::swap ( openfpm::vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &  v)
inline

swap the content of the vector

Parameters
vvector to be swapped with

Definition at line 750 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::swap ( openfpm::vector< T, HeapMemory, layout, memory_traits_lin, grow_policy_double, STD_VECTOR > &&  v)
inline

swap the content of the vector

Parameters
vvector to be swapped with

Definition at line 763 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::unique ( )
inline

It eliminate double entries.

Note
The base object must have an operator== defined

Definition at line 535 of file map_vector.hpp.

template<typename T >
template<unsigned int... prp>
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::unpack ( ExtPreAlloc< HeapMemory > &  mem,
Unpack_stat ps 
)
inline

unpack a vector

Warning
the properties should match the packed properties,
Parameters
mempreallocated memory from where to unpack the vector
psunpack info

Definition at line 202 of file map_vector.hpp.

template<typename T >
void openfpm::vector< T, HeapMemory, typename memory_traits_lin< T >::type, memory_traits_lin, grow_policy_double, STD_VECTOR >::vector_overflow ( size_t  v1) const
inline

check that the id does not overflow the buffer

Parameters
v1id to check

Definition at line 1015 of file map_vector.hpp.


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