Class FixMarketDataView
FixMessage materializes
Strings per tag (right for session plumbing), this is a flyweight in the
mold of FixExecReportView: wrap(byte[], int, int) performs one pass over
the framed bytes recording primitives into preallocated entry arrays, and
every getter is primitive.
Subset (documented, honest): single-instrument messages — one Symbol (55) per message, entries carrying MDUpdateAction (279, X only; W entries are implicitly NEW), MDEntryType (269: '0' bid / '1' offer), MDEntryPx (270, scaled long: mantissa × 10^-decimals — the same representation the order encoder takes, so feed-to-order never touches a double) and MDEntrySize (271). Entry order within the message is preserved: for tiered LP streams, position IS the tier. Unknown tags are skipped without materializing anything.
Assumes an already-framed message: buffer[offset] is the first
byte of a tag, every field is SOH-terminated (including the last), and
checksum validation happened upstream — framing belongs to the transport
layer (the session-lane FixDecoder materializes messages and is
not this flyweight's feeder). Single-threaded: one view per feed thread —
wrap, read, repeat. Zero allocation after construction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final byteMDUpdateAction values (279); W entries reportACTION_NEW.static final byteMDEntryType values (269).static final byte -
Constructor Summary
ConstructorsConstructorDescription32 entries — deeper than any real LP tier stack.FixMarketDataView(int maxEntries) -
Method Summary
Modifier and TypeMethodDescriptionbyteaction(int entry) intNoMDEntries (268) as declared by the sender.longEntries dropped across the view's lifetime for exceeding maxEntries.intEntries actually retained (bounded by the constructor's maxEntries).booleanTrue for 35=W (full refresh), false for 35=X (incremental).doubleprice(int entry) MDEntryPx as a double — the safe conversion for double-domain consumers (fx.FxTierBook,fx.AggregatedBook).intpxDecimals(int entry) longpxMantissa(int entry) MDEntryPx as a scaled long:mantissa × 10^-decimals.longsize(int entry) booleansymbolEquals(byte[] asciiSymbol) In-place symbol comparison — same discipline asFixExecReportView.bytetype(int entry) ENTRY_BIDorENTRY_OFFER.booleanwrap(byte[] buffer, int offset, int length) Parses one framed message in place.
-
Field Details
-
ACTION_NEW
public static final byte ACTION_NEWMDUpdateAction values (279); W entries reportACTION_NEW.- See Also:
-
ACTION_CHANGE
public static final byte ACTION_CHANGE- See Also:
-
ACTION_DELETE
public static final byte ACTION_DELETE- See Also:
-
ENTRY_BID
public static final byte ENTRY_BIDMDEntryType values (269).- See Also:
-
ENTRY_OFFER
public static final byte ENTRY_OFFER- See Also:
-
-
Constructor Details
-
FixMarketDataView
public FixMarketDataView(int maxEntries) - Parameters:
maxEntries- entries retained per message (beyond that: counted, dropped)
-
FixMarketDataView
public FixMarketDataView()32 entries — deeper than any real LP tier stack.
-
-
Method Details
-
wrap
public boolean wrap(byte[] buffer, int offset, int length) Parses one framed message in place. Returnstruefor 35=W or 35=X; any other message type returnsfalseimmediately and leaves the getters undefined. Zero allocation. -
isSnapshot
public boolean isSnapshot()True for 35=W (full refresh), false for 35=X (incremental). -
entryCount
public int entryCount()Entries actually retained (bounded by the constructor's maxEntries). -
declaredEntries
public int declaredEntries()NoMDEntries (268) as declared by the sender. -
action
public byte action(int entry) -
type
public byte type(int entry) ENTRY_BIDorENTRY_OFFER. -
pxMantissa
public long pxMantissa(int entry) MDEntryPx as a scaled long:mantissa × 10^-decimals. Decimals follow the wire formatting and can differ per entry ("1.0850" → (10850, 4), "1.085" → (1085, 3)): never apply one entry's decimals to another's mantissa — compare viaprice(int)or rescale explicitly. -
pxDecimals
public int pxDecimals(int entry) -
price
public double price(int entry) MDEntryPx as a double — the safe conversion for double-domain consumers (fx.FxTierBook,fx.AggregatedBook). The scaled-long getters remain for pipelines that never touch a double. -
size
public long size(int entry) -
droppedEntries
public long droppedEntries()Entries dropped across the view's lifetime for exceeding maxEntries. -
symbolEquals
public boolean symbolEquals(byte[] asciiSymbol) In-place symbol comparison — same discipline asFixExecReportView.
-