chrono_batch_render/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
25 / 25
100.0%
Branches:
34 / 37
91.9%
Functions:
9 / 9, 3 excl
100.0%

stage/publish/table.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 #pragma once
3
4 #include <cstdint>
5 #include <initializer_list>
6 #include <span>
7 #include <string_view>
8 #include <vector>
9
10 #include "chrono_batch_render/device/buffer.h"
11 #include "chrono_batch_render/device/ref.h"
12 #include "chrono_batch_render/stage/publish/change_set.h"
13 #include "chrono_batch_render/stage/schema/schema.h"
14
15 namespace chrono::batch_render {
16
17
13/16
✗ Branch 0 not taken.
✓ Branch 1 taken 2155 times.
✓ Branch 4 taken 353 times.
✓ Branch 7 taken 235 times.
✓ Branch 10 taken 235 times.
✓ Branch 13 taken 353 times.
✓ Branch 16 taken 353 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 235 times.
✓ Branch 21 taken 235 times.
✓ Branch 24 taken 353 times.
✓ Branch 27 taken 353 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 235 times.
✓ Branch 32 taken 353 times.
✓ Branch 35 taken 353 times.
6287 class Table {
18 public:
19 720 virtual ~Table() = default;
20
21 virtual std::string_view Name() const = 0;
22 virtual std::span<const ColumnRef> Inputs() const = 0;
23
24 16062 virtual std::span<const ColumnRef> RowInputs() const {
25 16062 return {};
26 }
27
28 51688 virtual std::span<const TableId> TableInputs() const {
29 51688 return {};
30 }
31
32 3216 virtual std::span<const TableId> TableOutputs() const {
33 3216 return {};
34 }
35
36 32121 virtual bool Structural() const {
37 32121 return true;
38 }
39
40 102347 virtual bool Pending() const {
41 102347 return false;
42 }
43
44 706 virtual void Prepare() {}
45
46 11611 virtual void Finish() {}
47
48 83 virtual void Hold(std::vector<Ref<const RefCounted>>&) const {}
49
50 virtual void Run(const ChangeSet& changes, TableVersions& versions) = 0;
51
52 17503 uint32_t Runs() const {
53
17/17
<unknown function 52>:
✓ Branch 1 taken 2 times.
✓ Branch 1 taken 17105 times.
✓ Branch 4 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
chrono::batch_render::Table::Hold(std::vector<chrono::batch_render::Ref<chrono::batch_render::RefCounted const>, std::allocator<chrono::batch_render::Ref<chrono::batch_render::RefCounted const> > >&) const:
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 129 times.
✓ Branch 2 taken 161 times.
✓ Branch 3 taken 23 times.
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 7 times.
✓ Branch 6 taken 11 times.
✓ Branch 7 taken 14 times.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 12 times.
✓ Branch 10 taken 6 times.
17480 return m_runs;
54 }
55
56 private:
57 friend class Publisher;
58
59 uint32_t m_runs = 0;
60 };
61
62 17022 inline void HoldBuffers(std::vector<Ref<const RefCounted>>& held,
63 std::initializer_list<Ref<device::Buffer>> buffers) {
64
2/2
✓ Branch 0 taken 56594 times.
✓ Branch 1 taken 17022 times.
73616 for (const Ref<device::Buffer>& buffer : buffers) {
65
2/2
✓ Branch 0 taken 47649 times.
✓ Branch 1 taken 8945 times.
56594 if (buffer) {
66 47649 held.emplace_back(buffer);
67 }
68 }
69 17022 }
70
71 }
72