Skip to content

Commit

Permalink
Add Swift Package Manager sources
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocbot committed Mar 8, 2024
0 parents commit 973dc70
Show file tree
Hide file tree
Showing 622 changed files with 211,427 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ICE_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Copyright (c) ZeroC, Inc. All rights reserved.

This copy of Ice is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.

Ice is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License version
2 along with this program; if not, see http://www.gnu.org/licenses.

Linking Ice statically or dynamically with other software (such as a
library, module or application) is making a combined work based on Ice.
Thus, the terms and conditions of the GNU General Public License version
2 cover this combined work.

If such software can only be used together with Ice, then not only the
combined work but the software itself is a work derived from Ice and as
such shall be licensed under the terms of the GNU General Public License
version 2. This includes the situation where Ice is only being used
through an abstraction layer.

As a special exception to the above, ZeroC grants to the copyright
holders and contributors of the Mumble project (http://www.mumble.info)
the permission to license the Ice-based software they contribute to
Mumble under the terms of the BSD license. This exception does not extend
to the parts of Ice used by Mumble, or to any other derived work: as a
whole, any work based on Ice shall be licensed under the terms and
conditions of the GNU General Public License version 2.

You may also combine Ice with any software not derived from Ice, provided
the license of such software is compatible with the GNU General Public
License version 2. In addition, as a special exception, ZeroC grants you
permission to combine Ice with:

- the OpenSSL library, or with a modified version of the OpenSSL library
that uses the same license as OpenSSL

- any library not derived from Ice and licensed under the terms of
the Apache License, version 2.0
(http://www.apache.org/licenses/LICENSE-2.0.html)

If you modify this copy of Ice, you may extend any of the exceptions
provided above to your version of Ice, but you are not obligated to
do so.
340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let cxxSettings: [CXXSetting] = [
.define("ICE_BUILDING_SRC"),
.define("ICE_STATIC_LIBS"),
.define("ICE_SWIFT"),
.define("ICE_CPP11_MAPPING")]

let package = Package(
name: "Ice",
platforms: [
.macOS(.v10_14),
.iOS(.v12),
],
products: [
.library(name: "Ice", targets: ["Ice"]),
.library(name: "Glacier2", targets: ["Glacier2"]),
.library(name: "IceStorm", targets: ["IceStorm"]),
.library(name: "IceGrid", targets: ["IceGrid"])
],
dependencies: [
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.8.10")
],
targets: [
.target(name: "IceCpp", cxxSettings: cxxSettings,
linkerSettings: [.linkedLibrary("iconv"), .linkedLibrary("bz2")]),
.target(name: "IceSSLCpp", dependencies: ["IceCpp"], cxxSettings: cxxSettings),
.target(name: "IceDiscoveryCpp", dependencies: ["IceCpp"], cxxSettings: cxxSettings),
.target(name: "IceLocatorDiscoveryCpp", dependencies: ["IceCpp"], cxxSettings: cxxSettings),
.target(name: "IceImpl",
dependencies: ["IceCpp", "IceSSLCpp", "IceDiscoveryCpp", "IceLocatorDiscoveryCpp"],
cxxSettings: cxxSettings,
linkerSettings: [.linkedFramework("ExternalAccessory")]),
.target(name: "Ice", dependencies: ["IceImpl", "PromiseKit"]),
.target(name: "Glacier2", dependencies: ["Ice"]),
.target(name: "IceStorm", dependencies: ["Ice"]),
.target(name: "IceGrid", dependencies: ["Ice", "Glacier2"])
],
cxxLanguageStandard: .cxx14
)
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ice for Swift

This tag provides the Ice for Swift source code for the Swift Package Manager (SPM).
It includes Swift and C++ code generated by slice2swift and slice2cpp.
109 changes: 109 additions & 0 deletions Sources/Glacier2/Metrics.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.10
//
// <auto-generated>
//
// Generated from file `Metrics.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//

import Foundation
import Ice

/// Traits for Slice class `MXSessionMetrics`.
public struct MXSessionMetricsTraits: Ice.SliceTraits {
public static let staticIds = ["::Ice::Object", "::IceMX::Metrics", "::IceMX::SessionMetrics"]
public static let staticId = "::IceMX::SessionMetrics"
}

/// :nodoc:
public class MXSessionMetrics_TypeResolver: Ice.ValueTypeResolver {
public override func type() -> Ice.Value.Type {
return MXSessionMetrics.self
}
}

public extension Ice.ClassResolver {
@objc static func IceMX_SessionMetrics() -> Ice.ValueTypeResolver {
return MXSessionMetrics_TypeResolver()
}
}

/// Provides information on Glacier2 sessions.
open class MXSessionMetrics: Ice.MXMetrics {
/// Number of client requests forwared.
public var forwardedClient: Swift.Int32 = 0
/// Number of server requests forwared.
public var forwardedServer: Swift.Int32 = 0
/// The size of the routing table.
public var routingTableSize: Swift.Int32 = 0
/// Number of client requests queued.
public var queuedClient: Swift.Int32 = 0
/// Number of server requests queued.
public var queuedServer: Swift.Int32 = 0
/// Number of client requests overridden.
public var overriddenClient: Swift.Int32 = 0
/// Number of server requests overridden.
public var overriddenServer: Swift.Int32 = 0

public required init() {
super.init()
}

public init(id: Swift.String, total: Swift.Int64, current: Swift.Int32, totalLifetime: Swift.Int64, failures: Swift.Int32, forwardedClient: Swift.Int32, forwardedServer: Swift.Int32, routingTableSize: Swift.Int32, queuedClient: Swift.Int32, queuedServer: Swift.Int32, overriddenClient: Swift.Int32, overriddenServer: Swift.Int32) {
self.forwardedClient = forwardedClient
self.forwardedServer = forwardedServer
self.routingTableSize = routingTableSize
self.queuedClient = queuedClient
self.queuedServer = queuedServer
self.overriddenClient = overriddenClient
self.overriddenServer = overriddenServer
super.init(id: id, total: total, current: current, totalLifetime: totalLifetime, failures: failures)
}

/// Returns the Slice type ID of the most-derived interface supported by this object.
///
/// - returns: `String` - The Slice type ID of the most-derived interface supported by this object
open override func ice_id() -> Swift.String {
return MXSessionMetricsTraits.staticId
}

/// Returns the Slice type ID of the interface supported by this object.
///
/// - returns: `String` - The Slice type ID of the interface supported by this object.
open override class func ice_staticId() -> Swift.String {
return MXSessionMetricsTraits.staticId
}

open override func _iceReadImpl(from istr: Ice.InputStream) throws {
_ = try istr.startSlice()
self.forwardedClient = try istr.read()
self.forwardedServer = try istr.read()
self.routingTableSize = try istr.read()
self.queuedClient = try istr.read()
self.queuedServer = try istr.read()
self.overriddenClient = try istr.read()
self.overriddenServer = try istr.read()
try istr.endSlice()
try super._iceReadImpl(from: istr);
}

open override func _iceWriteImpl(to ostr: Ice.OutputStream) {
ostr.startSlice(typeId: MXSessionMetricsTraits.staticId, compactId: -1, last: false)
ostr.write(self.forwardedClient)
ostr.write(self.forwardedServer)
ostr.write(self.routingTableSize)
ostr.write(self.queuedClient)
ostr.write(self.queuedServer)
ostr.write(self.overriddenClient)
ostr.write(self.overriddenServer)
ostr.endSlice()
super._iceWriteImpl(to: ostr);
}
}
Loading

0 comments on commit 973dc70

Please sign in to comment.