Skip to content
Snippets Groups Projects
Commit 8bdeb379 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

Merge remote-tracking branch 'origin/armem/dev' into fabianpk

parents 7bfdb41c 5416f1cd
No related branches found
No related tags found
1 merge request!337Merge fabianpk dev branch
...@@ -5,7 +5,7 @@ namespace armarx::armem::base ...@@ -5,7 +5,7 @@ namespace armarx::armem::base
{ {
void EntityInstanceMetadata::access() const void EntityInstanceMetadata::access() const
{ {
accessed++; numAccessed++;
lastAccessedTime = armarx::core::time::DateTime::Now(); lastAccessedTime = armarx::core::time::DateTime::Now();
} }
...@@ -25,7 +25,7 @@ std::ostream& armarx::armem::base::operator<<(std::ostream& os, const EntityInst ...@@ -25,7 +25,7 @@ std::ostream& armarx::armem::base::operator<<(std::ostream& os, const EntityInst
<< "\n - t_referenced = \t" << armem::toStringMicroSeconds(d.referencedTime) << " us" << "\n - t_referenced = \t" << armem::toStringMicroSeconds(d.referencedTime) << " us"
<< "\n - t_sent = \t" << armem::toStringMicroSeconds(d.sentTime) << " us" << "\n - t_sent = \t" << armem::toStringMicroSeconds(d.sentTime) << " us"
<< "\n - t_arrived = \t" << armem::toStringMicroSeconds(d.arrivedTime) << " us" << "\n - t_arrived = \t" << armem::toStringMicroSeconds(d.arrivedTime) << " us"
<< "\n - t_accessed = \t" << armem::toStringMicroSeconds(d.lastAccessedTime) << " us (" << d.accessed << ")" << "\n - t_accessed = \t" << armem::toStringMicroSeconds(d.lastAccessedTime) << " us (" << d.numAccessed << ")"
<< "\n - confidence = \t" << d.confidence << " us" << "\n - confidence = \t" << d.confidence << " us"
; ;
return os; return os;
......
...@@ -11,9 +11,10 @@ namespace armarx::armem::base ...@@ -11,9 +11,10 @@ namespace armarx::armem::base
struct Metadata struct Metadata
{ {
virtual void access() const = 0;
virtual ~Metadata() = default; virtual ~Metadata() = default;
/// TODO @peller
virtual void access() const = 0;
}; };
/** /**
...@@ -21,12 +22,20 @@ namespace armarx::armem::base ...@@ -21,12 +22,20 @@ namespace armarx::armem::base
*/ */
struct NoData : public Metadata struct NoData : public Metadata
{ {
void access() const final {}
virtual ~NoData() = default; virtual ~NoData() = default;
bool operator==(const NoData& other) { return true; } void access() const final
bool operator!=(const NoData& other) { return false;} {
}
bool operator==(const NoData& other)
{
return true;
}
bool operator!=(const NoData& other)
{
return false;
}
}; };
...@@ -35,8 +44,16 @@ namespace armarx::armem::base ...@@ -35,8 +44,16 @@ namespace armarx::armem::base
*/ */
struct EntityInstanceMetadata : public Metadata struct EntityInstanceMetadata : public Metadata
{ {
/// Time when this value was created. ///
/**
* @brief Time this instance refers to.
*
* For example, the physical time point when an image was captured.
* If the image is processed, the result should have the same
* referencedTime as the image.
*/
Time referencedTime = Time::Invalid(); Time referencedTime = Time::Invalid();
/// Time when this value was sent to the memory. /// Time when this value was sent to the memory.
Time sentTime = Time::Invalid(); Time sentTime = Time::Invalid();
/// Time when this value has arrived at the memory. /// Time when this value has arrived at the memory.
...@@ -45,16 +62,16 @@ namespace armarx::armem::base ...@@ -45,16 +62,16 @@ namespace armarx::armem::base
/// An optional confidence, may be used for things like decay. /// An optional confidence, may be used for things like decay.
float confidence = 1.0; float confidence = 1.0;
/// An optional value indicating the last access /// An optional value indicating the time of last access.
mutable Time lastAccessedTime = Time::Invalid(); mutable Time lastAccessedTime = Time::Invalid();
/// A counter how often the instance has been accessed /// A counter how often the instance has been accessed.
mutable unsigned long accessed = 0; mutable unsigned long numAccessed = 0;
void access() const final;
virtual ~EntityInstanceMetadata() = default; virtual ~EntityInstanceMetadata() = default;
void access() const final;
bool operator==(const EntityInstanceMetadata& other) const; bool operator==(const EntityInstanceMetadata& other) const;
inline bool operator!=(const EntityInstanceMetadata& other) const inline bool operator!=(const EntityInstanceMetadata& other) const
{ {
......
...@@ -60,7 +60,7 @@ namespace armarx::armem ...@@ -60,7 +60,7 @@ namespace armarx::armem
toIce(ice.referencedTime, metadata.referencedTime); toIce(ice.referencedTime, metadata.referencedTime);
toIce(ice.sentTime, metadata.sentTime); toIce(ice.sentTime, metadata.sentTime);
toIce(ice.lastAccessedTime, metadata.lastAccessedTime); toIce(ice.lastAccessedTime, metadata.lastAccessedTime);
ice.accessed = metadata.accessed; ice.accessed = metadata.numAccessed;
} }
void base::fromIce(const data::EntityInstanceMetadata& ice, EntityInstanceMetadata& metadata) void base::fromIce(const data::EntityInstanceMetadata& ice, EntityInstanceMetadata& metadata)
{ {
...@@ -69,7 +69,7 @@ namespace armarx::armem ...@@ -69,7 +69,7 @@ namespace armarx::armem
fromIce(ice.referencedTime, metadata.referencedTime); fromIce(ice.referencedTime, metadata.referencedTime);
fromIce(ice.sentTime, metadata.sentTime); fromIce(ice.sentTime, metadata.sentTime);
fromIce(ice.lastAccessedTime, metadata.lastAccessedTime); fromIce(ice.lastAccessedTime, metadata.lastAccessedTime);
metadata.accessed = ice.accessed; metadata.numAccessed = ice.accessed;
} }
......
...@@ -114,7 +114,7 @@ namespace armarx::armem::gui::instance ...@@ -114,7 +114,7 @@ namespace armarx::armem::gui::instance
armem::toDateTimeMilliSeconds(metadata.referencedTime), armem::toDateTimeMilliSeconds(metadata.referencedTime),
armem::toDateTimeMilliSeconds(metadata.sentTime), armem::toDateTimeMilliSeconds(metadata.sentTime),
armem::toDateTimeMilliSeconds(metadata.arrivedTime), armem::toDateTimeMilliSeconds(metadata.arrivedTime),
armem::toDateTimeMilliSeconds(metadata.lastAccessedTime) + " (" + std::to_string(metadata.accessed) + " times total)" armem::toDateTimeMilliSeconds(metadata.lastAccessedTime) + " (" + std::to_string(metadata.numAccessed) + " times total)"
}; };
ARMARX_CHECK_EQUAL(static_cast<size_t>(treeItemMetadata->childCount()), items.size()); ARMARX_CHECK_EQUAL(static_cast<size_t>(treeItemMetadata->childCount()), items.size());
int i = 0; int i = 0;
......
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