Esempio n. 1
0
XN_DDK_API XnStatus XnPropertySetDestroy(XnPropertySet** ppSet)
{
	XN_VALIDATE_INPUT_PTR(ppSet);
	XN_VALIDATE_INPUT_PTR(*ppSet);

	XnPropertySet* pSet = (*ppSet);

	if (pSet->pData != NULL)
	{
		XnPropertySetClear(pSet);
		XN_DELETE(pSet->pData);
	}

	xnOSFree(pSet);

	*ppSet = NULL;

	return (XN_STATUS_OK);
}
Esempio n. 2
0
XnStatus XnDeviceBase::GetAllProperties(XnPropertySet* pSet, XnBool bNoStreams /* = FALSE */, const XnChar* strModule /* = NULL */)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XN_VALIDATE_INPUT_PTR(pSet);

	// clear the set
	nRetVal = XnPropertySetClear(pSet);
	XN_IS_STATUS_OK(nRetVal);

	if (strModule != NULL)
	{
		XnDeviceModule* pModule;
		nRetVal = FindModule(strModule, &pModule);
		XN_IS_STATUS_OK(nRetVal);

		nRetVal = pModule->GetAllProperties(pSet);
		XN_IS_STATUS_OK(nRetVal);
	}
	else
	{
		// enumerate over modules
		for (XnStringsHash::Iterator it = m_Modules.begin(); it != m_Modules.end(); ++it)
		{
			XnDeviceModuleHolder* pModuleHolder = (XnDeviceModuleHolder*)it.Value();

			if (bNoStreams && IsStream(pModuleHolder->GetModule()))
				continue;

			nRetVal = pModuleHolder->GetModule()->GetAllProperties(pSet);
			XN_IS_STATUS_OK(nRetVal);
		}
	}

	return XN_STATUS_OK;
}