-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHybridViewModelBooleanPropertySpecSwift.hpp
More file actions
88 lines (74 loc) · 3.02 KB
/
HybridViewModelBooleanPropertySpecSwift.hpp
File metadata and controls
88 lines (74 loc) · 3.02 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
///
/// HybridViewModelBooleanPropertySpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///
#pragma once
#include "HybridViewModelBooleanPropertySpec.hpp"
// Forward declaration of `HybridViewModelBooleanPropertySpec_cxx` to properly resolve imports.
namespace react_native_rive { class HybridViewModelBooleanPropertySpec_cxx; }
// Forward declaration of `HybridViewModelPropertySpecSwift` to properly resolve imports.
namespace margelo::nitro::rive { class HybridViewModelPropertySpecSwift; }
#include <functional>
#include "HybridViewModelPropertySpecSwift.hpp"
#include "react_native_rive-Swift-Cxx-Umbrella.hpp"
namespace margelo::nitro::rive {
/**
* The C++ part of HybridViewModelBooleanPropertySpec_cxx.swift.
*
* HybridViewModelBooleanPropertySpecSwift (C++) accesses HybridViewModelBooleanPropertySpec_cxx (Swift), and might
* contain some additional bridging code for C++ <> Swift interop.
*
* Since this obviously introduces an overhead, I hope at some point in
* the future, HybridViewModelBooleanPropertySpec_cxx can directly inherit from the C++ class HybridViewModelBooleanPropertySpec
* to simplify the whole structure and memory management.
*/
class HybridViewModelBooleanPropertySpecSwift: public virtual HybridViewModelBooleanPropertySpec, public virtual HybridViewModelPropertySpecSwift {
public:
// Constructor from a Swift instance
explicit HybridViewModelBooleanPropertySpecSwift(const react_native_rive::HybridViewModelBooleanPropertySpec_cxx& swiftPart):
HybridObject(HybridViewModelBooleanPropertySpec::TAG),
HybridViewModelPropertySpecSwift(swiftPart),
_swiftPart(swiftPart) { }
public:
// Get the Swift part
inline react_native_rive::HybridViewModelBooleanPropertySpec_cxx& getSwiftPart() noexcept {
return _swiftPart;
}
public:
inline size_t getExternalMemorySize() noexcept override {
return _swiftPart.getMemorySize();
}
void dispose() noexcept override {
_swiftPart.dispose();
}
std::string toString() override {
return _swiftPart.toString();
}
public:
// Properties
inline bool getValue() noexcept override {
return _swiftPart.getValue();
}
inline void setValue(bool value) noexcept override {
_swiftPart.setValue(std::forward<decltype(value)>(value));
}
public:
// Methods
inline void addListener(const std::function<void(bool /* value */)>& onChanged) override {
auto __result = _swiftPart.addListener(onChanged);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void removeListeners() override {
auto __result = _swiftPart.removeListeners();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
private:
react_native_rive::HybridViewModelBooleanPropertySpec_cxx _swiftPart;
};
} // namespace margelo::nitro::rive