The mock vendor: records the caller gives, each released once the clock reaches the time it was published.
More...
#include <algotradelib/src/brokers/mock/data.hpp>
|
| using | Entry = std::pair<std::chrono::system_clock::time_point, T> |
| | A record and when it was published.
|
|
| | DataFeed (std::vector< Entry > entries) |
| | Builds a feed over records in any order; records published at one instant keep their order.
|
| std::optional< std::vector< T > > | operator() (std::chrono::system_clock::time_point now) |
| | Returns the records published at or before now and not returned before, in time order.
|
| std::size_t | remaining () const noexcept |
| | Returns how many records are still to be released.
|
template<typename T>
class algotradelib::mock::DataFeed< T >
The mock vendor: records the caller gives, each released once the clock reaches the time it was published.
It is a data poll as runner::PollingLoop::set_data_poll takes one: on the mock market's clock (mock::MarketClock) one clock moves the market and the feed, and the loop stamps each record with the reading at which it received it.
loop.set_data_poll(feed);
The mock vendor: records the caller gives, each released once the clock reaches the time it was publi...
- Template Parameters
-
| T | The record type, the strategy's data_type. |
Definition at line 29 of file data.hpp.
◆ Entry
A record and when it was published.
Definition at line 32 of file data.hpp.
◆ DataFeed()
Builds a feed over records in any order; records published at one instant keep their order.
- Parameters
-
| entries | The records with their publication times. |
Definition at line 38 of file data.hpp.
◆ operator()()
Returns the records published at or before now and not returned before, in time order.
- Parameters
-
- Returns
- The records; empty when nothing is new. Never std::nullopt: the mock never fails a read.
Definition at line 49 of file data.hpp.
◆ remaining()
Returns how many records are still to be released.
- Returns
- The count.
Definition at line 62 of file data.hpp.
The documentation for this class was generated from the following file: