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



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