summaryrefslogtreecommitdiff
path: root/swift/test/Ice/proxy/TestI.swift
blob: d3a489c8eebfd059444c70f111084cc704e796ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
import Ice

final class MyDerivedClassI: ObjectI<MyDerivedClassTraits>, MyDerivedClass {
    var _ctx: [String: String]

    override init() {
        _ctx = [String: String]()
    }

    func echo(obj: Ice.ObjectPrx?, current _: Ice.Current) throws -> Ice.ObjectPrx? {
        return obj
    }

    func shutdown(current: Ice.Current) throws {
        guard let adapter = current.adapter else {
            fatalError()
        }
        adapter.getCommunicator().shutdown()
    }

    func getContext(current _: Ice.Current) throws -> [String: String] {
        return _ctx
    }

    override func ice_isA(id: String, current: Ice.Current) throws -> Bool {
        _ctx = current.ctx
        return try super.ice_isA(id: id, current: current)
    }

    override func ice_id(current: Ice.Current) throws -> String {
        _ctx = current.ctx
        return try super.ice_id(current: current)
    }

    override func ice_ids(current: Ice.Current) throws -> [String] {
        _ctx = current.ctx
        return try super.ice_ids(current: current)
    }

    override func ice_ping(current: Current) {
        _ctx = current.ctx
    }
}