| 8 | namespace data { |
| 9 | namespace stream { |
| 10 | SlidingWindow::SlidingWindow( |
| 11 | const std::shared_ptr<Stream>& stream, |
| 12 | const std::string& key, |
| 13 | int64_t size, |
| 14 | int64_t stride, |
| 15 | int dim, |
| 16 | const std::string& index_key) |
| 17 | : stream_(stream), |
| 18 | key_(key), |
| 19 | size_(size), |
| 20 | stride_(stride), |
| 21 | dim_(dim), |
| 22 | index_key_(index_key) { |
| 23 | if (size <= 0) { |
| 24 | throw std::runtime_error("SlidingWindow: size must be strictly positive"); |
| 25 | } |
| 26 | if (stride <= 0) { |
| 27 | throw std::runtime_error("SlidingWindow: stride must be strictly positive"); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | Sample SlidingWindow::next() const { |
| 32 | std::unique_lock lock(mutex_); |
nothing calls this directly
no outgoing calls
no test coverage detected