///
/// HybridNitroChuckerSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include "HybridNitroChuckerSpec.hpp"

// Forward declaration of `HybridNitroChuckerSpec_cxx` to properly resolve imports.
namespace NitroChucker { class HybridNitroChuckerSpec_cxx; }



#include <string>
#include <vector>

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

namespace margelo::nitro::nitrochucker {

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

  public:
    // Get the Swift part
    inline NitroChucker::HybridNitroChuckerSpec_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<HybridNitroChuckerSpecSwift>(other)) {
        return _swiftPart.equals(otherCast->_swiftPart);
      }
      return false;
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

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

  public:
    // Methods
    inline void show() override {
      auto __result = _swiftPart.show();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void clearLogs() override {
      auto __result = _swiftPart.clearLogs();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void dismiss() override {
      auto __result = _swiftPart.dismiss();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void setEnabled(bool enabled) override {
      auto __result = _swiftPart.setEnabled(std::forward<decltype(enabled)>(enabled));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void setMaxLogCount(double maxCount) override {
      auto __result = _swiftPart.setMaxLogCount(std::forward<decltype(maxCount)>(maxCount));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void setIgnoredHosts(const std::vector<std::string>& hosts) override {
      auto __result = _swiftPart.setIgnoredHosts(hosts);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    NitroChucker::HybridNitroChuckerSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::nitrochucker
