virtual void allProductsReady() { std::vector<QoSCorrections> qosCorrectionsVector = Consumer<QoSCorrections>::getConsumables(); QoSCorrections corrections; uint64_t receivedCententionNum = 0; for (QoSCorrections product : qosCorrectionsVector) { receivedCententionNum += product.size(); for (slave::QoSCorrection correction : product) { if (checkForDuplicates(correction, corrections)) { // Filter out duplicated value. continue; } corrections.push_back(correction); } } SERENITY_LOG(INFO) << "Received " << corrections.size() << " corrections"; produce(corrections); return; }
virtual Try<Nothing> syncConsume( const std::vector<QoSCorrections> products) { QoSCorrections corrections; uint64_t receivedCententionNum = 0; for (QoSCorrections product : products) { receivedCententionNum += product.size(); for (slave::QoSCorrection correction : product) { if (checkForDuplicates(correction, corrections)) { // Filter out duplicated value. continue; } corrections.push_back(correction); } } SERENITY_LOG(INFO) << "Received " << receivedCententionNum << " corrections" << " and merged to " << corrections.size() << " corrections."; produce(corrections); return Nothing(); }