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


Java Pointer.allocatePointer方法代码示例

本文整理汇总了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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:21,代码来源:Clingo.java

示例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;
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:9,代码来源:SolveHandle.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:Clingo.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:Clingo.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryElement.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryElement.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Configuration.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:SolveControl.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:TheoryTerm.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:ConfigurationMap.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:TheoryAtom.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:Symbol.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:PropagateInit.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:PropagateInit.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Symbol.java


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