Skip to content

Commit

Permalink
fix errors after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Jun 19, 2024
1 parent 359dfe0 commit 5585f6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
24 changes: 11 additions & 13 deletions DXFeedFramework/Api/DXEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ public class DXEndpoint {
return instance
}
}
}

/// Builder class for ``DXEndpoint`` that supports additional configuration properties.
///
Expand All @@ -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]()
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion DXFeedFramework/Events/Market/AnalyticOrder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()), \
Expand Down
17 changes: 0 additions & 17 deletions DXFeedFramework/Events/Market/TheoPrice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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), \
}
"""
}
}

0 comments on commit 5585f6a

Please sign in to comment.