Skip to content

Commit

Permalink
fix analytic order inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Oct 24, 2023
1 parent d1379d2 commit 8e86bd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DXFeedFramework/Events/Market/AnalyticOrder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
/// that is available about orders on the market at any given moment of time.
///
/// [For more details see](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/market/AnalyticOrder.html)
public class AnalyticOrder: OrderBase {
public class AnalyticOrder: Order {
public override var type: EventCode {
return .analyticOrder
}
Expand Down
2 changes: 2 additions & 0 deletions DXFeedFramework/Native/Events/Markets/AnalyticOrder+Ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ extension AnalyticOrder {
self.icebergHiddenSize = native.iceberg_hidden_size
self.icebergExecutedSize = native.iceberg_executed_size
self.icebergFlags = native.iceberg_flags

self.marketMaker = native.order_base.market_maker != nil ? String(pointee: native.order_base.market_maker) : nil
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class AnalyticOrderMapper: Mapper {
pointer.pointee.iceberg_executed_size = order.icebergExecutedSize
pointer.pointee.iceberg_flags = order.icebergFlags

if let marketMaker = order.marketMaker {
pointer.pointee.order_base.market_maker = marketMaker.toCStringRef()
} else {
pointer.pointee.order_base.market_maker = nil
}

let eventType = pointer.withMemoryRebound(to: dxfg_event_type_t.self, capacity: 1) { pointer in
pointer.pointee.clazz = DXFG_EVENT_ANALYTIC_ORDER
return pointer
Expand Down

0 comments on commit 8e86bd7

Please sign in to comment.