All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.ext.ffi.jffi.DirectPointerParameterStrategy Maven / Gradle / Ivy

There is a newer version: 0.8.14
Show newest version
package org.jruby.ext.ffi.jffi;

import org.jruby.ext.ffi.AbstractMemory;
import org.jruby.ext.ffi.DirectMemoryIO;

/**
 *
 */
public final class DirectPointerParameterStrategy extends PointerParameterStrategy {
    DirectPointerParameterStrategy() {
        super(true);
    }

    @Override
    public final long address(Object parameter) {
//        System.out.printf("direct pointer strategy returning address=%x\n", ((DirectMemoryIO) ((AbstractMemory) parameter).getMemoryIO()).getAddress());
        return ((DirectMemoryIO) ((AbstractMemory) parameter).getMemoryIO()).getAddress();
    }

    @Override
    public Object object(Object parameter) {
        throw new RuntimeException("no array");
    }

    @Override
    public int offset(Object parameter) {
        throw new RuntimeException("no array");
    }

    @Override
    public int length(Object parameter) {
        throw new RuntimeException("no array");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy