Skip to content
Snippets Groups Projects

API: Introduce value and datatype structs to Extern C

Merged Florian Spreckelsen requested to merge f-value-data-structs into dev
All threads resolved!
2 files
+ 42
1
Compare changes
  • Side-by-side
  • Inline

Files

+ 9
1
@@ -162,6 +162,7 @@ public:
* The return value is undefined if IsVector is false.
*/
[[nodiscard]] virtual auto GetAsVector() const noexcept -> const std::vector<ScalarValue> & = 0;
[[nodiscard]] virtual auto ToString() const noexcept -> const std::string = 0;
friend class Value;
protected:
@@ -250,6 +251,11 @@ public:
static const std::vector<ScalarValue> empty_collection;
return empty_collection;
}
inline auto ToString() const noexcept -> const std::string {
CAOSDB_DEBUG_MESSAGE_STRING(*wrapped, out)
return out;
}
friend class Value;
protected:
@@ -286,7 +292,9 @@ public:
explicit inline Value(const ScalarValue &value) : Value() {
this->wrapped->mutable_scalar_value()->CopyFrom(*value.wrapped);
}
explicit inline Value(const AbstractValue &value) : Value(value.GetProtoValue()) {}
explicit inline Value(const AbstractValue &value) : Value() {
this->wrapped->CopyFrom(*value.GetProtoValue());
}
explicit inline Value(ProtoValue *wrapped) : ProtoMessageWrapper<ProtoValue>(wrapped) {}
explicit inline Value(const std::string &value) : ProtoMessageWrapper<ProtoValue>() {
this->wrapped->mutable_scalar_value()->set_string_value(value);
Loading