Main MRPT website
>
C++ reference for MRPT 1.9.9
xSens_MT4
xstypes
include
xsens
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)) && \
21
(!b->m_data || (b->m_flags & XSDF_Managed))) \
22
{ \
23
B tmp; \
24
*((C**)&tmp.m_data) = a->m_data; \
25
*((XsSize*)&tmp.m_size) = a->m_size; \
26
*((int*)&tmp.m_flags) = a->m_flags; \
27
*((C**)&a->m_data) = b->m_data; \
28
*((XsSize*)&a->m_size) = b->m_size; \
29
*((int*)&a->m_flags) = b->m_flags; \
30
*((C**)&b->m_data) = tmp.m_data; \
31
*((XsSize*)&b->m_size) = tmp.m_size; \
32
*((int*)&b->m_flags) = tmp.m_flags; \
33
} \
34
else \
35
{
/* elementwise swap */
\
36
XsSize i; \
37
assert(a->m_size == b->m_size); \
38
for (i = 0; i < a->m_size; ++i) S(&a->m_data[i], &b->m_data[i]); \
39
}
40
41
#define XSLISTSWAP2(C, B) XSLISTSWAP3(C, B, C##_swap)
42
43
#define XSLISTSWAP(C) XSLISTSWAP2(C, C##List)
44
45
#endif // file guard
Page generated by
Doxygen 1.8.14
for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019