Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
md_feed.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6namespace slick::sim::cli {
7class CliEndpoint;
8}
9
11
13enum class FeedKind : uint8_t {
16};
17
19[[nodiscard]] constexpr const char *kind_name(FeedKind kind) noexcept {
20 return kind == FeedKind::PCAP ? "pcap" : "live";
21}
22
23class MDFeed
24{
25public:
26 virtual ~MDFeed() = default;
27
28 virtual void start() = 0;
29 virtual void stop() = 0;
30
31 [[nodiscard]] virtual FeedKind feedKind() const noexcept { return FeedKind::LIVE; }
32
34 [[nodiscard]] virtual std::string feedName() const { return {}; }
35
38 virtual cli::CliEndpoint *cliEndpoint() noexcept { return nullptr; }
39};
40
41
42} // end namespace slick::sim::md_feed
Where the CLI server's commands reach a thread that owns some state (the main thread,...
virtual std::string feedName() const
Its name, different from the venue's other feeds'. Empty for a feed without one.
Definition md_feed.hpp:34
virtual ~MDFeed()=default
virtual FeedKind feedKind() const noexcept
Definition md_feed.hpp:31
virtual cli::CliEndpoint * cliEndpoint() noexcept
Where the CLI reaches the feed's own commands, named by the feed.
Definition md_feed.hpp:38
The CLI commands that switch a gateway's business rejects per ID: REJECT_LOGON, REJECT_NEW_ORDERS and...
constexpr const char * kind_name(FeedKind kind) noexcept
As the CLI lists it.
Definition md_feed.hpp:19
FeedKind
Where a feed's market data comes from.
Definition md_feed.hpp:13
@ PCAP
Recorded captures.
Definition md_feed.hpp:15
@ LIVE
The venue, as it happens.
Definition md_feed.hpp:14