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

#pragma once

#include "HybridFaceDetectorFactorySpec.hpp"

// Forward declaration of `HybridFaceDetectorFactorySpec_cxx` to properly resolve imports.
namespace VisionCameraFaceDetector { class HybridFaceDetectorFactorySpec_cxx; }

// Forward declaration of `HybridFaceDetectorSpec` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { class HybridFaceDetectorSpec; }
// Forward declaration of `FaceDetectorOptions` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct FaceDetectorOptions; }
// Forward declaration of `CameraPosition` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class CameraPosition; }
// Forward declaration of `PerformanceMode` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class PerformanceMode; }
// Forward declaration of `HybridCameraOutputSpec` to properly resolve imports.
namespace margelo::nitro::camera { class HybridCameraOutputSpec; }
// Forward declaration of `FaceDetectorOutputOptions` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct FaceDetectorOutputOptions; }
// Forward declaration of `FaceDetectorOutputResolution` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class FaceDetectorOutputResolution; }
// Forward declaration of `HybridFaceSpec` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { class HybridFaceSpec; }

#include <memory>
#include "HybridFaceDetectorSpec.hpp"
#include "FaceDetectorOptions.hpp"
#include "CameraPosition.hpp"
#include <optional>
#include "PerformanceMode.hpp"
#include <VisionCamera/HybridCameraOutputSpec.hpp>
#include "FaceDetectorOutputOptions.hpp"
#include "FaceDetectorOutputResolution.hpp"
#include "HybridFaceSpec.hpp"
#include <vector>
#include <functional>
#include <exception>

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

namespace margelo::nitro::camera::facedetector {

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

  public:
    // Get the Swift part
    inline VisionCameraFaceDetector::HybridFaceDetectorFactorySpec_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<HybridFaceDetectorFactorySpecSwift>(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<HybridFaceDetectorSpec> createFaceDetector(const FaceDetectorOptions& options) override {
      auto __result = _swiftPart.createFaceDetector(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<margelo::nitro::camera::HybridCameraOutputSpec> createFaceDetectorOutput(const FaceDetectorOutputOptions& options) override {
      auto __result = _swiftPart.createFaceDetectorOutput(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    VisionCameraFaceDetector::HybridFaceDetectorFactorySpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::camera::facedetector
