22 #include "Vector/vector_dist.hpp" 
   45     static bool pack()  {
return true;}
 
  109         req += 2*
sizeof(size_t) + 
size + 
str.size()+1;
 
  117     static bool noPointers()
 
  153         memcpy(t_ptr2,
str.c_str(),
str.size());
 
  156         t_ptr2[
str.size()] = 0;
 
  201         str = std::string(ptr_src2);
 
  324 int main(
int argc, 
char* argv[])
 
  343     openfpm_init(&argc,&argv);
 
  349     size_t bc[2]={PERIODIC,PERIODIC};
 
  355     constexpr 
int my_s1 = 0;
 
  358     constexpr 
int my_s2 = 1;
 
  363     vd(4096,domain,bc,g);
 
  391     auto it = vd.getDomainIterator();
 
  398         vd.getPos(p)[0] = (float)rand() / RAND_MAX;
 
  401         vd.getPos(p)[1] = (float)rand() / RAND_MAX;
 
  408         vd.getProp<my_s1>(p).size = 32;
 
  409         vd.getProp<my_s1>(p).ptr = 
new char[32];
 
  410         strcpy(vd.getProp<my_s1>(p).ptr,pt.
toString().c_str());
 
  413         vd.getProp<my_s1>(p).str = std::string(pt.
toString());
 
  415         vd.getProp<my_s1>(p).v.add(1);
 
  416         vd.getProp<my_s1>(p).v.add(2);
 
  417         vd.getProp<my_s1>(p).v.add(3);
 
  423         vd.getProp<my_s2>(p).size = 32;
 
  424         vd.getProp<my_s2>(p).ptr = 
new char[32];
 
  425         strcpy(vd.getProp<my_s2>(p).ptr,pt.
toString().c_str());
 
  428         vd.getProp<my_s2>(p).str = std::string(pt.
toString());
 
  430         vd.getProp<my_s2>(p).v.add(1);
 
  431         vd.getProp<my_s2>(p).v.add(2);
 
  432         vd.getProp<my_s2>(p).v.add(3);
 
  433         vd.getProp<my_s2>(p).v.add(4);
 
  464     vd.ghost_get<my_s1,my_s2>();
 
  486     vd.write(
"particles");
 
  505     size_t fg = vd.size_local();
 
  507     Vcluster & v_cl = create_vcluster();
 
  513         for ( ; fg < vd.size_local()+4 ; fg++)
 
  516             std::cout << 
"my_struct1:" << std::endl;
 
  517             std::cout << 
"C-string: " << vd.getProp<my_s1>(fg).ptr << std::endl;
 
  518             std::cout << 
"Cpp-string: " << vd.getProp<my_s1>(fg).str << std::endl;
 
  520             for (
size_t i = 0 ; i < vd.getProp<my_s1>(fg).v.size() ; i++)
 
  521                 std::cout << 
"Element: " << i << 
"   " << vd.getProp<my_s1>(fg).v.get(i) << std::endl;
 
  524             std::cout << 
"my_struct2" << std::endl;
 
  525             std::cout << 
"C-string: " << vd.getProp<my_s2>(fg).ptr << std::endl;
 
  526             std::cout << 
"Cpp-string: " << vd.getProp<my_s2>(fg).str << std::endl;
 
  528             for (
size_t i = 0 ; i < vd.getProp<my_s2>(fg).v.size() ; i++)
 
  529                 std::cout << 
"Element: " << i << 
"   " << vd.getProp<my_s2>(fg).v.get(i) << std::endl;
 
size_t size
C string size. 
 
size_t getOffset()
Return the actual counter. 
 
std::string str
C++ string. 
 
void packRequest(size_t &req) const 
Serialization request. 
 
size_t getProcessUnitID()
Get the process unit id. 
 
std::string toString() const 
Return the string with the point coordinate. 
 
virtual void * getPointer()
Return the pointer of the last allocation. 
 
This class implement the point shape in an N-dimensional space. 
 
void unpack(ExtPreAlloc< Memory > &mem, Unpack_stat &ps)
De-serialize the data structure. 
 
my_struct(my_struct &&my)
Copy constructor from temporal object. 
 
virtual bool allocate(size_t sz)
Allocate a chunk of memory. 
 
Implementation of VCluster class. 
 
my_struct & operator=(const my_struct &my)
This is fundamental to avoid crash, otherwise. 
 
char * ptr
C string pointer. 
 
void * getPointerOffset(size_t offset)
Get the base memory pointer increased with an offset. 
 
void addOffset(size_t off)
Increment the offset pointer by off. 
 
openfpm::vector< int > v
vector 
 
This class represent an N-dimensional box. 
 
static void unpack(ExtPreAlloc< Mem >, T &obj)
Error, no implementation. 
 
return if true the aggregate type T has a property that has a complex packing(serialization) method ...
 
void pack(ExtPreAlloc< Memory > &mem, Pack_stat &sts) const 
Serialize the data structure. 
 
my_struct(const my_struct &my)
Copy constructor. 
 
static void pack(ExtPreAlloc< Mem >, const T &obj)
Error, no implementation. 
 
static bool pack()
Functions to check if the packing object is complex. 
 
my_struct & operator=(my_struct &&my)
This is fundamental to avoid crash, otherwise.