summaryrefslogtreecommitdiff
path: root/swift/src/IceObjc/LocalObject.h
blob: 73d97cbb5c3c414f2749ed4f75fe299cd9578700 (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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#import "Config.h"

NS_ASSUME_NONNULL_BEGIN

@interface ICELocalObject : NSObject
//
// We hold a weak referece to the (possile) Swift object which has a handle to
// this ICELocalObject. That way we can recover the Swift object later.
//
@property (weak, atomic, nullable) id swiftRef;
-(instancetype) init ICE_SWIFT_UNAVAILABLE("");
@end

#ifdef __cplusplus

@interface ICELocalObject ()
@property (nonatomic, readonly) std::shared_ptr<void> cppObject;
+(nullable instancetype) getHandle:(std::shared_ptr<void>)cppObject NS_RETURNS_RETAINED;
@end

#endif

NS_ASSUME_NONNULL_END