-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
263 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
DXFeedFramework/Ipf/Live/InstrumentProfileConnectionObserver.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// InstrumentProfileConnectionObserver.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 01.09.23. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol InstrumentProfileConnectionObserver { | ||
func connectionDidChangeState(old: InstrumentProfileConnectionState, new: InstrumentProfileConnectionState) | ||
} |
16 changes: 16 additions & 0 deletions
16
DXFeedFramework/Ipf/Live/InstrumentProfileConnectionState.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// InstrumentProfileConnectionState.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 01.09.23. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum InstrumentProfileConnectionState { | ||
case notConnected | ||
case connecting | ||
case connected | ||
case completed | ||
case closed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
DXFeedFramework/Native/Ipf/Live/InstrumentProfileConnectionState+ext.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// InstrumentProfileConnectionState+ext.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 01.09.23. | ||
// | ||
|
||
import Foundation | ||
@_implementationOnly import graal_api | ||
|
||
extension InstrumentProfileConnectionState { | ||
static func convert(_ state: dxfg_ipf_connection_state_t) -> InstrumentProfileConnectionState? { | ||
switch state { | ||
case DXFG_IPF_CONNECTION_STATE_NOT_CONNECTED: | ||
return .closed | ||
case DXFG_IPF_CONNECTION_STATE_CONNECTING: | ||
return .connected | ||
case DXFG_IPF_CONNECTION_STATE_CONNECTED: | ||
return .connecting | ||
case DXFG_IPF_CONNECTION_STATE_COMPLETED: | ||
return .notConnected | ||
case DXFG_IPF_CONNECTION_STATE_CLOSED: | ||
return .notConnected | ||
default: | ||
return nil | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.