SPARK-331, SpreaderOrder state machine interface has the new Order calls now
This commit is contained in:
1 parent
5b4996295b
commit
e7ecf32423
2 files changed
+17
-3
No files matched your search
+1
-1
Submodule docker/linux updated: ceb7302a48...d4a32d3259.
@@ -4,10 +4,12 @@
|
||||
#include "lib/api/services/OrderService.pb.h"
|
||||
#include "lib/sparkproto/SparkProtos.pb.h"
|
||||
#include "server/sparkd/orderman/utils/orderman_utils.h"
|
||||
#include "server/sparkd/spreader/SpreaderLegData.h" // fix this (not needed)
|
||||
#include "server/sparkd/spreader/SpreaderLegData.h" // fix this (not needed, all the headers can be fwd ref's)
|
||||
#include "server/sparkd/orderman/spreader_orders/spreader_states/SpreaderState.h"
|
||||
|
||||
namespace bts {
|
||||
namespace api {namespace orderman2 {class OrderDefinition;}}
|
||||
namespace orderman2 {class PreActivationOrderServices; class OrderServices;}
|
||||
namespace orderman {
|
||||
class SpreaderOrder;
|
||||
class Book;
|
||||
@@ -20,17 +22,29 @@ public:
|
||||
// 1. called once and only once, before any other calls.
|
||||
// makes the spreader go from start to waiting_for_first_conn
|
||||
virtual void init () = 0;
|
||||
// 1. this is the new init from Order
|
||||
virtual void on_init_new(api::orderman2::OrderDefinition const&, const orderman2::PreActivationOrderServices&)
|
||||
{
|
||||
}
|
||||
// 2. called if the execution venue is working, even if the
|
||||
// connection event happened before the spreader was created. in
|
||||
// other words, on_connect() is always called. spreader should
|
||||
// start by assuming the venue is disconnected and wait until they
|
||||
// receive on_connect().
|
||||
// receive on_connect().
|
||||
virtual void on_connect() = 0;
|
||||
// 2. this is the new on_connect
|
||||
void on_activate(Price, Quantity, orderman2::OrderServices &)
|
||||
{
|
||||
}
|
||||
// 3. called if the venue disconnects. will only be called if there
|
||||
// was previous on_connect()
|
||||
virtual void on_disconnect() = 0;
|
||||
// 4. called when the user updates the order
|
||||
virtual void on_update(const api::orderman::UpdateSpreaderOrder&) = 0;
|
||||
// 4. new on_update
|
||||
void on_update(Price , Quantity )
|
||||
{
|
||||
}
|
||||
// 5. called when the user cancels an order
|
||||
virtual void on_cancel(const api::orderman::CancelSpreaderOrder&) = 0;
|
||||
// 6. on market data update (support late joiners)
|
||||
|
||||
Reference in new issue
Block a user