mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-08-16 02:56:22 +00:00
88 lines
2.9 KiB
C++
Generated
88 lines
2.9 KiB
C++
Generated
///
|
|
/// HybridVideoPlayerFactorySpecSwift.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#include "HybridVideoPlayerFactorySpec.hpp"
|
|
|
|
// Forward declaration of `HybridVideoPlayerFactorySpec_cxx` to properly resolve imports.
|
|
namespace ReactNativeVideo { class HybridVideoPlayerFactorySpec_cxx; }
|
|
|
|
// Forward declaration of `HybridVideoPlayerSpec` to properly resolve imports.
|
|
namespace margelo::nitro::video { class HybridVideoPlayerSpec; }
|
|
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
|
|
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
|
|
|
|
#include <memory>
|
|
#include "HybridVideoPlayerSpec.hpp"
|
|
#include "HybridVideoPlayerSourceSpec.hpp"
|
|
|
|
#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
|
|
|
namespace margelo::nitro::video {
|
|
|
|
/**
|
|
* The C++ part of HybridVideoPlayerFactorySpec_cxx.swift.
|
|
*
|
|
* HybridVideoPlayerFactorySpecSwift (C++) accesses HybridVideoPlayerFactorySpec_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, HybridVideoPlayerFactorySpec_cxx can directly inherit from the C++ class HybridVideoPlayerFactorySpec
|
|
* to simplify the whole structure and memory management.
|
|
*/
|
|
class HybridVideoPlayerFactorySpecSwift: public virtual HybridVideoPlayerFactorySpec {
|
|
public:
|
|
// Constructor from a Swift instance
|
|
explicit HybridVideoPlayerFactorySpecSwift(const ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx& swiftPart):
|
|
HybridObject(HybridVideoPlayerFactorySpec::TAG),
|
|
_swiftPart(swiftPart) { }
|
|
|
|
public:
|
|
// Get the Swift part
|
|
inline ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx& getSwiftPart() noexcept {
|
|
return _swiftPart;
|
|
}
|
|
|
|
public:
|
|
inline size_t getExternalMemorySize() noexcept override {
|
|
return _swiftPart.getMemorySize();
|
|
}
|
|
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
if (auto otherCast = std::dynamic_pointer_cast<HybridVideoPlayerFactorySpecSwift>(other)) {
|
|
return _swiftPart.equals(otherCast->_swiftPart);
|
|
}
|
|
return false;
|
|
}
|
|
void dispose() noexcept override {
|
|
_swiftPart.dispose();
|
|
}
|
|
std::string toString() override {
|
|
return _swiftPart.toString();
|
|
}
|
|
|
|
public:
|
|
// Properties
|
|
|
|
|
|
public:
|
|
// Methods
|
|
inline std::shared_ptr<HybridVideoPlayerSpec> createPlayer(const std::shared_ptr<HybridVideoPlayerSourceSpec>& source) override {
|
|
auto __result = _swiftPart.createPlayer(source);
|
|
if (__result.hasError()) [[unlikely]] {
|
|
std::rethrow_exception(__result.error());
|
|
}
|
|
auto __value = std::move(__result.value());
|
|
return __value;
|
|
}
|
|
|
|
private:
|
|
ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx _swiftPart;
|
|
};
|
|
|
|
} // namespace margelo::nitro::video
|