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

import NitroModules

/**
 * Wraps a Swift `(_ reactTag: Double, _ item: NativeListItem, _ index: Double) -> Bool` as a class.
 * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
 */
public final class Func_bool_double_NativeListItem_double {
  public typealias bridge = margelo.nitro.reactnativelist.bridge.swift

  private let closure: (_ reactTag: Double, _ item: NativeListItem, _ index: Double) -> Bool

  public init(_ closure: @escaping (_ reactTag: Double, _ item: NativeListItem, _ index: Double) -> Bool) {
    self.closure = closure
  }

  @inline(__always)
  public func call(reactTag: Double, item: NativeListItem, index: Double) -> Bool {
    let __result: Bool = self.closure(reactTag, item, index)
    return __result
  }

  /**
   * Casts this instance to a retained unsafe raw pointer.
   * This acquires one additional strong reference on the object!
   */
  @inline(__always)
  public func toUnsafe() -> UnsafeMutableRawPointer {
    return Unmanaged.passRetained(self).toOpaque()
  }

  /**
   * Casts an unsafe pointer to a `Func_bool_double_NativeListItem_double`.
   * The pointer has to be a retained opaque `Unmanaged<Func_bool_double_NativeListItem_double>`.
   * This removes one strong reference from the object!
   */
  @inline(__always)
  public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_bool_double_NativeListItem_double {
    return Unmanaged<Func_bool_double_NativeListItem_double>.fromOpaque(pointer).takeRetainedValue()
  }
}
