Exemplo n.º 1
0
void BaseTestReadOnly::init(nix::File &file) {
    startup_time = time(NULL);
    std::vector<nix::Value> values = { nix::Value(1.0),
                                       nix::Value(2.0),
                                       nix::Value(-99.99) };
    std::vector<double> ticks = {1.0, 2.0, 3.4, 42.0};

    Section section = file.createSection("foo_section", "metadata");
    Block block = file.createBlock("block_one", "dataset");
    DataArray positions = block.createDataArray("positions_DataArray", "dataArray",
                                      DataType::Double, NDSize({ 0, 0 }));
    DataArray data_array = block.createDataArray("array_one",
                                   "testdata",
                                   nix::DataType::Double,
                                   nix::NDSize({ 0, 0, 0 }));
    Dimension dim = data_array.appendSampledDimension(3.14);
    SampledDimension dim_sampled = data_array.appendSampledDimension(3.14);
    RangeDimension dim_range = data_array.appendRangeDimension(ticks);
    SetDimension dim_set = data_array.appendSetDimension();
    Tag tag = block.createTag("featureTest", "Test", {0.0, 2.0, 3.4});
    MultiTag mtag = block.createMultiTag("tag_one", "test_tag", positions);
    Feature feature = tag.createFeature(data_array, nix::LinkType::Tagged);
    Property property = section.createProperty("doubleProperty", values);

    section_id = section.id(); feature_id = feature.id(); tag_id = tag.id();
    mtag_id = mtag.id(); property_id = property.id(); block_id = block.id();
    data_array_id = data_array.id(); dim_index = dim.index();
    dim_sampled_index = dim_sampled.index(); dim_range_index = dim_range.index();
    dim_set_index = dim_set.index();

    file.close();
}
Exemplo n.º 2
0
bool File::deleteSection(const Section &section) {
    if(!util::checkEntityInput(section, false)) {
        return false;
    }
    return deleteSection(section.id());
}
Exemplo n.º 3
0
bool File::hasSection(const Section &section) const {
    if(!util::checkEntityInput(section, false)) {
        return false;
    }
    return backend()->hasSection(section.id());
}
Exemplo n.º 4
0
bool File::deleteSection(const Section &section) {
    util::checkEntityInput(section);
    return deleteSection(section.id());
}
Exemplo n.º 5
0
bool File::hasSection(const Section &section) const {
    util::checkEntityInput(section);
    return backend()->hasSection(section.id());
}