Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Client: Small changes to support interop #5688

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ namespace deephaven::client::update_by {
* This enum is meant to be a parallel of the Java enum java.math.MathContext.
* See https://docs.oracle.com/javase/8/docs/api/java/math/MathContext.html
*/
enum class MathContext {
enum class MathContext : int32_t {
kUnlimited, kDecimal32, kDecimal64, kDecimal128
};

enum class BadDataBehavior {
enum class BadDataBehavior : int32_t {
kReset, kSkip, kThrow, kPoison
};

enum class DeltaControl {
enum class DeltaControl : int32_t {
kNullDominates, kValueDominates, kZeroDominates
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Schema {
~Schema();

[[nodiscard]]
std::optional<size_t> GetColumnIndex(std::string_view name, bool strict) const;
std::optional<int32_t> GetColumnIndex(std::string_view name, bool strict) const;

[[nodiscard]]
const std::vector<std::string> &Names() const {
Expand All @@ -51,8 +51,8 @@ class Schema {
}

[[nodiscard]]
size_t NumCols() const {
return names_.size();
int32_t NumCols() const {
return static_cast<int32_t>(names_.size());
}

private:
Expand Down
4 changes: 2 additions & 2 deletions cpp-client/deephaven/dhcore/src/clienttable/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Schema::Schema(Private, std::vector<std::string> names, std::vector<ElementTypeI
index_(std::move(index)) {}
Schema::~Schema() = default;

std::optional<size_t> Schema::GetColumnIndex(std::string_view name, bool strict) const {
std::optional<int32_t> Schema::GetColumnIndex(std::string_view name, bool strict) const {
auto ip = index_.find(name);
if (ip != index_.end()) {
return ip->second;
return static_cast<int32_t>(ip->second);
}
// Not found: check strictness flag.
if (!strict) {
Expand Down
Loading