Skip to content

Commit

Permalink
add documentations for DXFeed
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed Sep 8, 2023
1 parent 4894168 commit bc3b728
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions DXFeedFramework/Api/DXFeed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,40 @@

import Foundation

/// Main entry class for dxFeed API.
///
/// [Read it first Javadoc](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXFeed.html)
public class DXFeed {
/// Feed native wrapper.
private let native: NativeFeed
private var attachedSubscriptions = ConcurrentSet<DXFeedSubcription>()

deinit {
}

internal init(native: NativeFeed?) throws {
if let native = native {
self.native = native
} else {
throw NativeException.nilValue
}
}

/// Creates new subscription for a list of event types that is attached to this feed.
///
/// [Javadoc](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXFeed.html#createSubscription-java.lang.Class)
/// - Parameters:
/// - events: The list of event codes.
/// - Returns: ``DXFeedSubcription``
/// - Throws: GraalException. Rethrows exception from Java.
public func createSubscription(_ events: [EventCode]) throws -> DXFeedSubcription {
return try DXFeedSubcription(native: native.createSubscription(events), events: events)
}

/// Creates new subscription for a one event type that is attached to this feed.
///
/// [Javadoc](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXFeed.html#createSubscription-java.lang.Class)
/// - Parameters:
/// - event: event code
/// - Returns: ``DXFeedSubcription``
/// - Throws: GraalException. Rethrows exception from Java.
public func createSubscription(_ event: EventCode) throws -> DXFeedSubcription {
return try DXFeedSubcription(native: native.createSubscription(event), events: [event])
}
Expand Down

0 comments on commit bc3b728

Please sign in to comment.