Debian Codegraph @

Source/Drivers/PS1080/DDK/XnActualIntProperty.h

raw symbols SCIP
1 /*****************************************************************************
2 * *
3 * OpenNI 2.x Alpha *
4 * Copyright (C) 2012 PrimeSense Ltd. *
5 * *
6 * This file is part of OpenNI. *
7 * *
8 * Licensed under the Apache License, Version 2.0 (the "License"); *
9 * you may not use this file except in compliance with the License. *
10 * You may obtain a copy of the License at *
11 * *
12 * http://www.apache.org/licenses/LICENSE-2.0 *
13 * *
14 * Unless required by applicable law or agreed to in writing, software *
15 * distributed under the License is distributed on an "AS IS" BASIS, *
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
17 * See the License for the specific language governing permissions and *
18 * limitations under the License. *
19 * *
20 *****************************************************************************/
21 #ifndef __XN_ACTUAL_INT_PROPERTY_H__
22 #define __XN_ACTUAL_INT_PROPERTY_H__
23
24 //---------------------------------------------------------------------------
25 // Includes
26 //---------------------------------------------------------------------------
27 #include <DDK/XnIntProperty.h>
28
29 //---------------------------------------------------------------------------
30 // Types
31 //---------------------------------------------------------------------------
32
33 /**
34 * A property of type integer.
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 //__XN_ACTUAL_INT_PROPERTY_H__