Main MRPT website > C++ reference for MRPT 1.5.6
xsdeviceid.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 XSDEVICEID_H
10 #define XSDEVICEID_H
11 
12 #include "xstypesconfig.h"
13 #include "pstdint.h"
14 #include "xsstring.h"
15 #ifdef __cplusplus
16 extern "C" {
17 #else
18 #define XSDEVICEID_INITIALIZER { 0 }
19 #endif
20 
21 struct XsDeviceId;
22 
23 XSTYPES_DLL_API void XsDeviceId_toString(struct XsDeviceId const* thisPtr, XsString* str);
24 XSTYPES_DLL_API int XsDeviceId_isValid(struct XsDeviceId const* thisPtr);
25 XSTYPES_DLL_API int XsDeviceId_isXbusMaster(struct XsDeviceId const* thisPtr);
27 XSTYPES_DLL_API int XsDeviceId_isWirelessMaster(struct XsDeviceId const* thisPtr);
28 XSTYPES_DLL_API int XsDeviceId_isMtw(struct XsDeviceId const* thisPtr);
29 XSTYPES_DLL_API int XsDeviceId_isMtix(struct XsDeviceId const* thisPtr);
30 XSTYPES_DLL_API int XsDeviceId_isMtig(struct XsDeviceId const* thisPtr);
31 XSTYPES_DLL_API int XsDeviceId_isLegacyMtig(struct XsDeviceId const* thisPtr);
32 XSTYPES_DLL_API int XsDeviceId_isAwindaStation(struct XsDeviceId const* thisPtr);
33 XSTYPES_DLL_API int XsDeviceId_isAwindaDongle(struct XsDeviceId const* thisPtr);
34 XSTYPES_DLL_API int XsDeviceId_isAwindaOem(struct XsDeviceId const* thisPtr);
35 XSTYPES_DLL_API int XsDeviceId_isMtMk4(struct XsDeviceId const* thisPtr);
36 XSTYPES_DLL_API int XsDeviceId_isMtMk4_X0(struct XsDeviceId const* thisPtr);
37 XSTYPES_DLL_API int XsDeviceId_isMtMk4_10(struct XsDeviceId const* thisPtr);
38 XSTYPES_DLL_API int XsDeviceId_isMtMk4_20(struct XsDeviceId const* thisPtr);
39 XSTYPES_DLL_API int XsDeviceId_isMtMk4_30(struct XsDeviceId const* thisPtr);
40 XSTYPES_DLL_API int XsDeviceId_isMtMk4_X00(struct XsDeviceId const* thisPtr);
41 XSTYPES_DLL_API int XsDeviceId_isMtMk4_100(struct XsDeviceId const* thisPtr);
42 XSTYPES_DLL_API int XsDeviceId_isMtMk4_200(struct XsDeviceId const* thisPtr);
43 XSTYPES_DLL_API int XsDeviceId_isMtMk4_300(struct XsDeviceId const* thisPtr);
44 XSTYPES_DLL_API int XsDeviceId_isMtMk4_700(struct XsDeviceId const* thisPtr);
45 XSTYPES_DLL_API int XsDeviceId_isMtw2(struct XsDeviceId const* thisPtr);
46 XSTYPES_DLL_API int XsDeviceId_isMtx2(struct XsDeviceId const* thisPtr);
48 XSTYPES_DLL_API int XsDeviceId_isBroadcast(struct XsDeviceId const* thisPtr);
51 
52 #ifdef __cplusplus
53 } // extern "C"
54 #endif
55 
56 struct XsDeviceId {
57 #ifdef __cplusplus
58  /*! \brief Constructor that creates an XsDeviceId from the supplied \a deviceId */
59  inline XsDeviceId(uint32_t deviceId = 0)
61  {
62  }
63  /*! \brief Constructor that creates an XsDeviceId from the supplied XsDeviceId \a other */
64  inline XsDeviceId(const XsDeviceId& other)
65  : m_deviceId(other.m_deviceId)
66  {
67  }
68 
69  /*! \brief Assign the \a other deviceId to this XsDeviceId */
70  inline const XsDeviceId& operator=(const XsDeviceId& other)
71  {
72  m_deviceId = other.m_deviceId;
73  return *this;
74  }
75  /*! \brief Assign the \a deviceId to this XsDeviceId */
76  inline const XsDeviceId& operator=(uint32_t deviceId)
77  {
79  return *this;
80  }
81 
82  /*! \brief Returns the deviceId as an unsigned integer */
83  inline uint32_t toInt() const
84  {
85  return m_deviceId;
86  }
87 
88  /*! \brief Returns the deviceId as an XsString */
89  inline XsString toString() const
90  {
91  XsString tmp;
92  XsDeviceId_toString(this, &tmp);
93  return tmp;
94  }
95 
96  /*! \brief \copybrief XsDeviceId_isValid */
97  inline bool isValid() const
98  {
99  return 0 != XsDeviceId_isValid(this);
100  }
101  /*! \brief \copybrief XsDeviceId_isXbusMaster */
102  inline bool isXbusMaster() const
103  {
104  return 0 != XsDeviceId_isXbusMaster(this);
105  }
106  /*! \brief \copybrief XsDeviceId_isXbusMasterMotionTracker */
107  inline bool isXbusMasterMotionTracker() const
108  {
109  return 0 != XsDeviceId_isXbusMasterMotionTracker(this);
110  }
111  /*! \brief \copybrief XsDeviceId_isMtw */
112  inline bool isMtw() const
113  {
114  return 0 != XsDeviceId_isMtw(this);
115  }
116  /*! \brief \copybrief XsDeviceId_isMtix */
117  inline bool isMtix() const
118  {
119  return 0 != XsDeviceId_isMtix(this);
120  }
121  /*! \brief \copybrief XsDeviceId_isLegacyMtig */
122  inline bool isLegacyMtig() const
123  {
124  return 0 != XsDeviceId_isLegacyMtig(this);
125  }
126  /*! \brief \copybrief XsDeviceId_isMtig */
127  inline bool isMtig() const
128  {
129  return 0 != XsDeviceId_isMtig(this);
130  }
131  /*! \brief \copybrief XsDeviceId_isMtMk4 */
132  inline bool isMtMk4() const
133  {
134  return 0 != XsDeviceId_isMtMk4(this);
135  }
136  /*! \brief \copybrief XsDeviceId_isMtMk4_X0 */
137  inline bool isMtMk4_X0() const
138  {
139  return 0 != XsDeviceId_isMtMk4_X0(this);
140  }
141  /*! \brief \copybrief XsDeviceId_isMtMk4_10 */
142  inline bool isMtMk4_10() const
143  {
144  return 0 != XsDeviceId_isMtMk4_10(this);
145  }
146  /*! \brief \copybrief XsDeviceId_isMtMk4_20 */
147  inline bool isMtMk4_20() const
148  {
149  return 0 != XsDeviceId_isMtMk4_20(this);
150  }
151  /*! \brief \copybrief XsDeviceId_isMtMk4_30 */
152  inline bool isMtMk4_30() const
153  {
154  return 0 != XsDeviceId_isMtMk4_30(this);
155  }
156  /*! \brief \copybrief XsDeviceId_isMtMk4_X00 */
157  inline bool isMtMk4_X00() const
158  {
159  return 0 != XsDeviceId_isMtMk4_X00(this);
160  }
161  /*! \brief \copybrief XsDeviceId_isMtMk4_100 */
162  inline bool isMtMk4_100() const
163  {
164  return 0 != XsDeviceId_isMtMk4_100(this);
165  }
166  /*! \brief \copybrief XsDeviceId_isMtMk4_200 */
167  inline bool isMtMk4_200() const
168  {
169  return 0 != XsDeviceId_isMtMk4_200(this);
170  }
171  /*! \brief \copybrief XsDeviceId_isMtMk4_300 */
172  inline bool isMtMk4_300() const
173  {
174  return 0 != XsDeviceId_isMtMk4_300(this);
175  }
176  /*! \brief \copybrief XsDeviceId_isMtMk4_700 */
177  inline bool isMtMk4_700() const
178  {
179  return 0 != XsDeviceId_isMtMk4_700(this);
180  }
181  /*! \brief \copybrief XsDeviceId_isMtw2 */
182  inline bool isMtw2() const
183  {
184  return 0 != XsDeviceId_isMtw2(this);
185  }
186  /*! \brief \copybrief XsDeviceId_isMtx2 */
187  inline bool isMtx2() const
188  {
189  return 0 != XsDeviceId_isMtx2(this);
190  }
191  /*! \brief \copybrief XsDeviceId_isWirelessMaster */
192  inline bool isWirelessMaster() const
193  {
194  return 0 != XsDeviceId_isWirelessMaster(this);
195  }
196  /*! \brief \copybrief XsDeviceId_isAwindaStation */
197  inline bool isAwindaStation() const
198  {
199  return 0 != XsDeviceId_isAwindaStation(this);
200  }
201  /*! \brief \copybrief XsDeviceId_isAwindaDongle */
202  inline bool isAwindaDongle() const
203  {
204  return 0 != XsDeviceId_isAwindaDongle(this);
205  }
206  /*! \brief \copybrief XsDeviceId_isAwindaOem */
207  inline bool isAwindaOem() const
208  {
209  return 0 != XsDeviceId_isAwindaOem(this);
210  }
211  /*! \brief \copybrief XsDeviceId_containsBroadcast */
212  inline bool containsBroadcast() const
213  {
214  return 0 != XsDeviceId_containsBroadcast(this);
215  }
216  /*! \brief \copybrief XsDeviceId_isBroadcast */
217  inline bool isBroadcast() const
218  {
219  return 0 != XsDeviceId_isBroadcast(this);
220  }
221 
222  /*! \brief Returns true if the \a other deviceId matches this deviceId */
223  inline bool operator==(const XsDeviceId& other) const { return m_deviceId == other.m_deviceId; }
224  /*! \brief Returns true if the \a other deviceId does not match this deviceId */
225  inline bool operator!=(const XsDeviceId& other) const { return m_deviceId != other.m_deviceId; }
226  /*! \brief Returns true if this deviceId is less than the \a other deviceId */
227  inline bool operator<(const XsDeviceId& other) const { return m_deviceId < other.m_deviceId; }
228  /*! \brief Returns true if this deviceId is less or equal to the \a other deviceId */
229  inline bool operator<=(const XsDeviceId& other) const { return m_deviceId <= other.m_deviceId; }
230  /*! \brief Returns true if this deviceId is larger than the \a other deviceId */
231  inline bool operator>(const XsDeviceId& other) const { return m_deviceId > other.m_deviceId; }
232  /*! \brief Returns true if this deviceId is larger or equal to the \a other deviceId */
233  inline bool operator>=(const XsDeviceId& other) const { return m_deviceId >= other.m_deviceId; }
234 
235  /*! \brief Creates and returns a XsDeviceId representing the broadcast deviceId */
236  static XsDeviceId broadcast()
237  {
239  }
240 
241 private:
242 #endif
243  uint32_t m_deviceId; //!< The actual device id
244 };
245 
246 typedef struct XsDeviceId XsDeviceId;
247 
248 #endif // file guard
XSTYPES_DLL_API int XsDeviceId_isMtig(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API uint32_t XsDeviceId_broadcast(void)
bool operator==(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
XSTYPES_DLL_API int XsDeviceId_isAwindaOem(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isBroadcast(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_300(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API void XsDeviceId_toString(struct XsDeviceId const *thisPtr, XsString *str)
bool operator!=(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_30(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_10(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_containsBroadcast(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isLegacyMtig(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_20(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isValid(struct XsDeviceId const *thisPtr)
GLubyte GLubyte b
Definition: glext.h:5575
XSTYPES_DLL_API int XsDeviceId_isWirelessMaster(struct XsDeviceId const *thisPtr)
struct XsDeviceId XsDeviceId
Definition: xsdeviceid.h:246
bool operator>(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:289
XSTYPES_DLL_API int XsDeviceId_isAwindaDongle(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API void XsDeviceId_swap(struct XsDeviceId *a, struct XsDeviceId *b)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_700(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_X00(struct XsDeviceId const *thisPtr)
#define XSTYPES_DLL_API
Definition: xstypesconfig.h:9
XSTYPES_DLL_API int XsDeviceId_isXbusMaster(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtw(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtix(struct XsDeviceId const *thisPtr)
bool operator<=(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:293
bool operator<(const CPoint< DERIVEDCLASS > &a, const CPoint< DERIVEDCLASS > &b)
Used by STL algorithms.
Definition: CPoint.h:116
XSTYPES_DLL_API int XsDeviceId_isMtx2(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_100(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isAwindaStation(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isXbusMasterMotionTracker(struct XsDeviceId const *thisPtr)
struct XsString XsString
Definition: xsstring.h:34
XSTYPES_DLL_API int XsDeviceId_isMtMk4_X0(struct XsDeviceId const *thisPtr)
unsigned __int32 uint32_t
Definition: rptypes.h:49
XSTYPES_DLL_API int XsDeviceId_isMtw2(struct XsDeviceId const *thisPtr)
#define deviceId
Definition: CIMUXSens.cpp:41
GLubyte GLubyte GLubyte a
Definition: glext.h:5575
bool operator>=(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:297
XSTYPES_DLL_API int XsDeviceId_isMtMk4_200(struct XsDeviceId const *thisPtr)
uint32_t m_deviceId
The actual device id.
Definition: xsdeviceid.h:243



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019