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


Java Pointer.allocateSizeT方法代码示例

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


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

示例1: getSymbols

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<Symbol> getSymbols(ShowType type) throws ClingoException {
    List<Symbol> result = null;

    // determine the number of (shown) symbols in the model    
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleError(LIB.clingo_model_symbols_size(pointer, type.getInt(), size), "Error reading size of symbols of the model");

    if (0 < size.getLong()) {
        // allocate required memory to hold all the symbols
        Pointer<Long> atoms = Pointer.allocateLongs(size.getLong());

        // retrieve the symbols in the model
        handleError(LIB.clingo_model_symbols(pointer, type.getInt(), atoms, size.getLong()), "Error read the model symbols");

        result = Symbol.list(atoms, size.getLong());
    }
    return result;
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:19,代码来源:Model.java

示例2: toString

import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public String toString() {
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleRuntimeError(LIB.clingo_theory_atoms_element_to_string_size(pointer, id, size), "Error reading to string size!");
    Pointer<Byte> string = Pointer.allocateByte();
    handleRuntimeError(LIB.clingo_theory_atoms_element_to_string(pointer, id, string, size.getLong()), "Error reading the theory element string");
    return string.getCString();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:9,代码来源:TheoryElement.java

示例3: getValue

import org.bridj.Pointer; //导入方法依赖的package包/类
public String getValue() throws ClingoException {
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleError(LIB.clingo_configuration_value_get_size(pointer, key, size), "Error reading the configuration value size!");
    Pointer<Byte> value = Pointer.allocateBytes(size.getInt());
    handleError(LIB.clingo_configuration_value_get(pointer, key, value, size.getInt()), "Error reading the configuration value!");
    return value.getCString();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:Configuration.java

示例4: getSignatures

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<Signature> getSignatures() throws ClingoException {
    Pointer<SizeT> n = Pointer.allocateSizeT();
    handleError(LIB.clingo_symbolic_atoms_signatures_size(pointer, n), "Error reading the symbolic atoms signatures size!");
    Pointer<Long> signatures = Pointer.allocateLongs(n.getLong());
    handleError(LIB.clingo_symbolic_atoms_signatures(pointer, signatures, n.getLong()), "Error reading the symbolic atoms signatures!");
    return Signature.list(signatures, n.getLong());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:SymbolicAtoms.java

示例5: getCost

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<Long> getCost() throws ClingoException {
    Pointer<SizeT> n = Pointer.allocateSizeT();
    handleError(LIB.clingo_model_cost_size(pointer, n), "Error reading model cost size!");
    Pointer<Long> ret = Pointer.allocateLongs(n.getLong());
    handleError(LIB.clingo_model_cost(pointer, ret, n.getLong()), "Error reading the model cost!");
    return ret.asList();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:Model.java

示例6: toString

import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public String toString() {
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleRuntimeError(LIB.clingo_theory_atoms_atom_to_string_size(pointer, id, size), "Error reading to string size!");
    Pointer<Byte> string = Pointer.allocateByte();
    handleRuntimeError(LIB.clingo_theory_atoms_atom_to_string(pointer, id, string, size.getLong()), "Error reading theory atom string");
    return string.getCString();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:9,代码来源:TheoryAtom.java

示例7: toString

import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public String toString() {
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleRuntimeError(LIB.clingo_theory_atoms_term_to_string_size(pointer, id, size), "Error reading to string size!");
    Pointer<Byte> string = Pointer.allocateByte();
    handleRuntimeError(LIB.clingo_theory_atoms_term_to_string(pointer, id, string, size.getLong()), "Error reading the theory term string");
    return string.getCString();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:9,代码来源:TheoryTerm.java

示例8: toString

import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public String toString() {
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleRuntimeError(LIB.clingo_symbol_to_string_size(structObject, size), "Error reading the symbol string size!");
    Pointer<Byte> string = Pointer.allocateBytes(size.getLong());
    handleRuntimeError(LIB.clingo_symbol_to_string(structObject, string, size.getLong()), "Error reading the symbol string value!");
    return string.getCString();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:9,代码来源:Symbol.java

示例9: getTuple

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<TheoryTerm> getTuple() throws ClingoException {
    Pointer<Pointer<Integer>> ret = Pointer.allocatePointer(Integer.class);
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleError(LIB.clingo_theory_atoms_element_tuple(pointer, id, ret, size), "Error reading theory element tuple!");
    return TheoryTerm.list(pointer, ret.get(), size.getInt());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryElement.java

示例10: getCondition

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<Integer> getCondition() throws ClingoException {
    Pointer<Pointer<Integer>> ret = Pointer.allocatePointer(Integer.class);
    Pointer<SizeT> size = Pointer.allocateSizeT();
    handleError(LIB.clingo_theory_atoms_element_condition(pointer, id, ret, size), "Error reading the theory elements condition!");
    return Pointer.allocateList(ret.get().getIO(), size.getInt());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryElement.java

示例11: size

import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public int size() {
    Pointer<SizeT> ret = Pointer.allocateSizeT();
    handleRuntimeError(LIB.clingo_theory_atoms_size(pointer, ret), "Error reading the theory atoms size!");
    return ret.getInt();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryAtoms.java

示例12: size

import org.bridj.Pointer; //导入方法依赖的package包/类
public int size() throws ClingoException {
    Pointer<SizeT> ret = Pointer.allocateSizeT();
    handleError(LIB.clingo_symbolic_atoms_size(pointer, ret), "Error reading the symbolic atoms size!");
    return ret.getInt();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:SymbolicAtoms.java

示例13: getElements

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<TheoryElement> getElements() throws ClingoException {
    Pointer<Pointer<Integer>> ret = Pointer.allocatePointer(Integer.class);
    Pointer<SizeT> n = Pointer.allocateSizeT();
    handleError(LIB.clingo_theory_atoms_atom_elements(pointer, id, ret, n), "Error reading the theory atom elements!");
    return TheoryElement.list(pointer, ret.get(), n.getInt());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryAtom.java

示例14: getArguments

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<TheoryTerm> getArguments() throws ClingoException {
    Pointer<Pointer<Integer>> ret = Pointer.allocatePointer(Integer.class);
    Pointer<SizeT> n = Pointer.allocateSizeT();
    handleError(LIB.clingo_theory_atoms_term_arguments(pointer, id, ret, n), "Error reading the theory teram arguments!");
    return list(pointer, ret.get(), id);
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryTerm.java

示例15: getArguments

import org.bridj.Pointer; //导入方法依赖的package包/类
public List<Symbol> getArguments() throws ClingoException {
    Pointer<Pointer<Long>> args = Pointer.allocatePointer(Long.class);
    Pointer<SizeT> args_size = Pointer.allocateSizeT();
    handleError(LIB.clingo_symbol_arguments(structObject, args, args_size), "Error reading the symbol arguments!");
    return Symbol.list(args.get(), args_size.getInt());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:Symbol.java


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