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

#pragma once

#include "HybridScannedCodeSpec.hpp"

// Forward declaration of `HybridScannedCodeSpec_cxx` to properly resolve imports.
namespace VisionCamera { class HybridScannedCodeSpec_cxx; }

// Forward declaration of `Point` to properly resolve imports.
namespace margelo::nitro::camera { struct Point; }
// Forward declaration of `HybridScannedObjectSpecSwift` to properly resolve imports.
namespace margelo::nitro::camera { class HybridScannedObjectSpecSwift; }

#include <string>
#include <optional>
#include "Point.hpp"
#include <vector>
#include "HybridScannedObjectSpecSwift.hpp"

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

namespace margelo::nitro::camera {

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

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

  public:
    // Properties
    inline std::optional<std::string> getValue() noexcept override {
      auto __result = _swiftPart.getValue();
      return __result;
    }
    inline std::vector<Point> getCornerPoints() noexcept override {
      auto __result = _swiftPart.getCornerPoints();
      return __result;
    }

  public:
    // Methods
    

  private:
    VisionCamera::HybridScannedCodeSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::camera
