XnStatus XnDeviceBase::AddModule(XnDeviceModuleHolder* pModuleHolder) { XnDeviceModule* pModule = pModuleHolder->GetModule(); // make sure module doesn't exist yet if (m_Modules.Find(pModule->GetName()) != m_Modules.End()) { xnLogError(XN_MASK_DEVICE, "A module with the name %s already exists!", pModule->GetName()); return XN_STATUS_ERROR; } // add it to the list XnStatus nRetVal = m_Modules.Set(pModule->GetName(), pModuleHolder); XN_IS_STATUS_OK(nRetVal); return XN_STATUS_OK; }