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

#pragma once

#include "HybridFaceScannerSpec.hpp"

// Forward declaration of `HybridFaceScannerSpec_cxx` to properly resolve imports.
namespace VisionCameraFaceDetection { class HybridFaceScannerSpec_cxx; }

// Forward declaration of `HybridFaceSpec` to properly resolve imports.
namespace margelo::nitro::visioncamerafacedetection { class HybridFaceSpec; }
// Forward declaration of `HybridFrameSpec` to properly resolve imports.
namespace margelo::nitro::camera { class HybridFrameSpec; }

#include <memory>
#include "HybridFaceSpec.hpp"
#include <vector>
#include <VisionCamera/HybridFrameSpec.hpp>

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

namespace margelo::nitro::visioncamerafacedetection {

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

  public:
    // Get the Swift part
    inline VisionCameraFaceDetection::HybridFaceScannerSpec_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<HybridFaceScannerSpecSwift>(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::vector<std::shared_ptr<HybridFaceSpec>> scanFaces(const std::shared_ptr<margelo::nitro::camera::HybridFrameSpec>& frame) override {
      auto __result = _swiftPart.scanFaces(frame);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    VisionCameraFaceDetection::HybridFaceScannerSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::visioncamerafacedetection
