From 180f5ab35fd71d80c4330aca78c40c6fb14222a9 Mon Sep 17 00:00:00 2001 From: AKosylo Date: Thu, 7 Dec 2023 10:47:53 +0100 Subject: [PATCH] remove not neccessary logs --- .../Market/Candles/CandleAlignment.swift | 8 ++------ .../Events/Market/Candles/CandlePeriod.swift | 4 +--- .../Events/Market/Candles/CandlePrice.swift | 4 +--- .../Market/Candles/CandlePriceLevel.swift | 4 +--- .../Events/Market/Candles/CandleSession.swift | 4 +--- .../Events/Market/Extra/IIndexedEvent.swift | 2 +- .../Events/Market/Extra/OrderBase.swift | 18 ++++++++++-------- .../Native/Endpoint/NativeEndpoint.swift | 2 -- .../Events/Markets/AnalyticOrder+Ext.swift | 2 +- .../Native/Events/Markets/Order+Ext.swift | 2 +- .../Events/Markets/SpreadOrder+Ext.swift | 2 +- .../NativeInstrumentProfileCollector.swift | 4 +--- Samples/QdsTools/Base.lproj/Main.storyboard | 4 ++-- 13 files changed, 23 insertions(+), 37 deletions(-) diff --git a/DXFeedFramework/Events/Market/Candles/CandleAlignment.swift b/DXFeedFramework/Events/Market/Candles/CandleAlignment.swift index 9f7a9a499..6f7abc33c 100644 --- a/DXFeedFramework/Events/Market/Candles/CandleAlignment.swift +++ b/DXFeedFramework/Events/Market/Candles/CandleAlignment.swift @@ -76,9 +76,7 @@ public enum CandleAlignment: DXCandleAlignment, CaseIterable { attributeKey, other.toString()) } - } catch let error { - print(error) - } + } catch let error { } return symbol } @@ -148,9 +146,7 @@ extension CandleAlignment: ICandleSymbolProperty { CandleAlignment.attributeKey, self.toString()) return res - } catch let error { - print(error) - } + } catch let error { } } return symbol } diff --git a/DXFeedFramework/Events/Market/Candles/CandlePeriod.swift b/DXFeedFramework/Events/Market/Candles/CandlePeriod.swift index 394c515c8..b3433bebe 100644 --- a/DXFeedFramework/Events/Market/Candles/CandlePeriod.swift +++ b/DXFeedFramework/Events/Market/Candles/CandlePeriod.swift @@ -61,9 +61,7 @@ public class CandlePeriod { attribute, other.toString()) } - } catch let error { - print(error) - } + } catch let error { } return symbol } diff --git a/DXFeedFramework/Events/Market/Candles/CandlePrice.swift b/DXFeedFramework/Events/Market/Candles/CandlePrice.swift index ab05aacd6..7784e7727 100644 --- a/DXFeedFramework/Events/Market/Candles/CandlePrice.swift +++ b/DXFeedFramework/Events/Market/Candles/CandlePrice.swift @@ -94,9 +94,7 @@ public enum CandlePrice: DXCandlePrice, CaseIterable { if attribute != other.toString() { return try MarketEventSymbols.changeAttributeStringByKey(symbol, attributeKey, other.toString()) } - } catch let error { - print(error) - } + } catch let error { } return symbol } /// Gets candle price of the given candle symbol string. diff --git a/DXFeedFramework/Events/Market/Candles/CandlePriceLevel.swift b/DXFeedFramework/Events/Market/Candles/CandlePriceLevel.swift index 7d743be57..b53ac5bc6 100644 --- a/DXFeedFramework/Events/Market/Candles/CandlePriceLevel.swift +++ b/DXFeedFramework/Events/Market/Candles/CandlePriceLevel.swift @@ -62,9 +62,7 @@ public class CandlePriceLevel { attributeKey, other.toString()) } - } catch let error { - print(error) - } + } catch let error { } return symbol } diff --git a/DXFeedFramework/Events/Market/Candles/CandleSession.swift b/DXFeedFramework/Events/Market/Candles/CandleSession.swift index f58c1d0c2..b8c12677f 100644 --- a/DXFeedFramework/Events/Market/Candles/CandleSession.swift +++ b/DXFeedFramework/Events/Market/Candles/CandleSession.swift @@ -75,9 +75,7 @@ public enum CandleSession: DXCandleSession, CaseIterable { if other == false || other == nil { _ = MarketEventSymbols.removeAttributeStringByKey(symbol, attributeKey) } - } catch let error { - print(error) - } + } catch let error { } return symbol } /// Gets candle session of the given candle symbol string. diff --git a/DXFeedFramework/Events/Market/Extra/IIndexedEvent.swift b/DXFeedFramework/Events/Market/Extra/IIndexedEvent.swift index 0447f6533..693338f15 100644 --- a/DXFeedFramework/Events/Market/Extra/IIndexedEvent.swift +++ b/DXFeedFramework/Events/Market/Extra/IIndexedEvent.swift @@ -47,7 +47,7 @@ public protocol IIndexedEvent: IEventType { /// Gets or sets transactional event flags. var eventFlags: Int32 { get set } /// Gets or sets unique per-symbol index of this event. - var index: Long { get set } + var index: Long { get } } /// Just wrapper around event flags. diff --git a/DXFeedFramework/Events/Market/Extra/OrderBase.swift b/DXFeedFramework/Events/Market/Extra/OrderBase.swift index 456b78e75..184290cef 100644 --- a/DXFeedFramework/Events/Market/Extra/OrderBase.swift +++ b/DXFeedFramework/Events/Market/Extra/OrderBase.swift @@ -30,14 +30,7 @@ public class OrderBase: MarketEvent, IIndexedEvent, CustomStringConvertible { public var eventFlags: Int32 = 0 - public var index: Long = 0 { - didSet { - if index < 0 { - index = 0 - print("Negative index for \(self)") - } - } - } + public private(set) var index: Long = 0 public var eventSymbol: String @@ -163,6 +156,15 @@ tradeSize: \(tradeSize) } extension OrderBase { + /// Gets or sets unique per-symbol index of this event. + /// - Throws: ``ArgumentException/exception(_:)`` + public func setIndex(_ value: Long) throws { + if index < 0 { + throw ArgumentException.exception("Negative index: \(index)") + } + self.index = value + } + /// Gets a value indicating whether this order has some size public func hsaSize() -> Bool { return size != 0 && !size.isNaN diff --git a/DXFeedFramework/Native/Endpoint/NativeEndpoint.swift b/DXFeedFramework/Native/Endpoint/NativeEndpoint.swift index c682028d8..f6265f6d2 100644 --- a/DXFeedFramework/Native/Endpoint/NativeEndpoint.swift +++ b/DXFeedFramework/Native/Endpoint/NativeEndpoint.swift @@ -43,7 +43,6 @@ class NativeEndpoint { let nativeFeed = try ErrorCheck.nativeCall(thread, dxfg_DXEndpoint_getFeed(thread, self.endpoint)) return NativeFeed(feed: nativeFeed) } catch { - print(error) return nil } }() @@ -54,7 +53,6 @@ class NativeEndpoint { let nativeFeed = try ErrorCheck.nativeCall(thread, dxfg_DXEndpoint_getPublisher(thread, self.endpoint)) return NativePublisher(publisher: nativeFeed) } catch { - print(error) return nil } }() diff --git a/DXFeedFramework/Native/Events/Markets/AnalyticOrder+Ext.swift b/DXFeedFramework/Native/Events/Markets/AnalyticOrder+Ext.swift index b79859bd8..ab75cb4f7 100644 --- a/DXFeedFramework/Native/Events/Markets/AnalyticOrder+Ext.swift +++ b/DXFeedFramework/Native/Events/Markets/AnalyticOrder+Ext.swift @@ -13,7 +13,7 @@ extension AnalyticOrder { self.eventTime = native.order_base.order_base.market_event.event_time self.eventFlags = native.order_base.order_base.event_flags - self.index = native.order_base.order_base.index + try? self.setIndex(native.order_base.order_base.index) self.timeSequence = native.order_base.order_base.time_sequence self.timeNanoPart = native.order_base.order_base.time_nano_part self.actionTime = native.order_base.order_base.action_time diff --git a/DXFeedFramework/Native/Events/Markets/Order+Ext.swift b/DXFeedFramework/Native/Events/Markets/Order+Ext.swift index 4a41e6d11..c9892c635 100644 --- a/DXFeedFramework/Native/Events/Markets/Order+Ext.swift +++ b/DXFeedFramework/Native/Events/Markets/Order+Ext.swift @@ -13,7 +13,7 @@ extension Order { self.eventTime = native.order_base.market_event.event_time self.eventFlags = native.order_base.event_flags - self.index = native.order_base.index + try? self.setIndex(native.order_base.index) self.timeSequence = native.order_base.time_sequence self.timeNanoPart = native.order_base.time_nano_part self.actionTime = native.order_base.action_time diff --git a/DXFeedFramework/Native/Events/Markets/SpreadOrder+Ext.swift b/DXFeedFramework/Native/Events/Markets/SpreadOrder+Ext.swift index ee0c88ad8..7622e07cc 100644 --- a/DXFeedFramework/Native/Events/Markets/SpreadOrder+Ext.swift +++ b/DXFeedFramework/Native/Events/Markets/SpreadOrder+Ext.swift @@ -13,7 +13,7 @@ extension SpreadOrder { self.eventTime = native.order_base.market_event.event_time self.eventFlags = native.order_base.event_flags - self.index = native.order_base.index + try? self.setIndex(native.order_base.index) self.timeSequence = native.order_base.time_sequence self.timeNanoPart = native.order_base.time_nano_part self.actionTime = native.order_base.action_time diff --git a/DXFeedFramework/Native/Ipf/Live/NativeInstrumentProfileCollector.swift b/DXFeedFramework/Native/Ipf/Live/NativeInstrumentProfileCollector.swift index a02dd1211..a59649829 100644 --- a/DXFeedFramework/Native/Ipf/Live/NativeInstrumentProfileCollector.swift +++ b/DXFeedFramework/Native/Ipf/Live/NativeInstrumentProfileCollector.swift @@ -43,9 +43,7 @@ public class NativeInstrumentProfileCollector { do { let profile = try iterator.next() profiles.append(profile) - } catch { - print("NativeInstrumentProfileCollector: exception \(error)") - } + } catch { } } listener.value?.instrumentProfilesUpdated(profiles) } diff --git a/Samples/QdsTools/Base.lproj/Main.storyboard b/Samples/QdsTools/Base.lproj/Main.storyboard index b1349086b..cfeda71c7 100644 --- a/Samples/QdsTools/Base.lproj/Main.storyboard +++ b/Samples/QdsTools/Base.lproj/Main.storyboard @@ -38,12 +38,12 @@ - + - +