mirror of
https://github.com/openharmony/communication_communication_cangjie_wrapper.git
synced 2026-07-01 21:54:01 -04:00
86e9a6e795
Signed-off-by: kirby <zhangruiming4@huawei.com>
48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
/*
|
|
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
// The Cangjie API is in Beta. For details on its capabilities and limitations, please refer to the README file.
|
|
|
|
package ohos.rpc
|
|
|
|
import ohos.ffi.{RemoteDataLite, releaseFFIData}
|
|
|
|
class RemoteObjectLite <: RemoteDataLite {
|
|
protected init(id: Int64) {
|
|
super(id)
|
|
}
|
|
|
|
~init() {
|
|
releaseFFIData(myDataId)
|
|
}
|
|
}
|
|
|
|
protected open class RemoteObject <: IRemoteObject {
|
|
private var lite: ?RemoteObjectLite = None
|
|
private let impl_: RemoteObjectImpl = RemoteObjectImpl()
|
|
|
|
protected init(id: Int64) {
|
|
lite = RemoteObjectLite(id)
|
|
}
|
|
|
|
protected init(_: String) {}
|
|
|
|
protected func getID(): Int64 {
|
|
return lite?.getID() ?? 0
|
|
}
|
|
}
|
|
|
|
class RemoteObjectImpl {}
|