Main MRPT website > C++ reference for MRPT 1.5.7
xscopy.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef XSCOPY_H
10 #define XSCOPY_H
11 
12 #define XSLISTCOPY(C) \
13  if (copy == thisPtr)\
14  {\
15  return;\
16  }\
17  C##_assign(copy, thisPtr->m_size, thisPtr->m_data);
18 
19 #define XSLISTSWAP3(C, B, S) \
20  if ((!a->m_data || (a->m_flags & XSDF_Managed)) && (!b->m_data || (b->m_flags & XSDF_Managed))) {\
21  B tmp;\
22  *((C**) &tmp.m_data) = a->m_data;\
23  *((XsSize*) &tmp.m_size) = a->m_size;\
24  *((int*) &tmp.m_flags) = a->m_flags;\
25  *((C**) &a->m_data) = b->m_data;\
26  *((XsSize*) &a->m_size) = b->m_size;\
27  *((int*) &a->m_flags) = b->m_flags;\
28  *((C**) &b->m_data) = tmp.m_data;\
29  *((XsSize*) &b->m_size) = tmp.m_size;\
30  *((int*) &b->m_flags) = tmp.m_flags;\
31  } else { /* elementwise swap */ \
32  XsSize i;\
33  assert(a->m_size == b->m_size);\
34  for (i = 0; i < a->m_size; ++i) S(&a->m_data[i], &b->m_data[i]);\
35  }
36 
37 #define XSLISTSWAP2(C, B) XSLISTSWAP3(C, B, C##_swap)
38 
39 #define XSLISTSWAP(C) XSLISTSWAP2(C, C##List)
40 
41 #endif // file guard



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019