internal SummarySample(DateTime ts, Stream stream) : base(ts) { var flags = SecDBPrimitives.ReadByte(stream); IsBidQty = (flags & (1)) != 0; IsAskQty = (flags & (1 << 1)) != 0; IsPositions = (flags & (1 << 2)) != 0; IsRisk = (flags & (1 << 3)) != 0; if (IsBidQty) { BidQty = SecDBPrimitives.ReadULEB128(stream); } if (IsAskQty) { AskQty = SecDBPrimitives.ReadULEB128(stream); } if (IsPositions) { Positions = SecDBPrimitives.ReadSLEB128(stream); } if (IsRisk) { RiskAmt = SecDBPrimitives.ReadDouble(stream); } }
internal InfoSample(DateTime ts, Stream stream) : base(ts) { var tp = SecDBPrimitives.ReadByte(stream); if (tp == 0) { Body = SecDBPrimitives.ReadString(stream); } else { ResID = SecDBPrimitives.ReadULEB128(stream); } }
internal TradeSample(SecDBFileReader file, TradeSample ps, DateTime ts, Stream stream) : base(ts) { var flags = SecDBPrimitives.ReadByte(stream); InternalTrade = (flags & (1)) != 0; Aggressor = (AggressorType)((flags >> 1) & 0x3); Side = (SideType)((flags >> 3) & 0x1); IsQty = (flags & (1 << 4)) != 0; IsTradeID = (flags & (1 << 5)) != 0; IsOrderID = (flags & (1 << 6)) != 0; var price = SecDBPrimitives.ReadSLEB128(stream); if (ps == null) { PriceStep = price; } else { PriceStep = ps.PriceStep + price; } Price = PriceStep * file.SystemHeader.PriceStep; if (IsQty) { Qty = SecDBPrimitives.ReadSLEB128(stream); } if (IsTradeID) { TradeID = SecDBPrimitives.ReadULEB128(stream); } if (IsOrderID) { OrderID = SecDBPrimitives.ReadULEB128(stream); } }