| 1640 | } |
| 1641 | |
| 1642 | static void generateResultMeasurement(std::vector<Node> const& nodes, size_t idx, Result const& r, std::ostream& out) { |
| 1643 | for (auto const& n : nodes) { |
| 1644 | if (!generateFirstLast(n, idx, r.size(), out)) { |
| 1645 | ANKERL_NANOBENCH_LOG("n.type=" << static_cast<int>(n.type)); |
| 1646 | switch (n.type) { |
| 1647 | case Node::Type::content: |
| 1648 | out.write(n.begin, std::distance(n.begin, n.end)); |
| 1649 | break; |
| 1650 | |
| 1651 | case Node::Type::inverted_section: |
| 1652 | throw std::runtime_error("got a inverted section inside measurement"); |
| 1653 | |
| 1654 | case Node::Type::section: |
| 1655 | throw std::runtime_error("got a section inside measurement"); |
| 1656 | |
| 1657 | case Node::Type::tag: { |
| 1658 | auto m = Result::fromString(std::string(n.begin, n.end)); |
| 1659 | if (m == Result::Measure::_size || !r.has(m)) { |
| 1660 | out << 0.0; |
| 1661 | } else { |
| 1662 | out << r.get(idx, m); |
| 1663 | } |
| 1664 | break; |
| 1665 | } |
| 1666 | } |
| 1667 | } |
| 1668 | } |
| 1669 | } |
| 1670 | |
| 1671 | static void generateResult(std::vector<Node> const& nodes, size_t idx, std::vector<Result> const& results, std::ostream& out) { |
| 1672 | auto const& r = results[idx]; |
no test coverage detected