Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxBridge/NSDataBigString.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#import <Foundation/Foundation.h>

#ifdef __cplusplus

#include <cxxreact/JSBigString.h>

namespace facebook::react {
Expand Down Expand Up @@ -38,3 +40,5 @@ class NSDataBigString : public JSBigString {
};

} // namespace facebook::react

#endif // __cplusplus
10 changes: 8 additions & 2 deletions packages/react-native/React/CxxBridge/RCTCxxBridgeDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@
* LICENSE file in the root directory of this source tree.
*/

#include <memory>
#ifdef __cplusplus

#import <React/RCTBridgeDelegate.h>
#include <memory>

namespace facebook::react {

class JSExecutorFactory;

} // namespace facebook::react

#endif // __cplusplus

#import <React/RCTBridgeDelegate.h>

// This is a separate class so non-C++ implementations don't need to
// take a C++ dependency.

@protocol RCTCxxBridgeDelegate <RCTBridgeDelegate>

#ifdef __cplusplus
/**
* In the RCTCxxBridge, if this method is implemented, return a
* ExecutorFactory instance which can be used to create the executor.
* If not implemented, or returns an empty pointer, JSIExecutorFactory
* will be used with a JSCRuntime.
*/
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge;
#endif // __cplusplus

@end
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#pragma once
#ifdef __cplusplus

#include <jsireact/JSIExecutor.h>

Expand All @@ -19,3 +20,5 @@ JSIExecutor::RuntimeInstaller RCTJSIExecutorRuntimeInstaller(
JSIExecutor::RuntimeInstaller runtimeInstallerToWrap);

} // namespace facebook::react

#endif // __cplusplus
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxBridge/RCTMessageThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef __cplusplus

#import <memory>
#import <string>

Expand Down Expand Up @@ -37,3 +39,5 @@ class RCTMessageThread : public MessageQueueThread,
};

} // namespace facebook::react

#endif // __cplusplus
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxBridge/RCTObjcExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef __cplusplus

#include <functional>
#include <memory>

Expand All @@ -29,3 +31,5 @@ class RCTObjcExecutorFactory : public JSExecutorFactory {
};

} // namespace facebook::react

#endif // __cplusplus
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef __cplusplus

#include <glog/logging.h>

#include <React/RCTLog.h>
Expand Down Expand Up @@ -43,3 +45,5 @@ class DispatchMessageQueueThread : public MessageQueueThread {
};

} // namespace facebook::react

#endif // __cplusplus
5 changes: 5 additions & 0 deletions packages/react-native/React/CxxModule/RCTCxxMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
#import <Foundation/Foundation.h>

#import <React/RCTBridgeMethod.h>

#ifdef __cplusplus
#import <cxxreact/CxxModule.h>
#endif // __cplusplus

@interface RCTCxxMethod : NSObject <RCTBridgeMethod>

#ifdef __cplusplus
- (instancetype)initWithCxxMethod:(const facebook::xplat::module::CxxModule::Method &)cxxMethod;
#endif // __cplusplus

@end
10 changes: 8 additions & 2 deletions packages/react-native/React/CxxModule/RCTCxxModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
* LICENSE file in the root directory of this source tree.
*/

#import <memory>

#import <Foundation/Foundation.h>

#import <React/RCTBridgeModule.h>

#ifdef __cplusplus

#import <memory>

namespace facebook::xplat::module {
class CxxModule;
} // namespace facebook::react::module

#endif // __cplusplus

/**
* Subclass RCTCxxModule to use cross-platform CxxModule on iOS.
*
Expand All @@ -23,7 +27,9 @@ class CxxModule;
*/
@interface RCTCxxModule : NSObject <RCTBridgeModule>

#ifdef __cplusplus
// To be implemented by subclasses
- (std::unique_ptr<facebook::xplat::module::CxxModule>)createModule;
#endif // __cplusplus

@end
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxModule/RCTCxxUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef __cplusplus

#include <functional>
#include <memory>

Expand All @@ -25,3 +27,5 @@ NSError *tryAndReturnError(const std::function<void()> &func);
NSString *deriveSourceURL(NSURL *url);

} // namespace facebook::react

#endif // __cplusplus
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxModule/RCTNativeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef __cplusplus

#import <React/RCTModuleData.h>
#import <cxxreact/NativeModule.h>

Expand All @@ -30,3 +32,5 @@ class RCTNativeModule : public NativeModule {
};

} // namespace facebook::react

#endif // __cplusplus
4 changes: 4 additions & 0 deletions packages/react-native/React/CxxUtils/RCTFollyConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#import <Foundation/Foundation.h>

#ifdef __cplusplus

#include <folly/dynamic.h>

namespace facebook::react {
Expand All @@ -15,3 +17,5 @@ folly::dynamic convertIdToFollyDynamic(id json);
id convertFollyDynamicToId(const folly::dynamic &dyn);

} // namespace facebook::react

#endif // __cplusplus