///
/// HybridPluginManagerSpecSwift.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 "HybridPluginManagerSpec.hpp"

// Forward declaration of `HybridPluginManagerSpec_cxx` to properly resolve imports.
namespace ReactNativeVideoDrm { class HybridPluginManagerSpec_cxx; }





#include "ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::videodrm {

  /**
   * The C++ part of HybridPluginManagerSpec_cxx.swift.
   *
   * HybridPluginManagerSpecSwift (C++) accesses HybridPluginManagerSpec_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, HybridPluginManagerSpec_cxx can directly inherit from the C++ class HybridPluginManagerSpec
   * to simplify the whole structure and memory management.
   */
  class HybridPluginManagerSpecSwift: public virtual HybridPluginManagerSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridPluginManagerSpecSwift(const ReactNativeVideoDrm::HybridPluginManagerSpec_cxx& swiftPart):
      HybridObject(HybridPluginManagerSpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline ReactNativeVideoDrm::HybridPluginManagerSpec_cxx& getSwiftPart() noexcept {
      return _swiftPart;
    }

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }

  public:
    // Properties
    inline bool getIsEnabled() noexcept override {
      return _swiftPart.isEnabled();
    }

  public:
    // Methods
    inline void enable() override {
      auto __result = _swiftPart.enable();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void disable() override {
      auto __result = _swiftPart.disable();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    ReactNativeVideoDrm::HybridPluginManagerSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::videodrm
