void mhwd::getAllDevicesOfConfig(mhwd::Data *data, mhwd::Config *config, std::vector<mhwd::Device*>* foundDevices) { std::vector<mhwd::Device*>* devices; if (config->type == mhwd::TYPE_USB) devices = &data->USBDevices; else devices = &data->PCIDevices; getAllDevicesOfConfig(devices, config, foundDevices); }
void mhwd::setMatchingConfig(mhwd::Config* config, std::vector<mhwd::Device*>* devices, bool setAsInstalled) { std::vector<mhwd::Device*> foundDevices; getAllDevicesOfConfig(devices, config, &foundDevices); // Set config to all matching devices for (std::vector<mhwd::Device*>::iterator iterator = foundDevices.begin(); iterator != foundDevices.end(); iterator++) { if (setAsInstalled) addConfigSorted(&(*iterator)->installedConfigs, config); else addConfigSorted(&(*iterator)->availableConfigs, config); } }
void Data::getAllDevicesOfConfig(Config *config, std::vector<Device*>* foundDevices) { std::vector<Device*> devices; if (config->type_ == MHWD::DEVICETYPE::USB) { devices = USBDevices; } else { devices = PCIDevices; } getAllDevicesOfConfig(&devices, config, foundDevices); }