| 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]; |
| 1673 | for (auto const& n : nodes) { |
| 1674 | if (!generateFirstLast(n, idx, results.size(), out)) { |
| 1675 | ANKERL_NANOBENCH_LOG("n.type=" << static_cast<int>(n.type)); |
| 1676 | switch (n.type) { |
| 1677 | case Node::Type::content: |
| 1678 | out.write(n.begin, std::distance(n.begin, n.end)); |
| 1679 | break; |
| 1680 | |
| 1681 | case Node::Type::inverted_section: |
| 1682 | throw std::runtime_error("got a inverted section inside result"); |
| 1683 | |
| 1684 | case Node::Type::section: |
| 1685 | if (n == "measurement") { |
| 1686 | for (size_t i = 0; i < r.size(); ++i) { |
| 1687 | generateResultMeasurement(n.children, i, r, out); |
| 1688 | } |
| 1689 | } else { |
| 1690 | throw std::runtime_error("got a section inside result"); |
| 1691 | } |
| 1692 | break; |
| 1693 | |
| 1694 | case Node::Type::tag: |
| 1695 | generateResultTag(n, r, out); |
| 1696 | break; |
| 1697 | } |
| 1698 | } |
| 1699 | } |
| 1700 | } |
| 1701 | |
| 1702 | } // namespace templates |
| 1703 |
no test coverage detected