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

#pragma once

// Forward declarations of C++ defined types
// Forward declaration of `HybridNitroBackgroundTimerSpec` to properly resolve imports.
namespace margelo::nitro::backgroundtimer { class HybridNitroBackgroundTimerSpec; }

// Forward declarations of Swift defined types
// Forward declaration of `HybridNitroBackgroundTimerSpec_cxx` to properly resolve imports.
namespace NitroBackgroundTimer { class HybridNitroBackgroundTimerSpec_cxx; }

// Include C++ defined types
#include "HybridNitroBackgroundTimerSpec.hpp"
#include <NitroModules/Result.hpp>
#include <exception>
#include <functional>
#include <memory>
#include <string>
#include <vector>

/**
 * Contains specialized versions of C++ templated types so they can be accessed from Swift,
 * as well as helper functions to interact with those C++ types from Swift.
 */
namespace margelo::nitro::backgroundtimer::bridge::swift {

  // pragma MARK: std::function<void(double /* id */)>
  /**
   * Specialized version of `std::function<void(double)>`.
   */
  using Func_void_double = std::function<void(double /* id */)>;
  /**
   * Wrapper class for a `std::function<void(double / * id * /)>`, this can be used from Swift.
   */
  class Func_void_double_Wrapper final {
  public:
    explicit Func_void_double_Wrapper(std::function<void(double /* id */)>&& func): _function(std::make_unique<std::function<void(double /* id */)>>(std::move(func))) {}
    inline void call(double id) const noexcept {
      _function->operator()(id);
    }
  private:
    std::unique_ptr<std::function<void(double /* id */)>> _function;
  } SWIFT_NONCOPYABLE;
  Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept;
  inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept {
    return Func_void_double_Wrapper(std::move(value));
  }
  
  // pragma MARK: std::vector<double>
  /**
   * Specialized version of `std::vector<double>`.
   */
  using std__vector_double_ = std::vector<double>;
  inline std::vector<double> create_std__vector_double_(size_t size) noexcept {
    std::vector<double> vector;
    vector.reserve(size);
    return vector;
  }
  
  // pragma MARK: std::shared_ptr<HybridNitroBackgroundTimerSpec>
  /**
   * Specialized version of `std::shared_ptr<HybridNitroBackgroundTimerSpec>`.
   */
  using std__shared_ptr_HybridNitroBackgroundTimerSpec_ = std::shared_ptr<HybridNitroBackgroundTimerSpec>;
  std::shared_ptr<HybridNitroBackgroundTimerSpec> create_std__shared_ptr_HybridNitroBackgroundTimerSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
  void* NON_NULL get_std__shared_ptr_HybridNitroBackgroundTimerSpec_(std__shared_ptr_HybridNitroBackgroundTimerSpec_ cppType);
  
  // pragma MARK: std::weak_ptr<HybridNitroBackgroundTimerSpec>
  using std__weak_ptr_HybridNitroBackgroundTimerSpec_ = std::weak_ptr<HybridNitroBackgroundTimerSpec>;
  inline std__weak_ptr_HybridNitroBackgroundTimerSpec_ weakify_std__shared_ptr_HybridNitroBackgroundTimerSpec_(const std::shared_ptr<HybridNitroBackgroundTimerSpec>& strong) noexcept { return strong; }
  
  // pragma MARK: Result<double>
  using Result_double_ = Result<double>;
  inline Result_double_ create_Result_double_(double value) noexcept {
    return Result<double>::withValue(std::move(value));
  }
  inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
    return Result<double>::withError(error);
  }
  
  // pragma MARK: Result<void>
  using Result_void_ = Result<void>;
  inline Result_void_ create_Result_void_() noexcept {
    return Result<void>::withValue();
  }
  inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
    return Result<void>::withError(error);
  }
  
  // pragma MARK: Result<std::vector<double>>
  using Result_std__vector_double__ = Result<std::vector<double>>;
  inline Result_std__vector_double__ create_Result_std__vector_double__(const std::vector<double>& value) noexcept {
    return Result<std::vector<double>>::withValue(value);
  }
  inline Result_std__vector_double__ create_Result_std__vector_double__(const std::exception_ptr& error) noexcept {
    return Result<std::vector<double>>::withError(error);
  }
  
  // pragma MARK: Result<std::string>
  using Result_std__string_ = Result<std::string>;
  inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept {
    return Result<std::string>::withValue(value);
  }
  inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept {
    return Result<std::string>::withError(error);
  }

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