當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。