Top Description Methods
jnr.ffi

public Interface Variable<T>

Known Direct Implementers
jnr.ffi.provider.jffi.ReflectionVariableAccessorGenerator.AbstractVariable, jnr.ffi.provider.jffi.ReflectionVariableAccessorGenerator.ConvertingVariable

Access library global variables.

To access global variables, declare a method with a parameterized return type of this class.

Example

    public interface MyLib {
        public Variable<Long> my_int_var();
    }

    MyLib lib = LibraryLoader.create(MyLib.class).load("mylib"):
    System.out.println("native value=" + lib.my_int_var().get())

    lib.my_int_var().set(0xdeadbeef);
    

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

The value of the variable
get
()

Gets the current value of the global variable

public void
set(T
The value to set the global variable to.
value
)

Sets the global variable to a value

Method Detail

getback to summary
public T get()

Gets the current value of the global variable

Returns:T

The value of the variable

setback to summary
public void set(T value)

Sets the global variable to a value

Parameters
value:T

The value to set the global variable to.