///
/// NitroOrientation-Swift-Cxx-Bridge.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#include "NitroOrientation-Swift-Cxx-Bridge.hpp"

// Include C++ implementation defined types
#include "HybridNitroOrientationSpecSwift.hpp"
#include "NitroOrientation-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::orientation::bridge::swift {

  // pragma MARK: std::function<void(const std::string& /* orientation */)>
  Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroOrientation::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::string& orientation) mutable -> void {
      swiftClosure.call(orientation);
    };
  }
  
  // pragma MARK: std::shared_ptr<HybridNitroOrientationSpec>
  std::shared_ptr<HybridNitroOrientationSpec> create_std__shared_ptr_HybridNitroOrientationSpec_(void* _Nonnull swiftUnsafePointer) noexcept {
    NitroOrientation::HybridNitroOrientationSpec_cxx swiftPart = NitroOrientation::HybridNitroOrientationSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::orientation::HybridNitroOrientationSpecSwift>(swiftPart);
  }
  void* _Nonnull get_std__shared_ptr_HybridNitroOrientationSpec_(std__shared_ptr_HybridNitroOrientationSpec_ cppType) noexcept {
    std::shared_ptr<margelo::nitro::orientation::HybridNitroOrientationSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::orientation::HybridNitroOrientationSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridNitroOrientationSpec\" is not implemented in Swift!");
    }
    #endif
    NitroOrientation::HybridNitroOrientationSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }

} // namespace margelo::nitro::orientation::bridge::swift
