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

#pragma once

#include "HybridBarcodeSpec.hpp"

// Forward declaration of `HybridBarcodeSpec_cxx` to properly resolve imports.
namespace VisionCameraBarcodeScanner { class HybridBarcodeSpec_cxx; }

// Forward declaration of `BarcodeFormat` to properly resolve imports.
namespace margelo::nitro::camera::barcodescanner { enum class BarcodeFormat; }
// Forward declaration of `Rect` to properly resolve imports.
namespace margelo::nitro::camera::barcodescanner { struct Rect; }
// Forward declaration of `Point` to properly resolve imports.
namespace margelo::nitro::camera::barcodescanner { struct Point; }
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
namespace NitroModules { class ArrayBufferHolder; }
// Forward declaration of `BarcodeValueType` to properly resolve imports.
namespace margelo::nitro::camera::barcodescanner { enum class BarcodeValueType; }

#include "BarcodeFormat.hpp"
#include "Rect.hpp"
#include "Point.hpp"
#include <vector>
#include <string>
#include <optional>
#include <NitroModules/ArrayBuffer.hpp>
#include <NitroModules/ArrayBufferHolder.hpp>
#include "BarcodeValueType.hpp"

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

namespace margelo::nitro::camera::barcodescanner {

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

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

  public:
    // Properties
    inline BarcodeFormat getFormat() noexcept override {
      auto __result = _swiftPart.getFormat();
      return static_cast<BarcodeFormat>(__result);
    }
    inline Rect getBoundingBox() noexcept override {
      return _swiftPart.getBoundingBox();
    }
    inline std::vector<Point> getCornerPoints() noexcept override {
      auto __result = _swiftPart.getCornerPoints();
      return __result;
    }
    inline std::optional<std::string> getDisplayValue() noexcept override {
      auto __result = _swiftPart.getDisplayValue();
      return __result;
    }
    inline std::optional<std::shared_ptr<ArrayBuffer>> getRawBytes() noexcept override {
      auto __result = _swiftPart.getRawBytes();
      return __result;
    }
    inline std::optional<std::string> getRawValue() noexcept override {
      auto __result = _swiftPart.getRawValue();
      return __result;
    }
    inline BarcodeValueType getValueType() noexcept override {
      auto __result = _swiftPart.getValueType();
      return static_cast<BarcodeValueType>(__result);
    }

  public:
    // Methods
    

  private:
    VisionCameraBarcodeScanner::HybridBarcodeSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::camera::barcodescanner
