示例#1
0
文件: Tag.cpp 项目: G-Node/nix
bool Tag::hasReference(const DataArray &reference) const {
    if (!util::checkEntityInput(reference, false)) {
        return false;
    }
    DataArray da = backend()->getReference(reference.name());
    return da && da.id() == reference.id();
}
示例#2
0
文件: Feature.cpp 项目: G-Node/nix
void Feature::data(const DataArray &data) {
    util::checkEntityInput(data);
    if (!data.isValidEntity()) {
        throw UninitializedEntity();
    }
    backend()->data(data.id());
}
示例#3
0
void MultiTag::extents(const DataArray &extents) {
    if (extents == none) {
        backend()->extents(none);
    }
    else {
        backend()->extents(extents.id());
    }
}
示例#4
0
文件: Feature.cpp 项目: asobolev/nix
void Feature::data(const DataArray &data) {
    if (data == none) {
        throw std::runtime_error("Empty data entity (DataArray) given");
    }
    else {
        backend()->data(data.id());
    }
}
示例#5
0
FeatureHDF5::FeatureHDF5(const shared_ptr<IFile> &file, const shared_ptr<IBlock> &block, const Group &group,
                         const string &id, DataArray data, LinkType link_type, time_t time)
    : EntityHDF5(file, group, id, time), block(block)
{
    linkType(link_type);
    // TODO: the line below currently throws an exception if the DataArray
    // is not in block - to consider if we prefer copying it to the block
    this->data(data.id());
}
示例#6
0
文件: FeatureFS.cpp 项目: G-Node/nix
FeatureFS::FeatureFS(const std::shared_ptr<base::IFile> &file, const std::shared_ptr<base::IBlock> &block, const std::string &loc,
                     const std::string &id, DataArray data, LinkType link_type, time_t time)
    : EntityFS(file, (bfs::path(loc) / bfs::path(id)).string(), id, time), block(block)
{
    linkType(link_type);
    // TODO: the line below currently throws an exception if the DataArray
    // is not in block - to consider if we prefer copying it to the block
    this->data(data.id());
}
示例#7
0
文件: Tag.cpp 项目: asobolev/nix
Feature Tag::createFeature(const DataArray &data, LinkType link_type) {
    if (data == none) {
        throw std::runtime_error("Tag::createFeature: Empty DataArray entity given!");
    }
    return backend()->createFeature(data.id(), link_type);
}
示例#8
0
文件: Tag.cpp 项目: asobolev/nix
bool Tag::removeReference(const DataArray &reference) {
    if (reference == none) {
        throw std::runtime_error("Tag::removeReference: Empty DataArray entity given!");
    }
    return backend()->removeReference(reference.id());
}
示例#9
0
文件: Tag.cpp 项目: asobolev/nix
void Tag::addReference(const DataArray &reference) {
    if (reference == none) {
        throw std::runtime_error("Tag::addReference: Empty DataArray entity given!");
    }
    backend()->addReference(reference.id());
}
示例#10
0
文件: Tag.cpp 项目: G-Node/nix
Feature Tag::createFeature(const DataArray &data, LinkType link_type) {
    if (!util::checkEntityInput(data)) {
        throw UninitializedEntity();
    }
    return backend()->createFeature(data.id(), link_type);
}
示例#11
0
bool MultiTag::removeReference(const DataArray &reference) {
    util::checkEntityInput(reference);
    return backend()->removeReference(reference.id());
}
示例#12
0
void MultiTag::addReference(const DataArray &reference) {
    util::checkEntityInput(reference);
    backend()->addReference(reference.id());
}
示例#13
0
bool MultiTag::hasReference(const DataArray &reference) const {
    util::checkEntityInput(reference);
    return backend()->hasReference(reference.id());
}
示例#14
0
void MultiTag::positions(const DataArray &positions) {
    util::checkEntityInput(positions);
    backend()->positions(positions.id());
}
示例#15
0
文件: Group.cpp 项目: Prabhnith/nix
bool Group::removeDataArray(const DataArray &data_array) {
    if (!util::checkEntityInput(data_array, false)) {
        return false;
    }
    return backend()->removeDataArray(data_array.id());
}
示例#16
0
文件: Group.cpp 项目: Prabhnith/nix
void Group::addDataArray(const DataArray &data_array) {
    if (!util::checkEntityInput(data_array)) {
        throw UninitializedEntity();
    }
    backend()->addDataArray(data_array.id());
}