changed the ordering of member variables from lower mem to higher

This commit is contained in:
Taha Afzal committed 2019-01-09 11:18:06 -05:00
1 parent f413938943
commit 70e962000f
8 files changed
+32 -33

No files matched your search

@@ -18,11 +18,11 @@ bts::TimeStamp SpreaderOrder::_cache_warm_fill_ts = bts::TimeStamp();
SpreaderOrder::SpreaderOrder()
:
_cancelled (false),
_active(true),
_cancel_hedges_on_cancel(false),
_cw_helper(),
_cancel_timeout (5000),// TODO:get it from config
_check_termination_period (250), // should also be a setting/config like above
_active(true),
_cancel_hedges_on_cancel(false),
_bookkeeping_data_ptr(),
_order_services(nullptr),
_curr_timestamp(),
@@ -95,6 +95,10 @@ private:
//std::array<uint8_t,16> _non_filled_indices;
// if the order is _cancelled, this is set to true
bool _cancelled;
// is false if created from disk
const bool _active;
// this is the main data
bool _cancel_hedges_on_cancel;
// helps with forced calls, and all the artificiality of these
// calls are trapped here
CacheWarmingHelper _cw_helper;
@@ -102,11 +106,7 @@ private:
const int64_t _cancel_timeout;
// period on which check termination calls are
// sent to the state worker
const int64_t _check_termination_period;
// is false if created from disk
const bool _active;
// this is the main data
bool _cancel_hedges_on_cancel;
const int64_t _check_termination_period;
std::unique_ptr<SpreaderBookkeepingData> _bookkeeping_data_ptr;
// pointer kept to send reports
SpreaderOrderServices* _order_services;
@@ -15,6 +15,7 @@ SingleFillHedger::SingleFillHedger(ISpreaderManager& spreader_manager,
trace::CorID const &fill_trace,
bool is_live)
:
_is_permenantly_cancelled(false),
_spreader(spreader_manager),
_leg_property_data (leg_property_data),
_child_order_state (leg_property_data.leg_security_key(),
@@ -22,7 +23,6 @@ _child_order_state (leg_property_data.leg_security_key(),
false),
_price_quantity_state(Price(0),
Quantity(0)),
_is_permenantly_cancelled(false),
_fill_trace(fill_trace),
_worker (nullptr),
_start_state_worker (this),
@@ -40,11 +40,11 @@ _end_state_worker (this){
SingleFillHedger::SingleFillHedger (SingleFillHedger&& other)
:
_is_permenantly_cancelled(other._is_permenantly_cancelled),
_spreader (other._spreader),
_leg_property_data (other._leg_property_data),
_child_order_state (std::move(other._child_order_state)),
_price_quantity_state (other._price_quantity_state),
_is_permenantly_cancelled(other._is_permenantly_cancelled),
_fill_trace(other._fill_trace),
_worker(nullptr),
_start_state_worker (this, other._start_state_worker),
@@ -26,11 +26,11 @@ friend HedgerWorkingStateWorker;
friend HedgerWaitingForCancelAckStateWorker;
friend HedgerEndStateWorker;
private:
bool _is_permenantly_cancelled;
ISpreaderManager& _spreader;
const LegPropertyData& _leg_property_data;
SpreaderChildOrderState _child_order_state;
HedgePriceQuantityState _price_quantity_state;
bool _is_permenantly_cancelled;
HedgePriceQuantityState _price_quantity_state;
trace::CorID _fill_trace;
IHedgerStateWorker* _worker;
HedgerStartStateWorker _start_state_worker;
@@ -20,17 +20,16 @@ _two_legged (n_spreader_legs == 2),
_active_quoting(this_leg_property.is_active_quoting()),
_hidden_order(this_leg_property.leg_params().has_quote_params() &&
this_leg_property.leg_params().quote_params().has_quote_hidden()),
//_max_failed_iocs(config::get<config::Spreader>().n_failed_iocs),
_is_permenantly_cancelled (false),
_irrecoverable_error(false),
_n_spreader_legs (n_spreader_legs),
_max_failed_iocs(20),
_n_failed_iocs(0),
_spreader(spreader),
_this_leg_data (this_leg_property),
_n_spreader_legs (n_spreader_legs),
_child_order_state (child_order_state),
_driver_cache(n_spreader_legs,n_spreader_legs>2?10:0,this_leg_property.tick_size()),
_price_quantity_state(Price(0), Quantity(0), child_order_state),
_is_permenantly_cancelled (false),
_irrecoverable_error(false),
_n_failed_iocs(0),
_worker(nullptr),
_start_state_worker(this),
_waiting_for_size_state_worker(this),
@@ -54,19 +53,19 @@ SingleLegQuoter::SingleLegQuoter(SingleLegQuoter&& other)
_two_legged (other._two_legged),
_active_quoting(other._active_quoting),
_hidden_order(other._hidden_order),
_is_permenantly_cancelled (other._is_permenantly_cancelled),
_irrecoverable_error(other._irrecoverable_error),
_n_spreader_legs (other._n_spreader_legs),
_max_failed_iocs(other._max_failed_iocs),
_n_failed_iocs(other._n_failed_iocs),
_spreader(other._spreader),
_this_leg_data (other._this_leg_data),
_n_spreader_legs (other._n_spreader_legs),
_child_order_state (other._child_order_state),
_drivers_temp_usage(other._drivers_temp_usage),
_driver_cache(other._driver_cache),
_price_quantity_state(other._price_quantity_state.target_spread_price(),
other._price_quantity_state.target_leg_quantity(),
other._price_quantity_state.order_state()),
_is_permenantly_cancelled (other._is_permenantly_cancelled),
_irrecoverable_error(other._irrecoverable_error),
_n_failed_iocs(other._n_failed_iocs),
other._price_quantity_state.order_state()),
_worker(nullptr),
_start_state_worker(this),
_waiting_for_size_state_worker(this),
@@ -40,15 +40,18 @@ private:
const bool _two_legged;
const bool _active_quoting;
const bool _hidden_order;
bool _is_permenantly_cancelled;
bool _irrecoverable_error;
// this is a config constant. if the quoter
// is in a hidden mode, this is the max
// number of cxl'ed IOCs with no fills,
// before the quoter goes to an irrecoverable
// eror state
const uint32_t _max_failed_iocs;
ISpreaderManager& _spreader;
const LegPropertyData& _this_leg_data;
const size_t _n_spreader_legs;
const uint32_t _max_failed_iocs;
uint32_t _n_failed_iocs;
ISpreaderManager& _spreader;
const LegPropertyData& _this_leg_data;
SpreaderChildOrderState& _child_order_state;
// computing the quoting price/quantity for multiple
// legs requires auxiliary storage for drivers, which
@@ -56,13 +59,10 @@ private:
// to send the orders, the drivers are committed to
std::vector<QuoteLegDriver> _drivers_temp_usage;
QuoteDriverSetHistory _driver_cache;
QuoteLegPriceQuantityState _price_quantity_state;
bool _is_permenantly_cancelled;
// also implies a terminal state (this is not clear)
bool _irrecoverable_error;
QuoteLegPriceQuantityState _price_quantity_state;
// also implies a terminal state (this is not clear)
// in hidden mode, every failed ioc increments
// this counter
uint32_t _n_failed_iocs;
// this counter
// state workers
IQuoterStateWorker* _worker;
QuoterStartStateWorker _start_state_worker;
@@ -11,9 +11,9 @@ SpreaderBookkeepingData::SpreaderBookkeepingData (ISpreaderManager& spreader_man
bool inited_new)
:
_is_live(spreader_pao_services.is_live()),
_inited_new (inited_new),
_n_legs(legs.size()),
_n_quoting_legs(_calc_n_quoting_legs(legs)),
_inited_new (inited_new),
_order_def(order_def),
_reported_state(){
LOG(OrderMan, Info, "SpreaderBookkeepingData.cons started key: {} n_legs: {}", spreader_order_key.value(), _n_legs);
@@ -22,11 +22,11 @@ class SpreaderBookkeepingData
{
private:
const bool _is_live;
const bool _inited_new;
const size_t _n_legs;
const size_t _n_quoting_legs;
// when the order is not created from the disk
// (ie created live) this is set to true
const bool _inited_new;
// (ie created live) this is set to true
std::vector<LegPropertyData> _leg_prop_data;
std::vector<Book> _books;
const api::orderman::OrderDefinition _order_def;