summaryrefslogtreecommitdiff
path: root/swift/src/Ice/NativePropertiesAdmin.swift
blob: 66f9fb3f0cc9d660387578b81bb4a42272f84ded (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

/// Closure called when the communicator's properties have been updated.
///
/// - parameter: `PropertyDict` A dictionary containing the properties that were added,
///   changed or removed, with a removed property denoted by an entry whose value is an
///   empty string.
public typealias PropertiesAdminUpdateCallback = (PropertyDict) -> Void

/// Closure used to remove the properties update callback.
public typealias PropertiesAdminRemoveCallback = () -> Void

/// Base protocol for the Properties admin facet.
public protocol NativePropertiesAdmin {
    /// Register an update callback that will be invoked when property updates occur.
    ///
    /// - parameter cb: `PropertiesAdminUpdateCallback` - The callback.
    ///
    /// - returns: A closure that can be invoked to remove the callback.
    func addUpdateCallback(_ cb: @escaping PropertiesAdminUpdateCallback) -> PropertiesAdminRemoveCallback
}