Class OrderFlyweight
java.lang.Object
com.quantfinlib.sbe.OrderFlyweight
SBE-style flyweight codec for an order-entry message — the binary
counterpart of a FIX NewOrderSingle, at fixed offsets with zero
allocation and zero parsing (see
TradeFlyweight for the pattern).
Wire layout (little-endian, 44 bytes; 3 bytes padding keep the 64-bit fields naturally aligned):
offset 0 int32 messageType = 2 offset 4 int64 orderId offset 12 int32 symbolId offset 16 int8 side (0 = BUY, 1 = SELL) offset 17 int8[3] padding offset 20 int64 quantity offset 28 double price (NaN = market order) offset 36 int64 timestampNanos
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTotal encoded size in bytes.static final intMessage type discriminator at offset 0. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MESSAGE_TYPE
public static final int MESSAGE_TYPEMessage type discriminator at offset 0.- See Also:
-
BLOCK_LENGTH
public static final int BLOCK_LENGTHTotal encoded size in bytes.- See Also:
-
-
Constructor Details
-
OrderFlyweight
public OrderFlyweight()
-
-
Method Details
-
wrap
-
encode
public OrderFlyweight encode(long orderId, int symbolId, Side side, long quantity, double price, long timestampNanos) Encodes a full order message at the wrap position (writes the type header). -
orderId
public long orderId() -
symbolId
public int symbolId() -
side
-
quantity
public long quantity() -
price
public double price() -
timestampNanos
public long timestampNanos()
-