本文整理汇总了Java中org.bridj.Pointer.allocatePointer方法的典型用法代码示例。如果您正苦于以下问题:Java Pointer.allocatePointer方法的具体用法?Java Pointer.allocatePointer怎么用?Java Pointer.allocatePointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bridj.Pointer
的用法示例。
在下文中一共展示了Pointer.allocatePointer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Clingo create(int messageLimit, final ClingoLogger logger, String... parameters) throws ClingoException {
Pointer<ClingoLibrary.clingo_logger_t> p_logger = null;
if (logger != null) {
clingo_logger_t log = new clingo_logger_t() {
public void apply(int code, Pointer<Byte> message, Pointer<?> data) {
try {
logger.warn(EnumValue.valueOfInt(WarningCode.class, code), message.getCString());
} catch (Exception e) {
// ignore
}
}
};
p_logger = Pointer.getPointer(log);
}
// create a control object and pass command line arguments
Pointer<Pointer<clingo_control>> control = Pointer.allocatePointer(clingo_control.class);
handleError(LIB.clingo_control_new(null, 0, p_logger, null, messageLimit, control), "Could not create clingo controller");
return new Clingo(control.get());
}
示例2: getModel
import org.bridj.Pointer; //导入方法依赖的package包/类
public Model getModel() throws ClingoException {
Pointer<Pointer<ClingoLibrary.clingo_model>> model = Pointer.allocatePointer(ClingoLibrary.clingo_model.class);
handleError(LIB.clingo_solve_handle_model(pointer, model), "Error solve handle model");
if (model.get() != null) {
return new Model(model.get());
}
return null;
}
示例3: getStatistics
import org.bridj.Pointer; //导入方法依赖的package包/类
public Statistics getStatistics() throws ClingoException {
Pointer<Pointer<clingo_statistic>> statistics = Pointer.allocatePointer(clingo_statistic.class);
handleError(LIB.clingo_control_statistics(pointer, statistics), "Error reading the statistics!");
Pointer<Long> key = Pointer.allocateLong();
handleError(LIB.clingo_statistics_root(statistics.get(), key), "Error reading the statistics root key!");
return new Statistics(statistics.get(), key.getLong());
}
示例4: getConfiguration
import org.bridj.Pointer; //导入方法依赖的package包/类
public Configuration getConfiguration() throws ClingoException {
Pointer<Pointer<clingo_configuration>> config = Pointer.allocatePointer(clingo_configuration.class);
handleError(LIB.clingo_control_configuration(pointer, config), "Error reading the configuration!");
Pointer<Integer> key = Pointer.allocateInt();
handleError(LIB.clingo_configuration_root(config.get(), key), "Error reading the configuration root key!");
return new Configuration(config.get(), key.getInt());
}
示例5: 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());
}
示例6: 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());
}
示例7: getDescription
import org.bridj.Pointer; //导入方法依赖的package包/类
public String getDescription() throws ClingoException {
Pointer<Pointer<Byte>> description = Pointer.allocatePointer(Byte.class);
handleError(LIB.clingo_configuration_description(pointer, key, description), "Error reading the configuration description!");
return description.get().getCString();
}
示例8: getSymbolicAtoms
import org.bridj.Pointer; //导入方法依赖的package包/类
public SymbolicAtoms getSymbolicAtoms() throws ClingoException {
Pointer<Pointer<clingo_symbolic_atoms>> ret = Pointer.allocatePointer(clingo_symbolic_atoms.class);
handleError(LIB.clingo_solve_control_symbolic_atoms(pointer, ret), "Error readint the solve control symbolic atoms!");
return new SymbolicAtoms(ret.get());
}
示例9: getName
import org.bridj.Pointer; //导入方法依赖的package包/类
public String getName() throws ClingoException {
Pointer<Pointer<Byte>> ret = Pointer.allocatePointer(Byte.class);
handleError(LIB.clingo_theory_atoms_term_name(pointer, id, ret), "Error reading the theory term name!");
return ret.get().getCString();
}
示例10: getKey
import org.bridj.Pointer; //导入方法依赖的package包/类
public String getKey(int index) {
Pointer<Pointer<Byte>> name = Pointer.allocatePointer(Byte.class);
handleRuntimeError(LIB.clingo_configuration_map_subkey_name(pointer, key, index, name), "Error reading the configuration key name!");
return name.get().getCString();
}
示例11: 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());
}
示例12: 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());
}
示例13: getSymbolicAtoms
import org.bridj.Pointer; //导入方法依赖的package包/类
public SymbolicAtoms getSymbolicAtoms() throws ClingoException {
Pointer<Pointer<clingo_symbolic_atoms>> ret = Pointer.allocatePointer(clingo_symbolic_atoms.class);
handleError(LIB.clingo_propagate_init_symbolic_atoms(pointer, ret), "Error reading the progagete init symbolic atoms!");
return new SymbolicAtoms(ret.get());
}
示例14: getTheoryAtoms
import org.bridj.Pointer; //导入方法依赖的package包/类
public TheoryAtoms getTheoryAtoms() throws ClingoException {
Pointer<Pointer<clingo_theory_atoms>> ret = Pointer.allocatePointer(clingo_theory_atoms.class);
handleError(LIB.clingo_propagate_init_theory_atoms(pointer, ret), "Error reading the progagete init theory atoms!");
return new TheoryAtoms(ret.get());
}
示例15: getName
import org.bridj.Pointer; //导入方法依赖的package包/类
public String getName() throws ClingoException {
Pointer<Pointer<Byte>> name = Pointer.allocatePointer(Byte.class);
handleError(LIB.clingo_symbol_name(structObject, name), "Error reading the symbol name!");
return name.getCString();
}