diff --git a/source/RobotAPI/libraries/armem/core/base/EntityInstanceBase.h b/source/RobotAPI/libraries/armem/core/base/EntityInstanceBase.h index f7e5396bd99cbe90e271be0fdc0cab95617ad16e..2dadcbc6784ac89dff3658c4d3c4c5282d3e7ef1 100644 --- a/source/RobotAPI/libraries/armem/core/base/EntityInstanceBase.h +++ b/source/RobotAPI/libraries/armem/core/base/EntityInstanceBase.h @@ -9,25 +9,13 @@ namespace armarx::armem::base { - struct Metadata - { - virtual ~Metadata() = default; - - /// TODO @peller - virtual void access() const = 0; - }; - /** * @brief Default data of an entity instance (empty). */ - struct NoData : public Metadata + struct NoData { virtual ~NoData() = default; - void access() const final - { - } - bool operator==(const NoData& other) { return true; @@ -42,10 +30,10 @@ namespace armarx::armem::base /** * @brief Metadata of an entity instance. */ - struct EntityInstanceMetadata : public Metadata + struct EntityInstanceMetadata { - /// Time when this value was created. - Time createdTime; + + virtual ~EntityInstanceMetadata() = default; /** * @brief Time this instance refers to. @@ -58,7 +46,6 @@ namespace armarx::armem::base /// Time when this value was sent to the memory. Time sentTime = Time::Invalid(); - /// Time when this value has arrived at the memory. Time arrivedTime = Time::Invalid(); @@ -71,9 +58,8 @@ namespace armarx::armem::base /// A counter how often the instance has been accessed. mutable unsigned long numAccessed = 0; - virtual ~EntityInstanceMetadata() = default; - - void access() const final; + /// Called whenever the entity instance this metadata belongs to is accessed (e.g. queried). + void access() const; bool operator==(const EntityInstanceMetadata& other) const; inline bool operator!=(const EntityInstanceMetadata& other) const