• 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

66.67
/src/DataManager/utils/TableView/interfaces/IIntervalSource.h
1
#ifndef IINTERVAL_SOURCE_H
2
#define IINTERVAL_SOURCE_H
3

4
#include "TimeFrame/TimeFrame.hpp"
5
#include "TimeFrame/interval_data.hpp"
6
#include "Entity/EntityTypes.hpp"
7
#include "DigitalTimeSeries/IntervalWithId.hpp"
8

9
#include <memory>
10
#include <string>
11
#include <vector>
12

13
/**
14
 * @brief Interface for data sources that consist of time intervals.
15
 * 
16
 * This interface is designed for data that represents intervals in time,
17
 * such as digital interval series or behavioral episodes. Each interval
18
 * is defined by a start and end time.
19
 */
20
class IIntervalSource {
21
public:
22
    virtual ~IIntervalSource() = default;
107✔
23
    
24
    // Make this class non-copyable and non-movable since it's a pure interface
25
    IIntervalSource(const IIntervalSource&) = delete;
26
    IIntervalSource& operator=(const IIntervalSource&) = delete;
27
    IIntervalSource(IIntervalSource&&) = delete;
28
    IIntervalSource& operator=(IIntervalSource&&) = delete;
29

30
    /**
31
     * @brief Gets the name of this data source.
32
     * 
33
     * This name is used for dependency tracking and ExecutionPlan caching
34
     * in the TableView system.
35
     * 
36
     * @return The name of the data source.
37
     */
38
    virtual std::string const & getName() const = 0;
39

40
    /**
41
     * @brief Gets the TimeFrame the data belongs to.
42
     * @return A shared pointer to the TimeFrame.
43
     */
44
    virtual std::shared_ptr<TimeFrame> getTimeFrame() const = 0;
45

46
    /**
47
     * @brief Gets the total number of intervals in the source.
48
     * @return The number of intervals.
49
     */
50
    virtual size_t size() const = 0;
51

52
    virtual std::vector<Interval> getIntervals() = 0;
53

54
    /**
55
     * @brief Gets the intervals within a specific time range.
56
     * 
57
     * This gets the intervals in the range [start, end] (inclusive) from the source timeframe
58
     * 
59
     * @param start The start index of the time range.
60
     * @param end The end index of the time range.
61
     * @param target_timeFrame The target time frame (from the caller) for the data.
62
     * @return A vector of Intervals representing the intervals in the specified range.
63
     */
64
    virtual std::vector<Interval> getIntervalsInRange(TimeFrameIndex start,
65
                                                      TimeFrameIndex end,
66
                                                      TimeFrame const * target_timeFrame) = 0;
67

68
    virtual std::vector<IntervalWithId> getIntervalsWithIdsInRange(TimeFrameIndex start,
69
                                                                   TimeFrameIndex end,
70
                                                                   TimeFrame const * target_timeFrame) = 0;
71

72
    /**
73
     * @brief Optional: get the EntityId for the k-th interval in the source ordering.
74
     * Implementors that don't support EntityIds may return 0.
75
     */
UNCOV
76
    [[nodiscard]] virtual auto getEntityIdAt(size_t index) const -> EntityId { (void)index; return 0; }
×
77

78
protected:
79
    // Protected constructor to prevent direct instantiation
80
    IIntervalSource() = default;
107✔
81
};
82

83
#endif // IINTERVAL_SOURCE_H
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