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

#pragma once

#include "HybridNativeLinearListLayoutSpec.hpp"

// Forward declaration of `HybridNativeLinearListLayoutSpec_cxx` to properly resolve imports.
namespace ReactNativeList { class HybridNativeLinearListLayoutSpec_cxx; }

// Forward declaration of `NativeLinearListLayoutConfig` to properly resolve imports.
namespace margelo::nitro::reactnativelist { struct NativeLinearListLayoutConfig; }
// Forward declaration of `NativeLinearListLayoutIOSConfig` to properly resolve imports.
namespace margelo::nitro::reactnativelist { struct NativeLinearListLayoutIOSConfig; }
// Forward declaration of `NativeItemSizeEstimate` to properly resolve imports.
namespace margelo::nitro::reactnativelist { struct NativeItemSizeEstimate; }
// Forward declaration of `HybridNativeListLayoutSpecSwift` to properly resolve imports.
namespace margelo::nitro::reactnativelist { class HybridNativeListLayoutSpecSwift; }

#include "NativeLinearListLayoutConfig.hpp"
#include "NativeLinearListLayoutIOSConfig.hpp"
#include <optional>
#include "NativeItemSizeEstimate.hpp"
#include "HybridNativeListLayoutSpecSwift.hpp"

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

namespace margelo::nitro::reactnativelist {

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

  public:
    // Get the Swift part
    inline ReactNativeList::HybridNativeLinearListLayoutSpec_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<HybridNativeLinearListLayoutSpecSwift>(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 void setConfig(const NativeLinearListLayoutConfig& config) override {
      auto __result = _swiftPart.setConfig(std::forward<decltype(config)>(config));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    ReactNativeList::HybridNativeLinearListLayoutSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::reactnativelist
