23 virtual std::size_t
size() const noexcept = 0;
24 virtual
void read(
std::
size_t first, Row* destination,
25 std::
size_t count) const = 0;
27 Row
at(
std::
size_t index)
const {
47 : bars_(bars), close_ms_(close_ms), count_(count) {
48 if (count && (!bars || !close_ms))
49 throw std::invalid_argument(
"feed reader arrays");
51 std::size_t
size() const noexcept
override {
return count_; }
53 std::size_t count)
const override {
54 if (first > count_ || count > count_ - first)
55 throw std::out_of_range(
"feed reader range");
56 if (count && !destination)
57 throw std::invalid_argument(
"feed reader destination");
58 for (std::size_t i = 0; i < count; ++i)
59 destination[i] =
FeedBar{bars_[first + i], close_ms_[first + i]};
63 const std::int64_t* close_ms_;
std::size_t size() const noexcept override
BorrowedBarFeedReader(const Bar *bars, const std::int64_t *close_ms, std::size_t count)
void read(std::size_t first, FeedBar *destination, std::size_t count) const override
virtual void read(std::size_t first, Row *destination, std::size_t count) const =0
Row at(std::size_t index) const
virtual ~FeedReader()=default
virtual std::size_t size() const noexcept=0