Class FixExecReportView
java.lang.Object
com.quantfinlib.fix.FixExecReportView
Garbage-free FIX 4.4 ExecutionReport reader — the inbound half of the
FIX hot path, completing the round trip
FixOrderEncoder started:
order out garbage-free, fill in garbage-free. Where FixMessage
materializes Strings per tag (right for session management and
research), this is a flyweight view: wrap(byte[], int, int) performs one
pass over the framed bytes recording primitive values and field
positions, and every getter returns a primitive. Nothing is allocated
after construction.
The fields extracted are exactly what a fill handler on the trading
path needs to call HftRiskGate.onFill and update order state:
ClOrdID (numeric, as issued by FixOrderEncoder), ExecType,
OrdStatus, Side, LastQty, LastPx, CumQty, LeavesQty. Prices come back as
scaled longs (lastPxMantissa() × 10^-lastPxDecimals())
— the same representation the encoder takes in, so the round trip never
touches a double. The symbol is exposed as bytes-in-place for comparison
against a registered table, never as a String.
Assumes an already-framed message (the FixDecoder owns
framing and checksum). Single-threaded, one view per session thread —
wrap, read, repeat.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongclOrdId()Numeric ClOrdID as issued byFixOrderEncoder; −1 when absent.longcumQty()byteexecType()Tag 150 as its ASCII byte ('0' new, 'F' trade, '4' canceled, ...).intlongLastPx as a scaled long:mantissa × 10^-decimals.longlastQty()longbyteTag 39 as its ASCII byte.byteside()Tag 54: '1' buy, '2' sell.booleansymbolEquals(byte[] asciiSymbol) Compares the in-place symbol bytes against a registered ASCII symbol (e.g. the same tableFixOrderEncoderholds) — the getter that replaces a String: resolve the dense id by probing your table.booleanwrap(byte[] buffer, int offset, int length) Parses one framed message in place.
-
Constructor Details
-
FixExecReportView
public FixExecReportView()
-
-
Method Details
-
wrap
public boolean wrap(byte[] buffer, int offset, int length) Parses one framed message in place. Returnstruewhen it is an ExecutionReport (35=8); other message types returnfalseand leave the getters undefined. Zero allocation. -
clOrdId
public long clOrdId()Numeric ClOrdID as issued byFixOrderEncoder; −1 when absent. -
execType
public byte execType()Tag 150 as its ASCII byte ('0' new, 'F' trade, '4' canceled, ...). -
ordStatus
public byte ordStatus()Tag 39 as its ASCII byte. -
side
public byte side()Tag 54: '1' buy, '2' sell. -
lastQty
public long lastQty() -
cumQty
public long cumQty() -
leavesQty
public long leavesQty() -
lastPxMantissa
public long lastPxMantissa()LastPx as a scaled long:mantissa × 10^-decimals. -
lastPxDecimals
public int lastPxDecimals() -
symbolEquals
public boolean symbolEquals(byte[] asciiSymbol) Compares the in-place symbol bytes against a registered ASCII symbol (e.g. the same tableFixOrderEncoderholds) — the getter that replaces a String: resolve the dense id by probing your table.
-