More refactoring.

This commit is contained in:
Pedro Pinto committed 2021-02-08 09:07:40 -05:00
1 parent 3164c0fd56
commit 51d336405a
2 files changed
+25 -38

No files matched your search

+21 -33
View File
@@ -4,49 +4,37 @@
namespace bts::cmds {
void test_md() {
using namespace bts::spartan;
using namespace bts::spartan::mdp3;
struct A {
int x;
void f();
};
void A::f() {std::cout << this << "\n"; }
FeedMap fm;
fm.incremental[0].ip = "224.0.31.1";
fm.incremental[0].port = 14310;
fm.incremental[1].ip = "224.0.32.1";
fm.incremental[1].port = 15310;
struct B {
int y;
void g();
};
void B::g() {std::cout << this << "\n"; }
fm.instrument.ip = "224.0.31.43";
fm.instrument.port = 14310;
fm.snapshot.ip = "233.72.75.1";
fm.snapshot.port = 23310;
struct MyObs : IFeedObserver {
void on_recovery_complete(InitialSnapshot const &) override {
std::cout << "on_recovery_complete\n";
}
void on_event_end(MDP3Event const &) override {}
void on_packet_loss() override {
std::cout << "on_real_time_channel_loss\n";
}
} my_obs;
auto reactor = Reactor();
auto handler = FeedHandler (my_obs);
auto binder = FeedHandlerBinder ();
binder.bind({fm},reactor,handler);
for (;;)
reactor.do_work();
}
struct C : A,B {
int z;
void h();
};
void C::h() {std::cout << this << "\n"; }
static void execute() {
// put test code here
C c;
c.f();
c.g();
c.h();
}
QuickTest::QuickTest()
: CLI::App(
"This is a place holder to make it easy to quickly "
"write discardable test code",
"quick-test") {
"quicktest") {
callback(execute);
}
@@ -12,11 +12,10 @@ class IFeedObserver;
class IFeedController;
class MDP3PacketView;
// Process MDP3 packets across, to produce a well ordered sequence of
// market data events. This class is agnostic with respect to the
// source of the MDP3 packets. They can come from the network or from
// a pcap. Use the FeedHandlerBinder to use it to process network
// packets.
// Process MDP3 packets across, to produce a sequence of market data
// events. This class is agnostic with respect to the source of the
// MDP3 packets. They can come from the network or from a pcap. Use
// the FeedHandlerBinder to use it to process network packets.
class FeedHandler {
public:
// Construction/Destruction --------------------------------------