Skip to content

Commit

Permalink
Merge branch 'whitelist'
Browse files Browse the repository at this point in the history
Conflicts:
	Package.swift
  • Loading branch information
DimaRU committed Jan 11, 2024
2 parents 48f4776 + 7cd0e74 commit 8bd3bf2
Show file tree
Hide file tree
Showing 23 changed files with 537 additions and 384 deletions.
17 changes: 8 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import PackageDescription

let package = Package(
name: "FastRTPSBridge",
name: "FastRTPSSwift",
products: [
.library(
name: "FastRTPSBridge",
type: .dynamic,
targets: ["FastRTPSBridge"]),
name: "FastRTPSSwift",
targets: ["FastRTPSSwift"]),
],
dependencies: [
.package(name: "CDRCodable", url: "https://github.com/DimaRU/CDRCodable.git", from: "1.0.0"),
Expand All @@ -20,21 +19,21 @@ let package = Package(
dependencies: ["FastDDS"],
path: "Sources/FastRTPSWrapper"),
.target(
name: "FastRTPSBridge",
name: "FastRTPSSwift",
dependencies: ["CDRCodable", "FastRTPSWrapper"],
path: "Sources/FastRTPSBridge"),
.testTarget(
name: "FastRTPSBridgeTests",
dependencies: ["FastRTPSBridge"]),
name: "FastRTPSSwiftTests",
dependencies: ["FastRTPSSwift"]),
],
swiftLanguageVersions: [.v5],
cxxLanguageStandard: .cxx11
cxxLanguageStandard: .cxx14
)

#if os(Linux)
package.dependencies.removeAll(where: { $0.name == "FastDDS"})
package.targets.first(where: { $0.name == "FastRTPSWrapper"})!.dependencies = []
package.targets.first(where: { $0.name == "FastRTPSBridge"})!.linkerSettings = [
package.targets.first(where: { $0.name == "FastRTPSSwift"})!.linkerSettings = [
.linkedLibrary("fastrtps", .when(platforms: [.linux])),
.unsafeFlags(["-L/usr/local/lib"], .when(platforms: [.linux]))
]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# FastRTPSBridge
# FastRTPSSwift

A description of this package.
17 changes: 0 additions & 17 deletions Sources/FastRTPSBridge/DDSTopic.swift

This file was deleted.

6 changes: 0 additions & 6 deletions Sources/FastRTPSBridge/FastRTPSBridge.h

This file was deleted.

43 changes: 43 additions & 0 deletions Sources/FastRTPSSwift/DDSTopic.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/////
//// DDSTopic.swift
/// Copyright © 2020 Dmitriy Borovikov. All rights reserved.
//


import Foundation

/// Basic DDS topic requement. Must define topic name string as Raw value
public protocol DDSTopic: RawRepresentable where RawValue == String {}

/// Reader topic requements
public protocol DDSReaderTopic: DDSTopic {
/// Return profile which defines Reader parameters: durability and reliability QoS
var readerProfile: RTPSReaderProfile { get }
}

/// Writer topic requements
public protocol DDSWriterTopic: DDSTopic {
/// Return profile which defines Writer parameters: durability, reliability and disablePositiveACKs QoS
var writerProfile: RTPSWriterProfile { get }
}

public extension RTPSReaderProfile {
/// Initializer for RTPSReaderProfile
/// - Parameters:
/// - reliability: Reliability QoS
/// - durability: Durability QoS
init(reliability: Reliability, durability: Durability) {
self.init(keyed: false, reliability: reliability, durability: durability)
}
}

public extension RTPSWriterProfile {
/// Initializer for RTPRTPSWriterProfileSReaderProfile
/// - Parameters:
/// - reliability: Reliability QoS
/// - durability: Durability QoS
/// - disablePositiveACKs: disablePositiveACKs QoS
init(reliability: Reliability, durability: Durability, disablePositiveACKs: Bool) {
self.init(keyed: false, reliability: reliability, durability: durability, disablePositiveACKs: disablePositiveACKs)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import Foundation

/// Basic desctiption for DDS data types
public protocol DDSType: Codable {
/// Defines DDS type name, 'DDS::String' for example
static var ddsTypeName: String { get }
}

/// Describe keyed DDS data type
public protocol DDSKeyed: DDSType {
/// Data for topic key generation
var key: Data { get }
}

Expand Down
Loading

0 comments on commit 8bd3bf2

Please sign in to comment.