• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 17920603410

22 Sep 2025 03:39PM UTC coverage: 71.97% (-0.05%) from 72.02%
17920603410

push

github

paulmthompson
all tests pass

277 of 288 new or added lines in 8 files covered. (96.18%)

520 existing lines in 35 files now uncovered.

40275 of 55961 relevant lines covered (71.97%)

1225.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.57
/src/DataManager/utils/TableView/columns/Column.cpp
1
#include "Column.h"
2

3
#include "utils/TableView/core/TableView.h"
4
#include "utils/TableView/interfaces/IColumnComputer.h"
5

6
#include <iostream>
7

8
template<SupportedColumnType T>
9
Column<T>::Column(std::string name, std::unique_ptr<IColumnComputer<T>> computer)
417✔
10
    : m_name(std::move(name)),
417✔
11
      m_computer(std::move(computer)){};
834✔
12

13
template<SupportedColumnType T>
14
std::vector<T> const & Column<T>::getValues(TableView * table) {
322✔
15
    if (!isMaterialized()) {
322✔
16
        materialize(table);
183✔
17
    }
18
    return std::get<std::vector<T>>(m_cache);
322✔
19
}
20

21
template<SupportedColumnType T>
22
void Column<T>::materialize(TableView * table) {
263✔
23
    if (isMaterialized()) {
263✔
UNCOV
24
        return;
×
25
    }
26

27
    ExecutionPlan const & plan = table->getExecutionPlanFor(getSourceDependency());
263✔
28

29
    // Compute the column values using the computer
30
    auto [computed, entity_ids] = m_computer->compute(plan);
263✔
31

32
    // Store the computed values in the cache
33
    m_cache = std::move(computed);
263✔
34
    m_entityIds = std::move(entity_ids);
263✔
35
}
263✔
36

37
template<SupportedColumnType T>
38
std::string Column<T>::getSourceDependency() const {
2,118✔
39
    return m_computer->getSourceDependency();
2,118✔
40
}
41

42

43
template<SupportedColumnType T>
44
std::vector<std::string> Column<T>::getDependencies() const {
505✔
45
    return m_computer->getDependencies();
505✔
46
}
47

48
template<SupportedColumnType T>
49
bool Column<T>::isMaterialized() const {
764✔
50
    return std::holds_alternative<std::vector<T>>(m_cache);
764✔
51
}
52

53
template<SupportedColumnType T>
54
EntityIdStructure Column<T>::getEntityIdStructure() const {
384✔
55
    return m_computer->getEntityIdStructure();
384✔
56
}
57

58
template<SupportedColumnType T>
59
std::vector<EntityId> Column<T>::getCellEntityIds(size_t row_index) const {
180✔
60
    if (getEntityIdStructure() == EntityIdStructure::None) {
180✔
UNCOV
61
        return {};
×
62
    } else if (getEntityIdStructure() == EntityIdStructure::Simple) {
180✔
63
        return {std::get<std::vector<EntityId>>(m_entityIds).at(row_index)};
474✔
64
    } else if (getEntityIdStructure() == EntityIdStructure::Complex) {
22✔
65
        return std::get<std::vector<std::vector<EntityId>>>(m_entityIds).at(row_index);
22✔
66
    } else {
UNCOV
67
        return {};
×
68
    }
69
}
70

71
template<SupportedColumnType T>
72
ColumnEntityIds Column<T>::getColumnEntityIds() const {
19✔
73
    if (!isMaterialized()) {
19✔
UNCOV
74
        std::cout << "Column " << m_name << " is not materialized" << std::endl;
×
75
    }
76
    return m_entityIds;
19✔
77
}
78

79
// Explicit instantiation for commonly used types
80
template class Column<double>;
81
template class Column<float>;
82
template class Column<std::vector<float>>;
83
template class Column<bool>;
84
template class Column<int>;
85
template class Column<int64_t>;
86
template class Column<std::vector<double>>;
87
template class Column<std::vector<int>>;
88
template class Column<std::vector<TimeFrameIndex>>;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc