39 template <
typename DataType,
typename LatestType>
70 template <
typename SegmentType,
typename DataType,
typename LatestType>
83 if (entity ==
nullptr)
85 std::stringstream sstream;
86 sstream <<
"Could not find entity with ID " << entityID <<
".";
91 const int instanceIndex = 0;
92 bool querySuccess =
true;
98 const auto* instance = snapshot.
findInstance(instanceIndex);
102 (instance->id().timestamp - endTime).toSecondsDouble());
103 result.
values.emplace_back(dictToData(instance->data()));
107 std::stringstream sstream;
108 sstream <<
"Could not find instance with index " << instanceIndex
109 <<
" in snapshot " << snapshot.
id() <<
".";
111 querySuccess =
false;
125 std::stringstream sstream;
126 sstream <<
"Could not find instance with index " << instanceIndex <<
" for entity "
127 << entity->
id() <<
".";
void forEachSnapshotInTimeRange(const Time &min, const Time &max, FunctionT &&func) const
Return all snapshots between, including, min and max.
EntityInstanceT * findInstance(int index)
Represents a point in time.
armem::wm::EntitySnapshot EntitySnapshot
SnapshotRangeInfo< DataType, LatestType > getSnapshotsInRange(const SegmentType *segment, const MemoryID &entityID, const DateTime &startTime, const DateTime &endTime, std::function< DataType(const aron::data::DictPtr &)> dictToData, std::function< LatestType(const aron::data::DictPtr &)> dictToLatest)
Get data points for the snapshots of an entity in a given time range.
std::shared_ptr< Dict > DictPtr
Holds info on snapshot data extracted from a time range.
std::vector< double > timestampsSec
std::vector< DataType > values
aron::data::DictPtr findLatestInstanceData(int instanceIndex=0) const