Skip to content

Commit

Permalink
update to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Nov 17, 2023
1 parent 28454ad commit 5cfc776
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
52 changes: 26 additions & 26 deletions DXFeedFramework/Native/Ipf/InstrumentProfile+Ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ extension InstrumentProfile {
type = String(pointee: native.type)
symbol = String(pointee: native.symbol)
descriptionStr = String(pointee: native.description)
localSymbol = String(pointee: native.localSymbol)
localDescription = String(pointee: native.localDescription)
localSymbol = String(pointee: native.local_symbol)
localDescription = String(pointee: native.local_description)
country = String(pointee: native.country)
opol = String(pointee: native.opol)
exchangeData = String(pointee: native.exchangeData)
exchangeData = String(pointee: native.exchange_data)
exchanges = String(pointee: native.exchanges)
currency = String(pointee: native.currency)
baseCurrency = String(pointee: native.baseCurrency)
baseCurrency = String(pointee: native.base_currency)
cfi = String(pointee: native.cfi)
isin = String(pointee: native.isin)
sedol = String(pointee: native.sedol)
Expand All @@ -36,24 +36,24 @@ extension InstrumentProfile {
product = String(pointee: native.product)
underlying = String(pointee: native.underlying)
spc = native.spc
additionalUnderlyings = String(pointee: native.additionalUnderlyings)
additionalUnderlyings = String(pointee: native.additional_underlyings)
mmy = String(pointee: native.mmy)
expiration = native.expiration
lastTrade = native.lastTrade
lastTrade = native.last_trade
strike = native.strike
optionType = String(pointee: native.optionType)
expirationStyle = String(pointee: native.expirationStyle)
settlementStyle = String(pointee: native.settlementStyle)
priceIncrements = String(pointee: native.priceIncrements)
tradingHours = String(pointee: native.tradingHours)
optionType = String(pointee: native.option_type)
expirationStyle = String(pointee: native.expiration_style)
settlementStyle = String(pointee: native.settlement_style)
priceIncrements = String(pointee: native.price_increments)
tradingHours = String(pointee: native.trading_hours)
var customFields = [String: String]()
let count = native.customFields.pointee.size
let count = native.custom_fields.pointee.size
for index in 0..<Int(count) where index&1 != 1 {
if let keyElement = native.customFields.pointee.elements[index] {
if let keyElement = native.custom_fields.pointee.elements[index] {
let key = String(pointee: keyElement)
if index == count - 1 {
customFields[key] = ""
} else if let valueElement = native.customFields.pointee.elements[index + 1] {
} else if let valueElement = native.custom_fields.pointee.elements[index + 1] {
customFields[key] = String(pointee: valueElement)
}
}
Expand All @@ -65,14 +65,14 @@ extension InstrumentProfile {
pointer.pointee.type = type.toCStringRef()
pointer.pointee.symbol = symbol.toCStringRef()
pointer.pointee.description = descriptionStr.toCStringRef()
pointer.pointee.localSymbol = localSymbol.toCStringRef()
pointer.pointee.localDescription = localDescription.toCStringRef()
pointer.pointee.local_symbol = localSymbol.toCStringRef()
pointer.pointee.local_description = localDescription.toCStringRef()
pointer.pointee.country = country.toCStringRef()
pointer.pointee.opol = opol.toCStringRef()
pointer.pointee.exchangeData = exchangeData.toCStringRef()
pointer.pointee.exchange_data = exchangeData.toCStringRef()
pointer.pointee.exchanges = exchanges.toCStringRef()
pointer.pointee.currency = currency.toCStringRef()
pointer.pointee.baseCurrency = baseCurrency.toCStringRef()
pointer.pointee.base_currency = baseCurrency.toCStringRef()
pointer.pointee.cfi = cfi.toCStringRef()
pointer.pointee.isin = isin.toCStringRef()
pointer.pointee.sedol = sedol.toCStringRef()
Expand All @@ -83,19 +83,19 @@ extension InstrumentProfile {
pointer.pointee.product = product.toCStringRef()
pointer.pointee.underlying = underlying.toCStringRef()
pointer.pointee.spc = spc
pointer.pointee.additionalUnderlyings = additionalUnderlyings.toCStringRef()
pointer.pointee.additional_underlyings = additionalUnderlyings.toCStringRef()
pointer.pointee.mmy = mmy.toCStringRef()
pointer.pointee.expiration = expiration
pointer.pointee.lastTrade = lastTrade
pointer.pointee.last_trade = lastTrade
pointer.pointee.strike = strike
pointer.pointee.optionType = optionType.toCStringRef()
pointer.pointee.expirationStyle = expirationStyle.toCStringRef()
pointer.pointee.settlementStyle = settlementStyle.toCStringRef()
pointer.pointee.priceIncrements = priceIncrements.toCStringRef()
pointer.pointee.tradingHours = tradingHours.toCStringRef()
pointer.pointee.option_type = optionType.toCStringRef()
pointer.pointee.expiration_style = expirationStyle.toCStringRef()
pointer.pointee.settlement_style = settlementStyle.toCStringRef()
pointer.pointee.price_increments = priceIncrements.toCStringRef()
pointer.pointee.trading_hours = tradingHours.toCStringRef()
let list = UnsafeMutablePointer<dxfg_string_list>.allocate(capacity: 1)
list.pointee.size = 0
list.pointee.elements = nil
pointer.pointee.customFields = list
pointer.pointee.custom_fields = list
}
}
4 changes: 2 additions & 2 deletions DXFeedFramework/Native/Ipf/InstrumentProfileMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class InstrumentProfileMapper {
}

func releaseNative(native: UnsafeMutablePointer<dxfg_instrument_profile_t>) {
native.pointee.customFields.deinitialize(count: 1)
native.pointee.customFields.deallocate()
native.pointee.custom_fields.deinitialize(count: 1)
native.pointee.custom_fields.deallocate()
native.deinitialize(count: 1)
native.deallocate()
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {
}
}

def native_version = '1.1.2'
def native_version = '1.1.3'
def name = 'graal-native-sdk'
dependencies {
implementation(group: 'com.dxfeed', name: "${name}", version: "${native_version}", classifier: 'aarch64-osx', ext: 'zip')
Expand Down

0 comments on commit 5cfc776

Please sign in to comment.