Skip to content

Commit

Permalink
Replace string_view with string when returning column name, add curre…
Browse files Browse the repository at this point in the history
…nt domain checks, replace vector with span when selecting points
  • Loading branch information
XanthosXanthopoulos committed Dec 6, 2024
1 parent afcc0f0 commit 804c87e
Show file tree
Hide file tree
Showing 9 changed files with 631 additions and 86 deletions.
47 changes: 38 additions & 9 deletions libtiledbsoma/src/soma/soma_attribute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,72 @@ void SOMAAttribute::_set_dim_points(
const SOMAContext&,
const std::any&) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_set_dim_points] Column with name {} is not an index "
"column",
name()));
}

void SOMAAttribute::_set_dim_ranges(
const std::unique_ptr<ManagedQuery>&,
const SOMAContext&,
const std::any&) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_set_dim_ranges] Column with name {} is not an index "
"column",
name()));
}

void SOMAAttribute::_set_current_domain_slot(
NDRectangle&, const std::vector<const void*>&) const {
NDRectangle&, std::span<const std::any>) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_set_current_domain_slot] Column with name {} is not "
"an index column",
name()));
}

std::pair<bool, std::string> SOMAAttribute::_can_set_current_domain_slot(
std::optional<NDRectangle>&, std::span<const std::any>) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute][_set_current_domain_slot] Column with name {} is not "
"an index column",
name()));
};

std::any SOMAAttribute::_core_domain_slot() const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_core_domain_slot] Column with name {} is not an "
"index column",
name()));
}

std::any SOMAAttribute::_non_empty_domain_slot(Array&) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_non_empty_domain_slot] Column with name {} is not an "
"index column",
name()));
}

std::any SOMAAttribute::_core_current_domain_slot(
const SOMAContext&, Array&) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][_core_current_domain_slot] Column with name {} is not "
"an index column",
name()));
}

std::any SOMAAttribute::_core_current_domain_slot(NDRectangle&) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute][_core_current_domain_slot] Column with name {} is not "
"an index column",
name()));
}

ArrowArray* SOMAAttribute::arrow_domain_slot(
const SOMAContext&, Array&, enum Domainish) const {
throw TileDBSOMAError(std::format(
"[SOMAAttribute] Column with name {} is not an index column", name()));
"[SOMAAttribute][arrow_domain_slot] Column with name {} is not an "
"index column",
name()));
}

ArrowSchema* SOMAAttribute::arrow_schema_slot(
Expand All @@ -63,4 +92,4 @@ ArrowSchema* SOMAAttribute::arrow_schema_slot(
attribute, *ctx.tiledb_ctx(), array)
.release();
}
} // namespace tiledbsoma
} // namespace tiledbsoma
11 changes: 9 additions & 2 deletions libtiledbsoma/src/soma/soma_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SOMAAttribute : public virtual SOMAColumn {
, enumeration(enumeration) {
}

virtual inline std::string_view name() const override {
virtual inline std::string name() const override {
return attribute.name();
}

Expand Down Expand Up @@ -95,7 +95,11 @@ class SOMAAttribute : public virtual SOMAColumn {

virtual void _set_current_domain_slot(
NDRectangle& rectangle,
const std::vector<const void*>& domain) const override;
std::span<const std::any> domain) const override;

virtual std::pair<bool, std::string> _can_set_current_domain_slot(
std::optional<NDRectangle>& rectangle,
std::span<const std::any> new_domain) const override;

virtual std::any _core_domain_slot() const override;

Expand All @@ -104,6 +108,9 @@ class SOMAAttribute : public virtual SOMAColumn {
virtual std::any _core_current_domain_slot(
const SOMAContext& ctx, Array& array) const override;

virtual std::any _core_current_domain_slot(
NDRectangle& ndrect) const override;

Attribute attribute;
std::optional<Enumeration> enumeration;
};
Expand Down
2 changes: 1 addition & 1 deletion libtiledbsoma/src/soma/soma_column.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ SOMAColumn::core_current_domain_slot<std::string>(
throw TileDBSOMAError(e.what());
}
}
} // namespace tiledbsoma
} // namespace tiledbsoma
Loading

0 comments on commit 804c87e

Please sign in to comment.