diff --git a/include/caosdb/entity.h b/include/caosdb/entity.h index cbdf0730b996f73a0d3dd98dbe7172143329125e..edd2018ba7a274fabe5e6eca0db09375dec78430 100644 --- a/include/caosdb/entity.h +++ b/include/caosdb/entity.h @@ -338,8 +338,6 @@ private: */ class Properties { public: - // TODO(fspreck) Implementations needed (basically everything). See Parents - // container for inspiration. /** * Return the current size of the properties container. * @@ -448,7 +446,6 @@ public: auto SetUnit(const std::string &unit) -> void; // Currently no references or lists. auto SetDatatype(const std::string &datatype) -> void; - // TODO(fspreck) this one is tricky. See AppendParent auto AppendProperty(const Property &property) -> void; auto AppendParent(const Parent &parent) -> void; diff --git a/src/caosdb/entity.cpp b/src/caosdb/entity.cpp index c54a1506ae1b99fb7fa8a218ce2428d2e907fa37..22f0effe8a8c345775eaf80b2dfaba37199c6675 100644 --- a/src/caosdb/entity.cpp +++ b/src/caosdb/entity.cpp @@ -141,6 +141,14 @@ auto Entity::AppendParent(const Parent &parent) -> void { this->parents.Append(parent); } +[[nodiscard]] auto Entity::GetProperties() const -> const Properties & { + return properties; +} + +auto Entity::AppendProperty(const Property &property) -> void { + this->properties.Append(property); +} + auto Entity::CreateProtoEntity() -> ProtoEntity * { return google::protobuf::Arena::CreateMessage<ProtoEntity>(get_arena()); }