| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef __XN_ACTUAL_INT_PROPERTY_H__ |
| 22 |
#define __XN_ACTUAL_INT_PROPERTY_H__ |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#include <DDK/XnIntProperty.h> |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
class XnActualIntProperty : public XnIntProperty |
| 37 |
{ |
| 38 |
public: |
| 39 |
XnActualIntProperty(XnUInt32 propertyId, const XnChar* strName, XnUInt64 nInitialValue = 0, const XnChar* strModule = ""); |
| 40 |
|
| 41 |
inline XnUInt64 GetValue() const { return m_nValue; } |
| 42 |
|
| 43 |
typedef XnStatus (XN_CALLBACK_TYPE* SetFuncPtr)(XnActualIntProperty* pSender, XnUInt64 nValue, void* pCookie); |
| 44 |
typedef XnStatus (XN_CALLBACK_TYPE* GetFuncPtr)(const XnActualIntProperty* pSender, XnUInt64* pnValue, void* pCookie); |
| 45 |
|
| 46 |
inline void UpdateSetCallback(SetFuncPtr pFunc, void* pCookie) |
| 47 |
{ |
| 48 |
XnIntProperty::UpdateSetCallback((XnIntProperty::SetFuncPtr)pFunc, pCookie); |
| 49 |
} |
| 50 |
|
| 51 |
inline void UpdateSetCallbackToDefault() |
| 52 |
{ |
| 53 |
UpdateSetCallback(SetCallback, this); |
| 54 |
} |
| 55 |
|
| 56 |
inline void UpdateGetCallback(GetFuncPtr pFunc, void* pCookie) |
| 57 |
{ |
| 58 |
XnIntProperty::UpdateGetCallback((XnIntProperty::GetFuncPtr)pFunc, pCookie); |
| 59 |
} |
| 60 |
|
| 61 |
private: |
| 62 |
static XnStatus XN_CALLBACK_TYPE SetCallback(XnActualIntProperty* pSender, XnUInt64 nValue, void* pCookie); |
| 63 |
static XnStatus XN_CALLBACK_TYPE GetCallback(const XnActualIntProperty* pSender, XnUInt64* pnValue, void* pCookie); |
| 64 |
|
| 65 |
XnUInt64 m_nValue; |
| 66 |
}; |
| 67 |
|
| 68 |
#endif |