-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathclustererOnLoad.cpp
More file actions
49 lines (36 loc) · 1.37 KB
/
Copy pathclustererOnLoad.cpp
File metadata and controls
49 lines (36 loc) · 1.37 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
///
/// clustererOnLoad.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#ifndef BUILDING_CLUSTERER_WITH_GENERATED_CMAKE_PROJECT
#error clustererOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
#endif
#include "clustererOnLoad.hpp"
#include <jni.h>
#include <fbjni/fbjni.h>
#include <NitroModules/HybridObjectRegistry.hpp>
#include "HybridClusterer.hpp"
namespace margelo::nitro::clusterer {
int initialize(JavaVM* vm) {
return facebook::jni::initialize(vm, []() {
::margelo::nitro::clusterer::registerAllNatives();
});
}
void registerAllNatives() {
using namespace margelo::nitro;
using namespace margelo::nitro::clusterer;
// Register native JNI methods
// Register Nitro Hybrid Objects
HybridObjectRegistry::registerHybridObjectConstructor(
"Clusterer",
[]() -> std::shared_ptr<HybridObject> {
static_assert(std::is_default_constructible_v<HybridClusterer>,
"The HybridObject \"HybridClusterer\" is not default-constructible! "
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
return std::make_shared<HybridClusterer>();
}
);
}
} // namespace margelo::nitro::clusterer