| 1443 | } |
| 1444 | |
| 1445 | void SerializerService::deserializeStatistics(StatisticsHistoryData& statistics, std::istream& stream) |
| 1446 | { |
| 1447 | statistics.clear(); |
| 1448 | |
| 1449 | std::vector<std::vector<std::string>> data; |
| 1450 | |
| 1451 | // header line |
| 1452 | std::string header; |
| 1453 | std::getline(stream, header); |
| 1454 | |
| 1455 | std::vector<std::string> colNames; |
| 1456 | boost::split(colNames, header, boost::is_any_of(",")); |
| 1457 | |
| 1458 | std::vector<ParsedColumnInfo> colInfos; |
| 1459 | for (auto const& colName : colNames) { |
| 1460 | auto principalPart = getPrincipalPart(colName); |
| 1461 | |
| 1462 | if (colInfos.empty()) { |
| 1463 | colInfos.emplace_back(principalPart, getColumnIndex(principalPart), 1); |
| 1464 | } else { |
| 1465 | auto& lastColInfo = colInfos.back(); |
| 1466 | if (lastColInfo.name == principalPart) { |
| 1467 | ++lastColInfo.size; |
| 1468 | } else { |
| 1469 | colInfos.emplace_back(principalPart, getColumnIndex(principalPart), 1); |
| 1470 | } |
| 1471 | } |
| 1472 | } |
| 1473 | |
| 1474 | // data lines |
| 1475 | while (std::getline(stream, header)) { |
| 1476 | std::vector<std::string> entries; |
| 1477 | boost::split(entries, header, boost::is_any_of(",")); |
| 1478 | |
| 1479 | DataPointCollection dataPoints; |
| 1480 | load(colInfos, entries, dataPoints); |
| 1481 | |
| 1482 | statistics.emplace_back(dataPoints); |
| 1483 | } |
| 1484 | } |
| 1485 | |
| 1486 | bool SerializerService::wrapGenome(ClusteredDataDescription& output, std::vector<uint8_t> const& input) |
| 1487 | { |
nothing calls this directly
no test coverage detected