Skip to content
Snippets Groups Projects
Commit 705e09d0 authored by florian's avatar florian
Browse files

DRAFT: Disable messages for properties and parents for now

parent f6af9e0e
No related branches found
No related tags found
1 merge request!4ENH: Allow insertion and deletion of single entities
Pipeline #11185 passed
Pipeline: caosdb-cppinttest

#11186

    This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
    ...@@ -54,8 +54,10 @@ public: ...@@ -54,8 +54,10 @@ public:
    } }
    friend class Entity; friend class Entity;
    friend class Parent; // TODO(fspreck) Re-enable once we have decided how messages are
    friend class Property; // appended to parents and properties
    // friend class Parent;
    // friend class Property;
    friend class Messages; friend class Messages;
    private: private:
    ...@@ -76,8 +78,9 @@ public: ...@@ -76,8 +78,9 @@ public:
    } }
    friend class Entity; friend class Entity;
    friend class Parent; // TODO(fspreck) Same here.
    friend class Property; // friend class Parent;
    // friend class Property;
    private: private:
    inline Messages() : wrapped(nullptr){}; inline Messages() : wrapped(nullptr){};
    ...@@ -138,32 +141,32 @@ public: ...@@ -138,32 +141,32 @@ public:
    return out; return out;
    } }
    // TODO(fspreck) These need implementations. See Entity::GetErrors for // TODO(fspreck) Finish the following implementations once we have
    // inspiration. // decided how to attach messages to parents.
    /** // /**
    * Return the error messages of this parent. // * Return the error messages of this parent.
    */ // */
    [[nodiscard]] inline auto GetErrors() const -> const Messages & { // [[nodiscard]] inline auto GetErrors() const -> const Messages & {
    return errors; // return errors;
    } // }
    [[nodiscard]] inline auto HasErrors() const -> bool { // [[nodiscard]] inline auto HasErrors() const -> bool {
    return this->errors.wrapped->size() > 0; // return this->errors.wrapped->size() > 0;
    } // }
    /** // /**
    * Return the warning messages of this parent. // * Return the warning messages of this parent.
    */ // */
    [[nodiscard]] inline auto GetWarnings() const -> const Messages & { // [[nodiscard]] inline auto GetWarnings() const -> const Messages & {
    return warnings; // return warnings;
    } // }
    [[nodiscard]] inline auto HasWarnings() const -> bool { // [[nodiscard]] inline auto HasWarnings() const -> bool {
    return this->warnings.wrapped->size() > 0; // return this->warnings.wrapped->size() > 0;
    } // }
    /** // /**
    * Return the info messages of this parent. // * Return the info messages of this parent.
    */ // */
    [[nodiscard]] inline auto GetInfos() const -> const Messages & { // [[nodiscard]] inline auto GetInfos() const -> const Messages & {
    return infos; // return infos;
    } // }
    friend class Entity; friend class Entity;
    friend class Parents; friend class Parents;
    ...@@ -185,9 +188,9 @@ private: ...@@ -185,9 +188,9 @@ private:
    * Message which serves as storage backend. * Message which serves as storage backend.
    */ */
    mutable caosdb::entity::v1alpha1::Parent *wrapped; mutable caosdb::entity::v1alpha1::Parent *wrapped;
    Messages errors; // Messages errors;
    Messages warnings; // Messages warnings;
    Messages infos; // Messages infos;
    }; };
    /** /**
    ...@@ -252,9 +255,11 @@ public: ...@@ -252,9 +255,11 @@ public:
    [[nodiscard]] auto GetValue() const -> const std::string &; [[nodiscard]] auto GetValue() const -> const std::string &;
    [[nodiscard]] auto GetUnit() const -> const std::string &; [[nodiscard]] auto GetUnit() const -> const std::string &;
    [[nodiscard]] auto GetDatatype() const -> const std::string &; [[nodiscard]] auto GetDatatype() const -> const std::string &;
    [[nodiscard]] auto GetErrors() const -> const Messages &; // TODO(fspreck) Implement these when we have decided how to attach
    [[nodiscard]] auto GetWarnings() const -> const Messages &; // messages to properties.
    [[nodiscard]] auto GetInfos() const -> const Messages &; // [[nodiscard]] auto GetErrors() const -> const Messages &;
    // [[nodiscard]] auto GetWarnings() const -> const Messages &;
    // [[nodiscard]] auto GetInfos() const -> const Messages &;
    auto SetId(const std::string &id) -> void; auto SetId(const std::string &id) -> void;
    auto SetName(const std::string &name) -> void; auto SetName(const std::string &name) -> void;
    ......
    ...@@ -29,9 +29,11 @@ using ProtoEntity = caosdb::entity::v1alpha1::Entity; ...@@ -29,9 +29,11 @@ using ProtoEntity = caosdb::entity::v1alpha1::Entity;
    using caosdb::utility::get_arena; using caosdb::utility::get_arena;
    Parent::Parent() : wrapped(Parent::CreateProtoParent()) { Parent::Parent() : wrapped(Parent::CreateProtoParent()) {
    errors.wrapped = this->wrapped->mutable_errors(); // TODO(fspreck) Re-enable once we have decided how to attach
    warnings.wrapped = this->wrapped->mutable_warnings(); // messages to parents.
    infos.wrapped = this->wrapped->mutable_infos(); // errors.wrapped = this->wrapped->mutable_errors();
    // warnings.wrapped = this->wrapped->mutable_warnings();
    // infos.wrapped = this->wrapped->mutable_infos();
    } }
    auto Parent::CreateProtoParent() -> ProtoParent * { auto Parent::CreateProtoParent() -> ProtoParent * {
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment