forked from huningxin/DSSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDepthSenseAPI.h
215 lines (166 loc) · 5.84 KB
/
DepthSenseAPI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
////////////////////////////////////////////////////////////////////////////////
// SoftKinetic DepthSense SDK
//
// COPYRIGHT AND CONFIDENTIALITY NOTICE - SOFTKINETIC CONFIDENTIAL
// INFORMATION
//
// All rights reserved to SOFTKINETIC SENSORS NV (a
// company incorporated and existing under the laws of Belgium, with
// its principal place of business at Boulevard de la Plainelaan 15,
// 1050 Brussels (Belgium), registered with the Crossroads bank for
// enterprises under company number 0811 341 454 - "Softkinetic
// Sensors").
//
// The source code of the SoftKinetic DepthSense Camera Drivers is
// proprietary and confidential information of Softkinetic Sensors NV.
//
// For any question about terms and conditions, please contact:
// [email protected] Copyright (c) 2002-2015 Softkinetic Sensors NV
////////////////////////////////////////////////////////////////////////////////
#ifndef _DEPTHSENSEAPI_H
#define _DEPTHSENSEAPI_H
/*----------------------------------------------------------------------------*/
#if defined(DepthSense_EXPORTS)
#
# if defined(_MSC_VER)
# define DEPTHSENSE_API __declspec(dllexport)
# elif defined(__GNUC__)
# define DEPTHSENSE_API __attribute__((visibility("default")))
# else
# error Unsupported compiler
# endif /* _MSC_VER || __GNUC__ */
#
#elif defined(DepthSense_STATIC)
#
# define DEPTHSENSE_API
#
#else /* !DepthSense_EXPORTS && !DepthSense_STATIC */
#
# if defined(_MSC_VER)
# define DEPTHSENSE_API __declspec(dllimport)
# elif defined(__GNUC__)
# define DEPTHSENSE_API __attribute__((visibility("default")))
# else
# error Unsupported compiler
# endif /* _MSC_VER || __GNUC__ */
#
#endif /* DepthSense_EXPORTS */
/*----------------------------------------------------------------------------*/
// Helper macros for private data access in API classes
#define DEPTHSENSE_PRIVATE_DECLARE(C) \
private: \
class C##Private; \
friend class C##Private; \
inline C##Private &get_priv() { return *priv; } \
inline const C##Private &get_priv() const { return *((const C##Private *) priv); } \
C##Private *priv
#define DEPTHSENSE_PRIVATE_BEGIN(C) \
class C::C##Private { \
private: \
friend class C
#define DEPTHSENSE_PRIVATE_BEGIN_USING_NAMESPACE(N, C) \
class N::C::C##Private { \
private: \
friend class N::C
// variant to avoid "first seen using 'struct' now seen using 'class'" warnings with MSVC
#define DEPTHSENSE_PRIVATE_STRUCT_BEGIN_USING_NAMESPACE(N, C) \
class N::C::C##Private { \
private: \
friend struct N::C
#define DEPTHSENSE_PRIVATE_END(C) \
}
#define DEPTHSENSE_PRIVATE_END_USING_NAMESPACE(N, C) \
}
// for completeness; see above
#define DEPTHSENSE_PRIVATE_STRUCT_END_USING_NAMESPACE(N, C) \
}
#define DEPTHSENSE_STRUCT_BASE(C) \
C(); \
C(const C &); \
~C(); \
C &operator=(const C &)
#define DEPTHSENSE_PRIVATE_ALLOCATE(C) \
priv = new C##Private()
// to be used in copy constructors
#define DEPTHSENSE_PRIVATE_COPY_ALLOCATE(C, arg) \
priv = new C##Private(arg.get_priv())
#define DEPTHSENSE_PRIVATE_DEALLOCATE(C) \
delete priv
#define DEPTHSENSE_PRIVATE_CTOR(C) \
C##Private()
#define DEPTHSENSE_PRIVATE_COPY_CTOR(C, arg) \
C##Private(const C##Private &arg)
#define DEPTHSENSE_PRIVATE_OPERATOR_EQUAL(C, arg) \
C##Private &operator=(const C##Private &arg)
#define DEPTHSENSE_PRIVATE_OPERATOR_EQUALITY(C, arg) \
bool operator==(const C##Private &arg) const
#define DEPTHSENSE_PRIVATE_DTOR(C) \
virtual ~C##Private()
#define DEPTHSENSE_PRIVATE_INIT(C) \
C##Private &m = get_priv(); (void)m
#define DEPTHSENSE_PRIVATE_INIT_USING_NAMESPACE(N, C) \
N::C::C##Private &m = get_priv()
#define DEPTHSENSE_PRIVATE_NAMESPACE(C) \
C::C##Private::
/*----------------------------------------------------------------------------*/
// Helper macros for protected data access in API classes
#define DEPTHSENSE_PROTECTED_DECLARE(C) \
protected: \
class C##Protected; \
friend class C##Protected; \
inline C##Protected &get_prot() { return *prot; } \
inline const C##Protected &get_prot() const { return *((const C##Protected *) prot); } \
C##Protected *prot
#define DEPTHSENSE_PROTECTED_BEGIN(C) \
class C::C##Protected { \
protected: \
friend class C
#define DEPTHSENSE_PROTECTED_BEGIN_USING_NAMESPACE(N, C) \
class N::C::C##Protected { \
protected: \
friend class N::C
// variant to avoid "first seen using 'struct' now seen using 'class'" warnings with MSVC
#define DEPTHSENSE_PROTECTED_STRUCT_BEGIN_USING_NAMESPACE(N, C) \
class N::C::C##Protected { \
protected: \
friend struct N::C
#define DEPTHSENSE_PROTECTED_END(C) \
}
#define DEPTHSENSE_PROTECTED_END_USING_NAMESPACE(N, C) \
}
// for completeness; see above
#define DEPTHSENSE_PROTECTED_STRUCT_END_USING_NAMESPACE(N, C) \
}
#define DEPTHSENSE_STRUCT_BASE(C) \
C(); \
C(const C &); \
~C(); \
C &operator=(const C &)
#define DEPTHSENSE_PROTECTED_ALLOCATE(C) \
prot = new C##Protected()
// to be used in copy constructors
#define DEPTHSENSE_PROTECTED_COPY_ALLOCATE(C, arg) \
prot = new C##Protected(arg.get_prot())
#define DEPTHSENSE_PROTECTED_DEALLOCATE(C) \
delete prot
#define DEPTHSENSE_PROTECTED_CTOR(C) \
C##Protected()
#define DEPTHSENSE_PROTECTED_COPY_CTOR(C, arg) \
C##Protected(const C##Protected &arg)
#define DEPTHSENSE_PROTECTED_OPERATOR_EQUAL(C, arg) \
C##Protected &operator=(const C##Protected &arg)
#define DEPTHSENSE_PROTECTED_DTOR(C) \
virtual ~C##Protected()
#define DEPTHSENSE_PROTECTED_INIT(C) \
C##Protected &m = get_prot()
#define DEPTHSENSE_PROTECTED_INIT_USING_NAMESPACE(N, C) \
N::C::C##Protected &m = get_prot()
#define DEPTHSENSE_PROTECTED_NAMESPACE(C) \
C::C##Protected::
/*----------------------------------------------------------------------------*/
// Helper macro for disabling copy constructors and overloaded = operators;
// to be used in the private: section of the class definition
#define DEPTHSENSE_DISABLE_COPY(C) \
C(const C &src); \
C &operator=(const C &src)
#endif /* _DEPTHSENSEAPI_H */