66 lines
2.2 KiB
C++
66 lines
2.2 KiB
C++
#include "QuickTest.h"
|
|
#include "ICmd.h"
|
|
#include "lib/tracing/PerfLog.h"
|
|
#include "lib/orderman/orders/algo/IAlgoServices.h"
|
|
|
|
#include <iostream>
|
|
|
|
namespace bts {
|
|
namespace cmd {
|
|
using namespace bts::orderman;
|
|
|
|
struct Proxy : public IAlgoServices {
|
|
api::orderman::OrderDefinition def;
|
|
api::Security sec;
|
|
|
|
api::orderman::OrderDefinition const &definition() const { return def; }
|
|
api::Security const &security() const { return sec; }
|
|
OrderKey order_key() const { return OrderKey(0); }
|
|
OrderKey parent_order_key() const { return OrderKey(0); }
|
|
api::Security const *lookup_security(SecurityKey) const { return nullptr; }
|
|
bool is_attaching() const { return false; }
|
|
ChildTemplate &make_child_template(api::orderman::OrderDefinition const &,
|
|
size_t) {
|
|
ChildTemplate *p = nullptr;
|
|
return *p;
|
|
}
|
|
Price price() const { return Price(0); }
|
|
Quantity quantity() const { return Quantity(0); }
|
|
Quantity total_fills() const { return Quantity(0); }
|
|
void subscribe_book(SecurityKey){};
|
|
void unsubscribe_book(SecurityKey) {}
|
|
void subscribe_child_change(OrderKey) {}
|
|
void unsubscribe_child_change(OrderKey) {}
|
|
void subscribe_timer() {}
|
|
void unsubscribe_timer() {}
|
|
OrderKey launch_child(ChildTemplate &, Price, Quantity, bool) { return {}; }
|
|
OrderKey launch_child(api::orderman::OrderDefinition const &, Price,
|
|
Quantity, bool) {
|
|
return {};
|
|
}
|
|
void update_child(OrderKey , api::orderman::Update const &) {}
|
|
void cancel_child(OrderKey) {}
|
|
void detach_child(OrderKey) {}
|
|
void detach_all_children() {}
|
|
void cancel(std::string const &) {}
|
|
void terminate_error(std::string const &) {}
|
|
void complete() {}
|
|
void update_fill_state(Quantity , Price ) {}
|
|
void set_ladder_visibility(bool) {}
|
|
};
|
|
|
|
int QuickTest::execute(std::vector<std::string> const &) {
|
|
Proxy p;
|
|
auto t = &(p.make_child_template(api::orderman::OrderDefinition(),2));
|
|
auto k = p.launch_child(*t,Price(1),Quantity(2),false);
|
|
std::cout << k.value() << "\n";
|
|
return 0;
|
|
}
|
|
|
|
std::string QuickTest::help() {
|
|
return "This is a place holder to make it easy to quickly write discardable "
|
|
"test code";
|
|
}
|
|
} // namespace cmd
|
|
} // namespace bts
|