当前位置: 首页>>代码示例>>Java>>正文


Java IntByReference.getValue方法代码示例

本文整理汇总了Java中com.sun.jna.ptr.IntByReference.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java IntByReference.getValue方法的具体用法?Java IntByReference.getValue怎么用?Java IntByReference.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jna.ptr.IntByReference的用法示例。


在下文中一共展示了IntByReference.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isProcessActive

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * @see NativeCalls#isProcessActive(int)
 */
@Override
public boolean isProcessActive(final int processId) {
  try {
    final Pointer procHandle =
        Kernel32.OpenProcess(Kernel32.PROCESS_QUERY_INFORMATION, false, processId);
    final long hval;
    if (procHandle == null
        || (hval = Pointer.nativeValue(procHandle)) == Kernel32.INVALID_HANDLE || hval == 0) {
      return false;
    } else {
      final IntByReference status = new IntByReference();
      final boolean result = Kernel32.GetExitCodeProcess(procHandle, status) && status != null
          && status.getValue() == Kernel32.STILL_ACTIVE;
      Kernel32.CloseHandle(procHandle);
      return result;
    }
  } catch (LastErrorException le) {
    // some problem in getting process status
    return false;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:25,代码来源:NativeCallsJNAImpl.java

示例2: getStartDate

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Note: this method throws an exception if there is no data available for the given dataSetNumber. So it is needed to check if there is data before calling this method.
 */
public int[] getStartDate(int wdmFileNumber, int dataSetNumber) {
    int[] startDate = new int[6];
    int[] endDate = new int[6];
    Arrays.fill(startDate, 0);
    Arrays.fill(endDate, 0);

    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdatim_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            startDate, endDate, new IntByReference(), new IntByReference(), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdatim_ , returnCode = " + returnCode.getValue());
    }

    return startDate;
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:19,代码来源:WdmDll.java

示例3: getEndDate

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Note: this method throws an exception if there is no data available for the given dataSetNumber. So it is needed to check if there is data before calling this method.
 */
public int[] getEndDate(int wdmFileNumber, int dataSetNumber) {
    int[] startDate = new int[6];
    int[] endDate = new int[6];
    Arrays.fill(startDate, 0);
    Arrays.fill(endDate, 0);

    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdatim_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            startDate, endDate, new IntByReference(), new IntByReference(), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdatim_ , returnCode = " + returnCode.getValue());
    }

    return endDate;
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:19,代码来源:WdmDll.java

示例4: getValues

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
public double[] getValues(int wdmFileNumber, int dataSetNumber, int timeStep, int[] startDate,
        int numberOfValues, int transformationCode, int allowedQualityCode, int timeUnit) {

    float[] retrievedValues = new float[numberOfValues];
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdtget_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            new IntByReference(timeStep), startDate, new IntByReference(numberOfValues),
            new IntByReference(transformationCode), new IntByReference(allowedQualityCode),
            new IntByReference(timeUnit), retrievedValues, returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdtget_ , returnCode = " + returnCode.getValue());
    }

    //convert float values to doubles.
    return BBUtils.toDoubleArray(retrievedValues);
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:17,代码来源:WdmDll.java

示例5: sdaiGetAttr

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Returns the data value of the specified attribute in the actual instance.
 * The actual instance is specified by a numeric instanceID that uniquely
 * identifies an instance.
 * 
 * @param instance
 *            A numeric instanceID that uniquely identifies an instance.
 * @param attribute
 *            A numeric attributerID that uniquely identifies an attribute
 *            definition instance.
 * @param valueType
 *            Type of output value.
 * @return Output value of the specific element in the aggregation.
 */
public Object sdaiGetAttr(Pointer instance, int attribute, SdaiTypes valueType) {
	Object returnValue = null;

	switch (valueType) {
	case REAL:
		DoubleByReference dVal = new DoubleByReference();
		engine.sdaiGetAggrByIterator(instance, valueType.ordinal(), dVal);
		returnValue = new Double(dVal.getValue());
		break;
	case INTEGER:
	case BOOLEAN:
	case LOGICAL:
		IntByReference iVal = new IntByReference();
		engine.sdaiGetAggrByIterator(instance, valueType.ordinal(), iVal);
		returnValue = new Integer(iVal.getValue());
		break;
	case STRING:
		PointerByReference sVal = new PointerByReference();
		engine.sdaiGetAggrByIterator(instance, valueType.ordinal(), sVal);
		returnValue = (String) sVal.getValue().getString(0);
		break;
	default:
		PointerByReference ptr = new PointerByReference();
		engine.sdaiGetAggrByIterator(instance, valueType.ordinal(), ptr);
		returnValue = ptr.getValue();
		break;
	}
	return returnValue;
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:44,代码来源:IfcEngine.java

示例6: initializeModelling

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
public SurfaceProperties initializeModelling(Pointer model, double scale) {
	IntByReference pV = new IntByReference();
	IntByReference pI = new IntByReference();
	engine.initializeModelling(model, pV, pI, scale);
	int noVertices = pV.getValue();
	int noIndices = pI.getValue();
	return new SurfaceProperties(model, noVertices, noIndices, scale);
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:9,代码来源:IfcEngine.java

示例7: getConceptualFaceEx

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
public ConceptualFaceProperties getConceptualFaceEx(Pointer instance, int index) {
	IntByReference p_startIndexTriangles = new IntByReference();
	IntByReference p_noIndicesTriangles = new IntByReference();
	IntByReference p_startIndexLines = new IntByReference();
	IntByReference p_noIndicesLines = new IntByReference();
	IntByReference p_startIndexPoints = new IntByReference();
	IntByReference p_noIndicesPoints = new IntByReference();
	IntByReference p_startIndexFacesPolygons = new IntByReference();
	IntByReference p_noIndicesFacesPolygons = new IntByReference();
	IntByReference p_startIndexConceptualFacePolygons = new IntByReference();
	IntByReference p_noIndicesConceptualFacePolygons = new IntByReference();
	engine.getConceptualFaceEx(instance, index, p_startIndexTriangles, p_noIndicesTriangles, p_startIndexLines,
			p_noIndicesLines, p_startIndexPoints, p_noIndicesPoints, p_startIndexFacesPolygons, p_noIndicesFacesPolygons,
			p_startIndexConceptualFacePolygons, p_noIndicesConceptualFacePolygons);
	int startIndexTriangles = p_startIndexTriangles.getValue();
	int noIndicesTriangles = p_noIndicesTriangles.getValue();
	int startIndexLines = p_startIndexLines.getValue();
	int noIndicesLines = p_noIndicesLines.getValue();
	int startIndexPoints = p_startIndexPoints.getValue();
	int noIndicesPoints = p_noIndicesPoints.getValue();
	int startIndexFacesPolygons = p_startIndexFacesPolygons.getValue();
	int noIndicesFacesPolygons = p_noIndicesFacesPolygons.getValue();
	int startIndexConceptualFacePolygons = p_startIndexConceptualFacePolygons.getValue();
	int noIndicesConceptualFacePolygons = p_noIndicesConceptualFacePolygons.getValue();
	return new ConceptualFaceProperties(startIndexTriangles, noIndicesTriangles, startIndexLines, noIndicesLines,
			startIndexPoints, noIndicesPoints, startIndexFacesPolygons, noIndicesFacesPolygons, startIndexConceptualFacePolygons,
			noIndicesConceptualFacePolygons);
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:29,代码来源:IfcEngine.java

示例8: openWdmFile

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Opens the given wdm file at the given fortran unit number.
 *
 * @param wdmFileNumber
 * @param wdmFilePath
 * @param readOnlyFlag
 */
public void openWdmFile(int wdmFileNumber, String wdmFilePath, int readOnlyFlag) {
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdbopn_(new IntByReference(wdmFileNumber), wdmFilePath,
            new IntByReference(readOnlyFlag), returnCode, wdmFilePath.length());
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdbopn_ , returnCode = " + returnCode.getValue());
    }
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:16,代码来源:WdmDll.java

示例9: removeWdmFileFromBuffer

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Removes the WDM file at the given fortran unit number
 * from the open WDM buffer and adjust buffer accordingly.
 * For this to work a valid WDM message file must be open.
 *
 * @param wdmFileNumber
 */
public void removeWdmFileFromBuffer(int wdmFileNumber) {
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdflcl_(new IntByReference(wdmFileNumber), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdflcl_ , returnCode = " + returnCode.getValue());
    }
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:15,代码来源:WdmDll.java

示例10: getTimeStep

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Note: this method throws an exception if there is no data available for the given dataSetNumber. So it is needed to check if there is data before calling this method.
 */
public int getTimeStep(int wdmFileNumber, int dataSetNumber) {
    IntByReference timeStep = new IntByReference();
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdatim_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            new int[6], new int[6], timeStep, new IntByReference(), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdatim_ , returnCode = " + returnCode.getValue());
    }
    return timeStep.getValue();
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:14,代码来源:WdmDll.java

示例11: getTimeUnit

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Note: this method throws an exception if there is no data available for the given dataSetNumber. So it is needed to check if there is data before calling this method.
 */
public int getTimeUnit(int wdmFileNumber, int dataSetNumber) {
    IntByReference timeUnit = new IntByReference();
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdatim_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            new int[6], new int[6], new IntByReference(), timeUnit, returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdatim_ , returnCode = " + returnCode.getValue());
    }
    return timeUnit.getValue();
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:14,代码来源:WdmDll.java

示例12: deleteValues

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
public void deleteValues(int wdmFileNumber, int dataSetNumber, int[] deleteFromDate, int deleteAll) {
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wtddel_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            deleteFromDate, new IntByReference(deleteAll), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wtddel_ , returnCode = " + returnCode.getValue());
    }
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:9,代码来源:WdmDll.java

示例13: putValues

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
public void putValues(int wdmFileNumber, int dataSetNumber, int timeStep, int[] startDate,
        int overwriteData, int qualityCode, int timeUnit, double[] values) {

    IntByReference numberOfValues = new IntByReference(values.length);
    IntByReference returnCode = new IntByReference(-1);
    nativeDLL.wdtput_(new IntByReference(wdmFileNumber), new IntByReference(dataSetNumber),
            new IntByReference(timeStep), startDate, numberOfValues,
            new IntByReference(overwriteData), new IntByReference(qualityCode),
            new IntByReference(timeUnit), BBUtils.toFloatArray(values), returnCode);
    if (returnCode.getValue() != 0) {
        throw new RuntimeException("WdmDll: Invalid result from call to subroutine dll.wdtput_ , returnCode = " + returnCode.getValue());
    }
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:14,代码来源:WdmDll.java

示例14: getConsoleMode

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
private static int getConsoleMode (Pointer handle) throws IOException {
IntByReference mode = new IntByReference();
int rc = kernel32.GetConsoleMode(handle, mode);
if (rc == 0) {
   throw new IOException("GetConsoleMode() failed."); }
return mode.getValue(); }
 
开发者ID:ofrank123,项目名称:TheIntellectualOctocats,代码行数:7,代码来源:RawConsoleInput.java

示例15: engiGetInstanceMetaInfo

import com.sun.jna.ptr.IntByReference; //导入方法依赖的package包/类
/**
 * Returns 'meta' information from a specific instance.
 * 
 * @param instance
 *            A numeric instanceID that uniquely identifies an instance.
 * @param className
 *            as used in the SPFF file.
 * @param classNameUC
 *            UPPER CASE version of the class name (as used in the schema).
 * @return
 */
public int engiGetInstanceMetaInfo(Pointer instance, String className, String classNameUC) {
	IntByReference localIdRef = new IntByReference();
	PointerByReference classNameRef = new PointerByReference();
	PointerByReference classNameUCRef = new PointerByReference();
	engine.engiGetInstanceMetaInfo(instance, localIdRef, classNameRef, classNameUCRef);
	className = classNameRef.getValue().getString(0);
	classNameUC = classNameUCRef.getValue().getString(0);
	return localIdRef.getValue();
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:21,代码来源:IfcEngine.java


注:本文中的com.sun.jna.ptr.IntByReference.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。