From 3a165d4919a133e5b20c8e09dc86f4e005490b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org> Date: Tue, 17 Aug 2021 20:57:27 +0200 Subject: [PATCH] MAINT: TODO and rename remove->Remove --- include/caosdb/entity.h | 4 +++- src/caosdb/entity.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/caosdb/entity.h b/include/caosdb/entity.h index 5e1b87f..2f662e0 100644 --- a/include/caosdb/entity.h +++ b/include/caosdb/entity.h @@ -178,7 +178,7 @@ protected: /** * Remove the element at the given index. */ - inline auto remove(int index) -> void { + inline auto Remove(int index) -> void { this->wrapped->DeleteSubrange(index, 1); if (cache.count(index) > 0) { cache.erase(index); @@ -643,6 +643,8 @@ public: }; [[nodiscard]] auto GetParents() const -> const Parents &; + // TODO(henrik) const prevents properties from being changed + // what about an interface that operates on the list directly? [[nodiscard]] auto GetProperties() const -> const Properties &; [[nodiscard]] inline auto GetErrors() const -> const Messages & { return errors; diff --git a/src/caosdb/entity.cpp b/src/caosdb/entity.cpp index b000e75..e1fcc5f 100644 --- a/src/caosdb/entity.cpp +++ b/src/caosdb/entity.cpp @@ -158,7 +158,7 @@ auto Entity::AppendParent(const Parent &parent) -> void { this->parents.Append(parent); } -auto Entity::RemoveParent(int index) -> void { this->parents.remove(index); } +auto Entity::RemoveParent(int index) -> void { this->parents.Remove(index); } [[nodiscard]] auto Entity::GetProperties() const -> const Properties & { return properties; @@ -169,7 +169,7 @@ auto Entity::AppendProperty(const Property &property) -> void { } auto Entity::RemoveProperty(int index) -> void { - this->properties.remove(index); + this->properties.Remove(index); } auto Entity::CreateProtoEntity() -> ProtoEntity * { -- GitLab