Package com.kenai.jffi

Examples of com.kenai.jffi.HeapInvocationBuffer$DefaultEncoder


    }

    @Override
    public final IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name,
            IRubyObject arg1) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                m1.marshal(invocation, buffer, arg1);
                return functionInvoker.invoke(context, function, buffer);
View Full Code Here


                    c2.intValue(context, arg2), c3.intValue(context, arg3));

            return resultConverter.fromNative(context, retval);
        } else {

            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
            m1.marshal(context, buffer, arg1);
            m2.marshal(context, buffer, arg2);
            m3.marshal(context, buffer, arg3);

            return resultConverter.fromNative(context, invoker.invokeInt(function, buffer));
View Full Code Here

        Arity.checkArgumentCount(context.getRuntime(), args,
                marshallers.length - (blockGiven ? 1 : 0), marshallers.length);
       
        Invocation invocation = new Invocation(context, 0, 0);
        try {
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);

            if (!blockGiven) {
                for (int i = 0; i < args.length; ++i) {
                    marshallers[i].marshal(invocation, buffer, args[i]);
                }
View Full Code Here

    }

    @Override
    public final IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name,
            IRubyObject arg1, IRubyObject arg2) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                m1.marshal(invocation, buffer, arg1);
                m2.marshal(invocation, buffer, arg2);
View Full Code Here

        if (c1.isConvertible(context, arg1) && c2.isConvertible(context, arg2)) {
            int retval = invoker.invokeIIrI(function, c1.intValue(context, arg1),
                    c2.intValue(context, arg2));
            return resultConverter.fromNative(context, retval);
        } else {
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
            m1.marshal(context, buffer, arg1);
            m2.marshal(context, buffer, arg2);
            return resultConverter.fromNative(context, invoker.invokeInt(function, buffer));
        }
    }
View Full Code Here

    }

    @Override
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
        arity.checkArity(context.getRuntime(), args);
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                for (int i = 0; i < args.length; ++i) {
                    marshallers[i].marshal(invocation, buffer, args[i]);
View Full Code Here

    private final IRubyObject invoke(ThreadContext context, IRubyObject arg1) {
        if (c1.isConvertible(context, arg1)) {
            int retval = invoker.invokeIrI(function, c1.intValue(context, arg1));
            return resultConverter.fromNative(context, retval);
        } else {
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
            m1.marshal(context, buffer, arg1);
            return resultConverter.fromNative(context, invoker.invokeInt(function, buffer));
        }
    }
View Full Code Here

class DefaultMethodZeroArg extends JFFIDynamicMethod {
    private final HeapInvocationBuffer dummyBuffer;

    public DefaultMethodZeroArg(RubyModule implementationClass, Function function, FunctionInvoker functionInvoker) {
        super(implementationClass, Arity.NO_ARGUMENTS, function, functionInvoker);
        dummyBuffer = new HeapInvocationBuffer(function);
    }
View Full Code Here

        }

        Invocation invocation = new Invocation(context);
        Function function = new Function(address.getAddress(), returnType, ffiParamTypes, convention);
        try {
            HeapInvocationBuffer args = new HeapInvocationBuffer(function);
            for (int i = 0; i < marshallers.length; ++i) {
                marshallers[i].marshal(invocation, args, params[i]);
            }

            return functionInvoker.invoke(context, function, args);
View Full Code Here

    }

    @Override
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name,
            IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                m1.marshal(invocation, buffer, arg1);
                m2.marshal(invocation, buffer, arg2);
View Full Code Here

TOP

Related Classes of com.kenai.jffi.HeapInvocationBuffer$DefaultEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.