Files
haptika/packages/react-native-haptika-ppg/nitrogen/generated/shared/c++/NativeSignalQualityResult.hpp
T
2026-07-31 16:20:10 +02:00

130 lines
8.7 KiB
C++
Generated

///
/// NativeSignalQualityResult.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#pragma once
#if __has_include(<NitroModules/JSIConverter.hpp>)
#include <NitroModules/JSIConverter.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/NitroDefines.hpp>)
#include <NitroModules/NitroDefines.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/JSIHelpers.hpp>)
#include <NitroModules/JSIHelpers.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
#include <NitroModules/PropNameIDCache.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#include <string>
#include <optional>
#include <vector>
namespace margelo::nitro::haptika::ppg {
/**
* A struct which can be represented as a JavaScript object (NativeSignalQualityResult).
*/
struct NativeSignalQualityResult final {
public:
double score SWIFT_PRIVATE;
std::string level SWIFT_PRIVATE;
double usableDurationSeconds SWIFT_PRIVATE;
double droppedFrameRatio SWIFT_PRIVATE;
double saturationRatio SWIFT_PRIVATE;
double rejectedIntervalRatio SWIFT_PRIVATE;
std::optional<double> signalToNoiseRatio SWIFT_PRIVATE;
double motionArtifactRatio SWIFT_PRIVATE;
double methodAgreementScore SWIFT_PRIVATE;
double timestampJitterRatio SWIFT_PRIVATE;
double longestGapSeconds SWIFT_PRIVATE;
std::vector<std::string> issues SWIFT_PRIVATE;
public:
NativeSignalQualityResult() = default;
explicit NativeSignalQualityResult(double score, std::string level, double usableDurationSeconds, double droppedFrameRatio, double saturationRatio, double rejectedIntervalRatio, std::optional<double> signalToNoiseRatio, double motionArtifactRatio, double methodAgreementScore, double timestampJitterRatio, double longestGapSeconds, std::vector<std::string> issues): score(score), level(level), usableDurationSeconds(usableDurationSeconds), droppedFrameRatio(droppedFrameRatio), saturationRatio(saturationRatio), rejectedIntervalRatio(rejectedIntervalRatio), signalToNoiseRatio(signalToNoiseRatio), motionArtifactRatio(motionArtifactRatio), methodAgreementScore(methodAgreementScore), timestampJitterRatio(timestampJitterRatio), longestGapSeconds(longestGapSeconds), issues(issues) {}
public:
friend bool operator==(const NativeSignalQualityResult& lhs, const NativeSignalQualityResult& rhs) = default;
};
} // namespace margelo::nitro::haptika::ppg
namespace margelo::nitro {
// C++ NativeSignalQualityResult <> JS NativeSignalQualityResult (object)
template <>
struct JSIConverter<margelo::nitro::haptika::ppg::NativeSignalQualityResult> final {
static inline margelo::nitro::haptika::ppg::NativeSignalQualityResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
jsi::Object obj = arg.asObject(runtime);
return margelo::nitro::haptika::ppg::NativeSignalQualityResult(
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "score"))),
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio"))),
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio"))),
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds"))),
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "issues")))
);
}
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::haptika::ppg::NativeSignalQualityResult& arg) {
jsi::Object obj(runtime);
obj.setProperty(runtime, PropNameIDCache::get(runtime, "score"), JSIConverter<double>::toJSI(runtime, arg.score));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "level"), JSIConverter<std::string>::toJSI(runtime, arg.level));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds"), JSIConverter<double>::toJSI(runtime, arg.usableDurationSeconds));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio"), JSIConverter<double>::toJSI(runtime, arg.droppedFrameRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio"), JSIConverter<double>::toJSI(runtime, arg.saturationRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio"), JSIConverter<double>::toJSI(runtime, arg.rejectedIntervalRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.signalToNoiseRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio"), JSIConverter<double>::toJSI(runtime, arg.motionArtifactRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore"), JSIConverter<double>::toJSI(runtime, arg.methodAgreementScore));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio"), JSIConverter<double>::toJSI(runtime, arg.timestampJitterRatio));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds"), JSIConverter<double>::toJSI(runtime, arg.longestGapSeconds));
obj.setProperty(runtime, PropNameIDCache::get(runtime, "issues"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.issues));
return obj;
}
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
if (!value.isObject()) {
return false;
}
jsi::Object obj = value.getObject(runtime);
if (!nitro::isPlainObject(runtime, obj)) {
return false;
}
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "score")))) return false;
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio")))) return false;
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio")))) return false;
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds")))) return false;
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "issues")))) return false;
return true;
}
};
} // namespace margelo::nitro