com.sun.jna.Native.invokeStructure()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中com.sun.jna.Native.invokeStructure()方法的一些代码示例,展示了Native.invokeStructure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.invokeStructure()方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:invokeStructure

Native.invokeStructure介绍

[英]Call the native function, returning a struct by value.
[中]调用本机函数,按值返回结构。

代码示例

代码示例来源:origin: net.java.dev.jna/jna

/**
 * Call the native function, returning a struct by value.
 * 
 * @param function  Present to prevent the GC to collect the Function object
 *                  prematurely
 * @param fp        function pointer
 * @param callFlags calling convention to be used
 * @param args      Arguments to pass to the native function
 * 
 * @return the passed-in Structure
 */
static Structure invokeStructure(Function function, long fp, int callFlags, Object[] args,
                 Structure s) {
  invokeStructure(function, fp, callFlags, args, s.getPointer().peer,
          s.getTypeInfo().peer);
  return s;
}

代码示例来源:origin: net.java.dev.jna/jna

if (Structure.ByValue.class.isAssignableFrom(returnType)) {
  Structure s =
    Native.invokeStructure(this, this.peer, callFlags, args,
                Structure.newInstance((Class<? extends Structure>)returnType));
  s.autoRead();

代码示例来源:origin: org.elasticsearch/jna

/**
 * Call the native function, returning a struct by value.
 * 
 * @param function  Present to prevent the GC to collect the Function object
 *                  prematurely
 * @param fp        function pointer
 * @param callFlags calling convention to be used
 * @param args      Arguments to pass to the native function
 * 
 * @return the passed-in Structure
 */
static Structure invokeStructure(Function function, long fp, int callFlags, Object[] args,
                 Structure s) {
  invokeStructure(function, fp, callFlags, args, s.getPointer().peer,
          s.getTypeInfo().peer);
  return s;
}

代码示例来源:origin: org.elasticsearch/jna

if (Structure.ByValue.class.isAssignableFrom(returnType)) {
  Structure s =
    Native.invokeStructure(this, this.peer, callFlags, args,
                Structure.newInstance(returnType));
  s.autoRead();

相关文章

Native类方法