Definition at line 98 of file map_grid.hpp.
Public Types | |
typedef grid_key_dx< dim > | access_key |
Access key. | |
typedef T::type | T_type |
boost::vector that describe the data type | |
typedef Mem | memory_conf |
typedef int | yes_i_am_grid |
it define that it is a grid | |
typedef memory_traits_lin < typename T::type >::type | memory_lin |
Definition of the layout. | |
typedef Mem | memory_t |
Memory traits. | |
typedef encapc< dim, T, Mem > | container |
Object container for T, it is the return type of get_o it return a object type trough. | |
typedef T | value_type |
Public Member Functions | |
template<int... prp> | |
void | pack (ExtPreAlloc< S > &mem, Pack_stat &sts) |
template<int... prp> | |
void | pack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Pack_stat &sts) |
Pack the object into the memory given an iterator. More... | |
template<int... prp> | |
void | packRequest (std::vector< size_t > &v) |
Insert an allocation request. More... | |
template<int... prp> | |
void | packRequest (grid_key_dx_iterator_sub< dims > &sub, std::vector< size_t > &v) |
Insert an allocation request. More... | |
template<typename it , typename dtype , int... prp> | |
void | pack_with_iterator (it &sub_it, dtype &dest) |
Pack an N-dimensional grid into a vector like structure B given an iterator of the grid. More... | |
template<typename it , typename stype , unsigned int... prp> | |
void | unpack_with_iterator (ExtPreAlloc< S > &mem, it &sub_it, stype &src, Unpack_stat &ps) |
unpack the grid given an iterator More... | |
template<unsigned int... prp> | |
void | unpack (ExtPreAlloc< S > &mem, Unpack_stat &ps) |
unpack the grid object More... | |
template<unsigned int... prp> | |
void | unpack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Unpack_stat &ps) |
unpack the sub-grid object More... | |
grid_cpu () THROW | |
Default constructor. | |
grid_cpu (const grid_cpu &g) THROW | |
create a grid from another grid More... | |
grid_cpu (std::vector< size_t > &sz) THROW | |
Constructor allocate memory and give them a representation. | |
grid_cpu (std::vector< size_t > &&sz) THROW | |
Constructor allocate memory and give them a representation. | |
grid_cpu (const size_t(&sz)[dim]) THROW | |
Constructor allocate memory and give them a representation. | |
~grid_cpu () THROW | |
Destructor. | |
grid_cpu< dim, T, S, Mem > & | operator= (const grid_cpu< dim, T, S, Mem > &g) |
It copy an operator. More... | |
grid_cpu< dim, T, S, Mem > & | operator= (grid_cpu< dim, T, S, Mem > &&g) |
It copy an operator. More... | |
bool | operator== (const grid_cpu< dim, T, S, Mem > &g) |
Compare two grids. More... | |
grid_cpu< dim, T, S, Mem > | duplicate () const THROW |
create a duplicated version of the grid More... | |
const grid_sm< dim, T > & | getGrid () const |
Return the internal grid information. More... | |
void | setMemory () |
Create the object that provide memory. More... | |
void | setMemory (S &m) |
Get the object that provide memory. More... | |
void * | getPointer () |
Return a plain pointer to the internal data. More... | |
const void * | getPointer () const |
Return a plain pointer to the internal data. More... | |
template<unsigned int p> | |
type_cpu_prop< p, memory_lin > ::type & | get (grid_key_d< dim, p > &v1) |
Get the reference of the selected element. More... | |
template<unsigned int p> | |
const type_cpu_prop< p, memory_lin >::type & | get (grid_key_d< dim, p > &v1) const |
Get the const reference of the selected element. More... | |
template<unsigned int p> | |
type_cpu_prop< p, memory_lin > ::type & | get (const grid_key_dx< dim > &v1) |
Get the reference of the selected element. More... | |
template<unsigned int p> | |
const type_cpu_prop< p, memory_lin >::type & | get (const grid_key_dx< dim > &v1) const |
Get the const reference of the selected element. More... | |
encapc< dim, T, Mem > | get_o (const grid_key_dx< dim > &v1) |
Get the of the selected element as a boost::fusion::vector. More... | |
const encapc< dim, T, Mem > | get_o (const grid_key_dx< dim > &v1) const |
Get the of the selected element as a boost::fusion::vector. More... | |
void | fill (unsigned char fl) |
Fill the memory with the selected byte. More... | |
void | resize (const size_t(&sz)[dim]) |
Resize the space. More... | |
void | remove (size_t key) |
Remove one element valid only on 1D. More... | |
void | swap (grid_cpu< dim, T, S, Mem > &grid) |
It move the allocated object from one grid to another. More... | |
void | swap (grid_cpu< dim, T, S, Mem > &&grid) |
It move the allocated object from one grid to another. More... | |
template<typename Memory > | |
void | set (grid_key_dx< dim > dx, const encapc< 1, T, Memory > &obj) |
set an element of the grid More... | |
void | set (grid_key_dx< dim > dx, const T &obj) |
set an element of the grid More... | |
void | set (const grid_key_dx< dim > &key1, const grid_cpu< dim, T, S, Mem > &g, const grid_key_dx< dim > &key2) |
Set an element of the grid from another element of another grid. More... | |
size_t | size () const |
return the size of the grid More... | |
grid_key_dx_iterator_sub< dim > | getSubIterator (grid_key_dx< dim > &start, grid_key_dx< dim > &stop) const |
Return a sub-grid iterator. More... | |
grid_key_dx_iterator_sub< dim > | getSubIterator (size_t m) |
Return a sub-grid iterator. More... | |
grid_key_dx_iterator< dim > | getIterator () const |
Return a grid iterator. More... | |
grid_key_dx_iterator_sub< dim > | getIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const |
Return a grid iterator over all the point with the exception of the ghost part. More... | |
size_t | getLastError () |
Return the last error. More... | |
size_t | packObjectSize () |
Return the size of the message needed to pack this object. More... | |
size_t | packObject (void *mem) |
It fill the message packet. More... | |
long int | who () |
Static Public Member Functions | |
static bool | pack () |
Pack the object into the memory given an iterator. More... | |
static bool | packRequest () |
static bool | calculateMem () |
Static Public Attributes | |
static constexpr unsigned int | dims = dim |
Private Member Functions | |
std::vector< size_t > | getV () |
Get 1D vector with the. More... | |
Private Attributes | |
bool | is_mem_init = false |
Is the memory initialized. | |
grid_sm< dim, T > | g1 |
This is a structure that store all information related to the grid and how indexes are linearized. | |
Mem | data_ |
Memory layout specification + memory chunk pointer. | |
bool | isExternal |
The memory allocator is not internally created. | |
size_t | err_code |
Error code. | |
|
inline |
create a grid from another grid
S | memory type for allocation |
g | the grid to copy |
mem | memory object (only used for template deduction) |
Definition at line 510 of file map_grid.hpp.
|
inline |
create a duplicated version of the grid
Create a completely new grid with sz
Set the allocator and allocate the memory
1-D copy (This case is simple we use raw memory copy because is the fastest option)
N-D copy
create a source grid iterator
Definition at line 619 of file map_grid.hpp.
|
inline |
Fill the memory with the selected byte.
fl | byte pattern to fill |
Definition at line 902 of file map_grid.hpp.
|
inline |
Get the reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 770 of file map_grid.hpp.
|
inline |
Get the const reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 792 of file map_grid.hpp.
|
inline |
Get the reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 814 of file map_grid.hpp.
|
inline |
Get the const reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 836 of file map_grid.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | grid_key that identify the element in the grid |
Definition at line 858 of file map_grid.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | grid_key that identify the element in the grid |
Definition at line 880 of file map_grid.hpp.
|
inline |
Return the internal grid information.
Return the internal grid information
Definition at line 665 of file map_grid.hpp.
|
inline |
Return a grid iterator.
Return a grid iterator, to iterate through the grid
Definition at line 1168 of file map_grid.hpp.
|
inline |
Return a grid iterator over all the point with the exception of the ghost part.
Return a grid iterator over all the point with the exception of the ghost part
Definition at line 1184 of file map_grid.hpp.
|
inline |
Return the last error.
Definition at line 1197 of file map_grid.hpp.
|
inline |
Return a plain pointer to the internal data.
Return a plain pointer to the internal data
Definition at line 733 of file map_grid.hpp.
|
inline |
Return a plain pointer to the internal data.
Return a plain pointer to the internal data
Definition at line 752 of file map_grid.hpp.
|
inline |
Return a sub-grid iterator.
Return a sub-grid iterator, to iterate through the grid
start | start point |
stop | stop point |
Definition at line 1138 of file map_grid.hpp.
|
inline |
Return a sub-grid iterator.
Return a sub-grid iterator, to iterate through the grid
m | Margin |
Definition at line 1154 of file map_grid.hpp.
|
inlineprivate |
Get 1D vector with the.
Get std::vector with element 0 to dim set to 0
Definition at line 388 of file map_grid.hpp.
|
inline |
Compare two grids.
g1 | grid to check |
Definition at line 595 of file map_grid.hpp.
|
inlinestatic |
Pack the object into the memory given an iterator.
dim | Dimensionality of the grid |
prp | properties to pack |
mem | preallocated memory where to pack the objects |
obj | object to pack |
sts | pack statistic |
Definition at line 123 of file map_grid.hpp.
|
inline |
Pack the object into the memory given an iterator.
prp | properties to pack |
mem | preallocated memory where to pack the objects |
sub_it | sub grid iterator ( or the elements in the grid to pack ) |
sts | pack statistic |
Definition at line 176 of file map_grid.hpp.
|
inline |
Pack an N-dimensional grid into a vector like structure B given an iterator of the grid.
it | type of iterator of the grid-structure |
dtype | type of the structure B |
dim | Dimensionality of the grid |
properties | to pack |
it | Grid iterator |
obj | object to pack |
dest | where to pack |
Definition at line 248 of file map_grid.hpp.
|
inline |
It fill the message packet.
TODO They just return 0 doing nothing
Definition at line 1231 of file map_grid.hpp.
|
inline |
Return the size of the message needed to pack this object.
TODO They just return 0 for now
Definition at line 1214 of file map_grid.hpp.
|
inline |
Insert an allocation request.
vector | of requests |
Definition at line 203 of file map_grid.hpp.
|
inline |
Insert an allocation request.
prp | set of properties to pack |
sub | sub-grid iterator |
vector | of requests |
Definition at line 225 of file map_grid.hpp.
|
inline |
Remove one element valid only on 1D.
Definition at line 978 of file map_grid.hpp.
|
inline |
Resize the space.
Resize the space to a new grid, the element are retained on the new grid, if the new grid is bigger the new element are now initialized, if is smaller the data are cropped
sz | reference to an array of dimension dim |
Create a completely new grid with sz
Set the allocator and allocate the memory
N-D copy
create a source grid iterator
Definition at line 919 of file map_grid.hpp.
|
inline |
set an element of the grid
set an element of the grid
dx | is the grid key or the position to set |
obj | value to set |
Definition at line 1054 of file map_grid.hpp.
|
inline |
set an element of the grid
set an element of the grid
dx | is the grid key or the position to set |
obj | value to set |
Definition at line 1080 of file map_grid.hpp.
|
inline |
Set an element of the grid from another element of another grid.
key1 | element of the grid to set |
g | source grid |
key2 | element of the source grid to copy |
Definition at line 1102 of file map_grid.hpp.
|
inline |
Create the object that provide memory.
Create the object that provide memory
S | memory type to allocate |
Create and set the memory allocator
Allocate the memory and create the representation
Definition at line 681 of file map_grid.hpp.
|
inline |
Get the object that provide memory.
An external allocator is useful with allocator like PreAllocHeapMem to have contiguous in memory vectors.
S | memory type |
m | external memory allocator |
Is external
Create and set the memory allocator
Allocate the memory and create the reppresentation
Definition at line 708 of file map_grid.hpp.
|
inline |
return the size of the grid
Return the size of the grid
Definition at line 1122 of file map_grid.hpp.
|
inline |
It move the allocated object from one grid to another.
It move the allocated object from one grid to another, after this call the argument grid is no longer valid
grid | to move/copy |
Definition at line 1006 of file map_grid.hpp.
|
inline |
It move the allocated object from one grid to another.
It move the allocated object from one grid to another, after this call the argument grid is no longer valid
grid | to move/copy |
Definition at line 1037 of file map_grid.hpp.
|
inline |
unpack the grid object
prp | properties to unpack |
ext | preallocated memory from where to unpack the grid |
obj | object where to unpack |
Definition at line 308 of file map_grid.hpp.
|
inline |
unpack the sub-grid object
prp | properties to unpack |
mem | preallocated memory from where to unpack the object |
sub | sub-grid iterator |
obj | object where to unpack |
Definition at line 343 of file map_grid.hpp.
|
inline |
unpack the grid given an iterator
it | type of iterator |
prp | of the grid object to unpack |
Definition at line 277 of file map_grid.hpp.