14
14
* limitations under the License.
15
15
*/
16
16
17
+ #ifndef FIRESTORE_CORE_SRC_API_FIRCALLBACKWRAPPER_H_
18
+ #define FIRESTORE_CORE_SRC_API_FIRCALLBACKWRAPPER_H_
19
+
17
20
#import < Foundation/Foundation.h>
18
21
19
22
#if defined(__cplusplus)
@@ -26,40 +29,43 @@ namespace api {
26
29
class Firestore;
27
30
class PipelineResult;
28
31
} // namespace api
29
-
30
32
namespace core {
31
33
template <typename T>
32
34
class EventListener;
33
35
} // namespace core
34
-
35
36
} // namespace firestore
36
37
} // namespace firebase
37
-
38
38
namespace api = firebase::firestore::api;
39
39
namespace core = firebase::firestore::core;
40
40
41
41
NS_ASSUME_NONNULL_BEGIN
42
42
43
43
typedef api::PipelineResult CppPipelineResult;
44
44
45
- typedef void (^PipelineBlock)(CppPipelineResult *_Nullable result, NSError *_Nullable error)
45
+ typedef void (^PipelineBlock)(CppPipelineResult* _Nullable result,
46
+ NSError * _Nullable error)
46
47
NS_SWIFT_UNAVAILABLE(" Use Swift's closure syntax instead." );
47
48
48
49
NS_SWIFT_SENDABLE
49
50
NS_SWIFT_NAME (CallbackWrapper)
50
51
@interface FIRCallbackWrapper : NSObject
51
52
52
- // Note: Marking callbacks in callback-based APIs as `Sendable` can help prevent crashes when they
53
- // are invoked on a different thread than the one they were originally defined in. If this callback
54
- // is expected to be called on a different thread, it should be marked as `Sendable` to ensure
55
- // thread safety.
53
+ // Note: Marking callbacks in callback-based APIs as `Sendable` can help prevent
54
+ // crashes when they are invoked on a different thread than the one they were
55
+ // originally defined in. If this callback is expected to be called on a
56
+ // different thread, it should be marked as `Sendable` to ensure thread safety.
56
57
+ (std::shared_ptr<core::EventListener<api::PipelineResult>>)
58
+ // NOLINTNEXTLINE(whitespace/parens)
57
59
wrapPipelineCallback:(std::shared_ptr<api::Firestore>)firestore
58
- completion:(void (^NS_SWIFT_SENDABLE)(CppPipelineResult *_Nullable result,
59
- NSError *_Nullable error))completion
60
+ // NOLINTNEXTLINE(whitespace/parens)
61
+ completion:(void (^NS_SWIFT_SENDABLE)(
62
+ CppPipelineResult* _Nullable result,
63
+ NSError * _Nullable error))completion
60
64
NS_SWIFT_NAME(wrapPipelineCallback(firestore:completion:));
61
65
62
66
@end
63
67
64
68
NS_ASSUME_NONNULL_END
65
- #endif
69
+ #endif // defined(__cplusplus)
70
+
71
+ #endif // FIRESTORE_CORE_SRC_API_FIRCALLBACKWRAPPER_H_
0 commit comments