Skip to content

Commit

Permalink
C++ Client: Small changes to support interop
Browse files Browse the repository at this point in the history
  • Loading branch information
kosak committed Jun 27, 2024
1 parent 131fc43 commit 6d9c458
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 6d9c458

Please sign in to comment.