Skip to content
Snippets Groups Projects

ENH: Allow insertion and deletion of single entities

Merged Florian Spreckelsen requested to merge f-insert into dev
All threads resolved!
Compare and Show latest version
13 files
+ 130
38
Compare changes
  • Side-by-side
  • Inline
Files
13
+ 12
19
@@ -38,6 +38,12 @@ using caosdb::entity::v1alpha1::IdResponse;
using ProtoParent = caosdb::entity::v1alpha1::Parent;
using ProtoEntity = caosdb::entity::v1alpha1::Entity;
/**
* Messages convey information about the state and result of transactions.
*
* A Message object can be thought of as kinf of a generalized error object in
* other frameworks. Please have a look at MessageCodes for more details.
*/
class Message {
public:
[[nodiscard]] inline auto GetCode() const -> MessageCode {
@@ -258,24 +264,6 @@ public:
auto Append(const Property &property) -> void;
friend class Entity;
};
/**
* Messages convey information about the state and result of transactions.
*
* A Message object can be thought of as kinf of a generalized error object in
* other frameworks. Please have a look at MessageCodes for more details.
*/
class Message {
public:
explicit inline Message(caosdb::entity::v1alpha1::Message *wrapped)
: wrapped(wrapped){};
[[nodiscard]] inline auto GetCode() const -> MessageCode {
return get_message_code(wrapped->code());
}
[[nodiscard]] inline auto GetDescription() const -> std::string {
return wrapped->description();
}
private:
inline Properties(){};
@@ -326,6 +314,9 @@ public:
[[nodiscard]] inline auto GetUnit() const -> const std::string & {
return wrapped->unit();
};
[[nodiscard]] inline auto GetValue() const -> const std::string & {
return wrapped->value();
};
[[nodiscard]] auto GetParents() const -> const Parents &;
[[nodiscard]] auto GetProperties() const -> const Properties &;
@@ -338,6 +329,9 @@ public:
[[nodiscard]] auto GetWarnings() const -> const Messages & {
return warnings;
}
[[nodiscard]] inline auto HasWarnings() const -> bool {
return this->warnings.wrapped->size() > 0;
}
[[nodiscard]] auto GetInfos() const -> const Messages & { return infos; }
inline auto ToString() const -> const std::string {
@@ -353,7 +347,6 @@ public:
auto SetName(const std::string &name) -> void;
auto SetVersionId(const std::string &id) -> void;
// TODO(fspreck) ... and also these
auto SetValue(const std::string &value) -> void;
auto SetUnit(const std::string &unit) -> void;
// Currently no references or lists.
Loading