DeviceFilter(unsigned int type, const unsigned int* vec, size_t length) : RemapFilterBase(type) { targets_.reserve(length / 3); for (int i = 0; i < static_cast<int>(length) - 2; i += 3) { targets_.push_back(DeviceIdentifier(DeviceVendor(vec[i]), DeviceProduct(vec[i + 1]), DeviceLocation(vec[i + 2]))); } if (length % 3 > 0) { IOLOG_WARN("Invalid length(%d) in BRIDGE_FILTERTYPE_DEVICE_*\n", static_cast<int>(length)); } }
void DeviceFilter::add(unsigned int vendorID, unsigned int productID, unsigned int locationID) { targets_.push_back(DeviceIdentifier(vendorID, productID, locationID)); }