From 5585f6a4a3cd9afdafcd70d0f52b834bccd56199 Mon Sep 17 00:00:00 2001 From: Aleksey Kosylo Date: Wed, 19 Jun 2024 10:40:26 +0200 Subject: [PATCH] fix errors after rebase --- DXFeedFramework/Api/DXEndpoint.swift | 24 +++++++++---------- .../Events/Market/AnalyticOrder.swift | 2 +- DXFeedFramework/Events/Market/TheoPrice.swift | 17 ------------- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/DXFeedFramework/Api/DXEndpoint.swift b/DXFeedFramework/Api/DXEndpoint.swift index fa0c06080..b9dc32d8d 100644 --- a/DXFeedFramework/Api/DXEndpoint.swift +++ b/DXFeedFramework/Api/DXEndpoint.swift @@ -405,6 +405,7 @@ public class DXEndpoint { return instance } } +} /// Builder class for ``DXEndpoint`` that supports additional configuration properties. /// @@ -430,7 +431,7 @@ public class DXEndpoint { /// **Threads and locks** /// /// This class is thread-safe and can be used concurrently from multiple threads without external synchronization. -/// +/// public class Builder { var role = Role.feed var props = [String: String]() @@ -477,7 +478,7 @@ public class Builder { /// - proeprty: Property name /// - Returns: Returns Bool /// - Throws: ``GraalException``. Rethrows exception from Java. - public func isSupported(property: String) throws -> Bool { + public func isSupported(_ property: String) throws -> Bool { return try nativeBuilder?.isSuppored(property: property) ?? false } @@ -509,23 +510,20 @@ public class Builder { /// This method tries to load default properties file. /// - Returns: Returns this ``DXEndpoint`` /// - Throws: ``GraalException``. Rethrows exception from Java. - } - public func build() throws -> DXEndpoint { - return try DXEndpoint(native: try nativeBuilder!.build(), role: role, name: getOrCreateEndpointName()) - } + public func build() throws -> DXEndpoint { + return try DXEndpoint(native: try nativeBuilder!.build(), role: role, name: getOrCreateEndpointName()) + } /// Gets or creates an endpoint name. /// If there is no ``DXEndpoint/Property/name`` in the user-defined properties, /// it returns a default name that includes a counter that increments each time an endpoint is created. /// - Returns: New string name - private func getOrCreateEndpointName() -> String { - if let name = props[DXEndpoint.Property.name.rawValue] { - return name - } - let value = OSAtomicIncrement64(&instancesNumerator) - return "qdnet_\(value == 0 ? "" : "-\(value)")" + private func getOrCreateEndpointName() -> String { + if let name = props[DXEndpoint.Property.name.rawValue] { + return name } + let value = OSAtomicIncrement64(&instancesNumerator) + return "qdnet_\(value == 0 ? "" : "-\(value)")" } - } extension DXEndpoint: EndpointListener { diff --git a/DXFeedFramework/Events/Market/AnalyticOrder.swift b/DXFeedFramework/Events/Market/AnalyticOrder.swift index a3455f791..b0294bf16 100644 --- a/DXFeedFramework/Events/Market/AnalyticOrder.swift +++ b/DXFeedFramework/Events/Market/AnalyticOrder.swift @@ -41,7 +41,7 @@ public class AnalyticOrder: Order { } /// Returns string representation of this candle event. - override func toString() -> String { + public override func toString() -> String { return """ AnalyticOrder{\(baseFieldsToString()), \ diff --git a/DXFeedFramework/Events/Market/TheoPrice.swift b/DXFeedFramework/Events/Market/TheoPrice.swift index 1072b5dc4..893323c67 100644 --- a/DXFeedFramework/Events/Market/TheoPrice.swift +++ b/DXFeedFramework/Events/Market/TheoPrice.swift @@ -120,21 +120,4 @@ extension TheoPrice { } index = Long(index & ~Long(MarketEventConst.maxSequence)) | Long(sequence) } - /// Returns string representation of this order fields. - public func toString() -> String { - return """ -TheoPrice{\(eventSymbol) \ -eventTime=\((try? DXTimeFormat.defaultTimeFormat?.withMillis?.format(value: eventTime)) ?? ""), \ -eventFlags=\(eventFlags.toHexString()), \ -time=\((try? DXTimeFormat.defaultTimeFormat?.withMillis?.format(value: time)) ?? ""), \ -sequence=\(self.getSequence()), \ -price=\(price) \ -underlyingPrice=\(underlyingPrice), \ -delta=\(delta), \ -gamma=\(gamma), \ -dividend=\(dividend), \ -interest=\(interest), \ -} -""" - } }