Class FixExecReportView

java.lang.Object
com.quantfinlib.fix.FixExecReportView

public final class FixExecReportView extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Numeric ClOrdID as issued by FixOrderEncoder; −1 when absent.
    long
     
    byte
    Tag 150 as its ASCII byte ('0' new, 'F' trade, '4' canceled, ...).
    int
     
    long
    LastPx as a scaled long: mantissa × 10^-decimals.
    long
     
    long
     
    byte
    Tag 39 as its ASCII byte.
    byte
    Tag 54: '1' buy, '2' sell.
    boolean
    symbolEquals(byte[] asciiSymbol)
    Compares the in-place symbol bytes against a registered ASCII symbol (e.g. the same table FixOrderEncoder holds) — the getter that replaces a String: resolve the dense id by probing your table.
    boolean
    wrap(byte[] buffer, int offset, int length)
    Parses one framed message in place.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FixExecReportView

      public FixExecReportView()
  • Method Details

    • wrap

      public boolean wrap(byte[] buffer, int offset, int length)
      Parses one framed message in place. Returns true when it is an ExecutionReport (35=8); other message types return false and leave the getters undefined. Zero allocation.
    • clOrdId

      public long clOrdId()
      Numeric ClOrdID as issued by FixOrderEncoder; −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 table FixOrderEncoder holds) — the getter that replaces a String: resolve the dense id by probing your table.