MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / SetGeneralProperty

Method SetGeneralProperty

Source/Modules/nimMockNodes/MockProductionNode.cpp:120–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120XnStatus MockProductionNode::SetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
121{
122 XnStatus nRetVal = XN_STATUS_OK;
123 XnGeneralBuffer generalBuffer = {NULL, 0};
124
125 m_generalProps.Get(strName, generalBuffer);
126 //If m_generalProps.Get() failed, generalBuffer is still not allocated, and XnGeneralBufferAlloc will allocate it.
127 if (nBufferSize != generalBuffer.nDataSize)
128 {
129 XnGeneralBufferFree(&generalBuffer);
130
131 nRetVal = XnGeneralBufferAlloc(&generalBuffer, nBufferSize);
132 XN_IS_STATUS_OK(nRetVal);
133 }
134 xnOSMemCopy(generalBuffer.pData, pBuffer, nBufferSize);
135
136 nRetVal = m_generalProps.Set(strName, generalBuffer);
137 if (nRetVal != XN_STATUS_OK)
138 {
139 XnGeneralBufferFree(&generalBuffer);
140 return nRetVal;
141 }
142
143 if (m_pNotifications != NULL)
144 {
145 nRetVal = m_pNotifications->OnNodeGeneralPropChanged(m_pNotificationsCookie, m_strName, strName, nBufferSize, pBuffer);
146 if (nRetVal != XN_STATUS_OK)
147 {
148 XnGeneralBufferFree(&generalBuffer);
149 return nRetVal;
150 }
151 }
152
153 return XN_STATUS_OK;
154}
155
156XnStatus MockProductionNode::GetIntProperty(const XnChar* strName, XnUInt64& nValue) const
157{

Callers

nothing calls this directly

Calls 6

XnGeneralBufferFreeFunction · 0.85
XnGeneralBufferAllocFunction · 0.85
xnOSMemCopyFunction · 0.50
GetMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected