public static PointerParameterStrategy pointerParameterStrategy(IRubyObject parameter) { PointerParameterStrategy strategy = lookupPointerParameterStrategy(parameter); if (strategy != null) { return strategy; } else if (parameter.respondsTo("to_ptr")) { IRubyObject ptr = parameter.callMethod(parameter.getRuntime().getCurrentContext(), "to_ptr"); return new DelegatingPointerParameterStrategy(ptr, pointerParameterStrategy(ptr)); } else { throw parameter.getRuntime().newTypeError("cannot convert parameter to native pointer"); } }
public static PointerParameterStrategy pointerParameterStrategy(IRubyObject parameter) { PointerParameterStrategy strategy = lookupPointerParameterStrategy(parameter); if (strategy != null) { return strategy; } else if (parameter.respondsTo("to_ptr")) { IRubyObject ptr = parameter.callMethod(parameter.getRuntime().getCurrentContext(), "to_ptr"); return new DelegatingPointerParameterStrategy(ptr, pointerParameterStrategy(ptr)); } else { throw parameter.getRuntime().newTypeError("cannot convert parameter to native pointer"); } }
public static PointerParameterStrategy pointerParameterStrategy(IRubyObject parameter) { PointerParameterStrategy strategy = lookupPointerParameterStrategy(parameter); if (strategy != null) { return strategy; } else if (parameter.respondsTo("to_ptr")) { IRubyObject ptr = parameter.callMethod(parameter.getRuntime().getCurrentContext(), "to_ptr"); return new DelegatingPointerParameterStrategy(ptr, pointerParameterStrategy(ptr)); } else { throw parameter.getRuntime().newTypeError("cannot convert parameter to native pointer"); } }
public static PointerParameterStrategy pointerParameterStrategy(IRubyObject parameter) { PointerParameterStrategy strategy = lookupPointerParameterStrategy(parameter); if (strategy != null) { return strategy; } else if (parameter.respondsTo("to_ptr")) { IRubyObject ptr = parameter.callMethod(parameter.getRuntime().getCurrentContext(), "to_ptr"); return new DelegatingPointerParameterStrategy(ptr, pointerParameterStrategy(ptr)); } else { throw parameter.getRuntime().newTypeError("cannot convert parameter to native pointer"); } }