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

DRAFT: Implement appending and getting properties

parent febbf560
No related branches found
No related tags found
1 merge request!4ENH: Allow insertion and deletion of single entities
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -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;
......
......@@ -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());
}
......
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