• 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

75.86
/src/DataManager/utils/TableView/adapters/DigitalIntervalDataAdapter.cpp
1
#include "DigitalIntervalDataAdapter.h"
2

3
#include "DigitalTimeSeries/Digital_Interval_Series.hpp"
4

5
#include <stdexcept>
6

7
DigitalIntervalDataAdapter::DigitalIntervalDataAdapter(std::shared_ptr<DigitalIntervalSeries> digitalIntervalSeries,
81✔
8
                                                       std::shared_ptr<TimeFrame> timeFrame,
9
                                                       std::string name)
81✔
10
    : m_digitalIntervalSeries(std::move(digitalIntervalSeries)),
81✔
11
      m_timeFrame(std::move(timeFrame)),
81✔
12
      m_name(std::move(name)) {
162✔
13
    if (!m_digitalIntervalSeries) {
81✔
14
        throw std::invalid_argument("DigitalIntervalSeries cannot be null");
×
15
    }
16
}
81✔
17

18
std::string const & DigitalIntervalDataAdapter::getName() const {
28✔
19
    return m_name;
28✔
20
}
21

22
std::shared_ptr<TimeFrame> DigitalIntervalDataAdapter::getTimeFrame() const {
65✔
23
    return m_timeFrame;
65✔
24
}
25

26
size_t DigitalIntervalDataAdapter::size() const {
×
27
    return m_digitalIntervalSeries->size();
×
28
}
29

30
std::vector<Interval> DigitalIntervalDataAdapter::getIntervals() {
23✔
31
    return m_digitalIntervalSeries->getDigitalIntervalSeries();
23✔
32
}
33

34
std::vector<Interval> DigitalIntervalDataAdapter::getIntervalsInRange(TimeFrameIndex start,
470✔
35
                                                                      TimeFrameIndex end,
36
                                                                      TimeFrame const * target_timeFrame) {
37
    // Use the DigitalIntervalSeries' built-in method to get intervals in the time range
38
    // This method handles the time frame conversion internally
39
    // Using OVERLAPPING mode to get any intervals that overlap with the range
40
    auto intervals_view = m_digitalIntervalSeries->getIntervalsInRange<DigitalIntervalSeries::RangeMode::OVERLAPPING>(
470✔
41
        start, end, target_timeFrame, m_timeFrame.get());
470✔
42
    
43
    // Convert the view to a vector
44
    std::vector<Interval> result;
470✔
45
    for (const Interval& interval : intervals_view) {
1,290✔
46
        result.push_back(interval);
410✔
47
    }
48
    
49
    return result;
470✔
50
}
×
51

52
std::vector<IntervalWithId> DigitalIntervalDataAdapter::getIntervalsWithIdsInRange(TimeFrameIndex start,
156✔
53
                                                                                   TimeFrameIndex end,
54
                                                                                   TimeFrame const * target_timeFrame) {
55
    return m_digitalIntervalSeries->getIntervalsWithIdsInRange(start, end, target_timeFrame, m_timeFrame.get());
156✔
56
}
57

UNCOV
58
EntityId DigitalIntervalDataAdapter::getEntityIdAt(size_t index) const {
×
UNCOV
59
    auto const & ids = m_digitalIntervalSeries->getEntityIds();
×
UNCOV
60
    return (index < ids.size()) ? ids[index] : 0;
×
61
}
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