EntityInstanceBase.cpp
Go to the documentation of this file.
1 #include "EntityInstanceBase.h"
2 
3 
4 namespace armarx::armem::base
5 {
7  {
8  numAccessed++;
10  }
11 
13  {
14  return referencedTime == other.referencedTime
15  && sentTime == other.sentTime
16  && arrivedTime == other.arrivedTime
17  && std::abs(confidence - other.confidence) < 1e-6f;
18  }
19 }
20 
21 
22 std::ostream& armarx::armem::base::operator<<(std::ostream& os, const EntityInstanceMetadata& d)
23 {
24  os << "EntityInstanceMetadata: "
25  << "\n - t_referenced = \t" << armem::toStringMicroSeconds(d.referencedTime) << " us"
26  << "\n - t_sent = \t" << armem::toStringMicroSeconds(d.sentTime) << " us"
27  << "\n - t_arrived = \t" << armem::toStringMicroSeconds(d.arrivedTime) << " us"
28  << "\n - t_accessed = \t" << armem::toStringMicroSeconds(d.lastAccessedTime) << " us (" << d.numAccessed << ")"
29  << "\n - confidence = \t" << d.confidence << " us"
30  ;
31  return os;
32 }
armarx::armem::base
Definition: CoreSegmentBase.h:15
armarx::armem::base::EntityInstanceMetadata::numAccessed
unsigned long numAccessed
A counter how often the instance has been accessed.
Definition: EntityInstanceBase.h:60
armarx::core::time::DateTime::Now
static DateTime Now()
Definition: DateTime.cpp:55
EntityInstanceBase.h
armarx::abs
std::vector< T > abs(const std::vector< T > &v)
Definition: VectorHelpers.h:253
armarx::armem::base::EntityInstanceMetadata::sentTime
Time sentTime
Time when this value was sent to the memory.
Definition: EntityInstanceBase.h:49
armarx::armem::base::EntityInstanceMetadata::access
void access() const
Called whenever the entity instance this metadata belongs to is accessed (e.g. queried).
Definition: EntityInstanceBase.cpp:6
armarx::armem::base::EntityInstanceMetadata::operator==
bool operator==(const EntityInstanceMetadata &other) const
Definition: EntityInstanceBase.cpp:12
armarx::armem::toStringMicroSeconds
std::string toStringMicroSeconds(const Time &time)
Returns time as e.g.
Definition: Time.cpp:26
armarx::armem::base::EntityInstanceMetadata::arrivedTime
Time arrivedTime
Time when this value has arrived at the memory.
Definition: EntityInstanceBase.h:51
armarx::armem::base::EntityInstanceMetadata::referencedTime
Time referencedTime
Time this instance refers to.
Definition: EntityInstanceBase.h:46
armarx::armem::base::EntityInstanceMetadata
Metadata of an entity instance.
Definition: EntityInstanceBase.h:34
armarx::armem::base::EntityInstanceMetadata::lastAccessedTime
Time lastAccessedTime
An optional value indicating the time of last access.
Definition: EntityInstanceBase.h:57
armarx::armem::base::EntityInstanceMetadata::confidence
float confidence
An optional confidence, may be used for things like decay.
Definition: EntityInstanceBase.h:54
armarx::armem::base::operator<<
std::ostream & operator<<(std::ostream &os, const EntityInstanceMetadata &rhs)
Definition: EntityInstanceBase.cpp:22