• 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

50.0
/src/DataManager/utils/TableView/interfaces/IEventSource.h
1
#ifndef IEVENT_SOURCE_H
2
#define IEVENT_SOURCE_H
3

4
#include "DigitalTimeSeries/EventWithId.hpp"
5
#include "Entity/EntityTypes.hpp"
6
#include "TimeFrame/TimeFrame.hpp"
7

8
#include <span>
9

10
/**
11
 * @brief Interface for data sources that consist of sorted event timestamps/indices.
12
 * 
13
 * This interface is designed for data that represents discrete events in time,
14
 * such as digital event series or spike trains. The events are assumed to be
15
 * sorted in ascending order.
16
 */
17
class IEventSource {
18
public:
19
    virtual ~IEventSource() = default;
69✔
20

21
    // Make this class non-copyable and non-movable since it's a pure interface
22
    IEventSource(IEventSource const &) = delete;
23
    IEventSource & operator=(IEventSource const &) = delete;
24
    IEventSource(IEventSource &&) = delete;
25
    IEventSource & operator=(IEventSource &&) = delete;
26

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

37
    /**
38
     * @brief Gets the total number of events in the source.
39
     * @return The number of events.
40
     */
41
    virtual auto size() const -> size_t = 0;
42

43

44
    /**
45
     * @brief Gets the TimeFrame the data belongs to.
46
     * @return A shared pointer to the TimeFrame.
47
     */
48
    virtual std::shared_ptr<TimeFrame> getTimeFrame() const = 0;
49

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

64
    virtual std::vector<EventWithId> getDataInRangeWithEntityIds(TimeFrameIndex start,
65
                                                                 TimeFrameIndex end,
66
                                                                 TimeFrame const * target_timeFrame) = 0;
67

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

77
protected:
78
    // Protected constructor to prevent direct instantiation
79
    IEventSource() = default;
69✔
80
};
81

82
#endif// IEVENT_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