Reader.cpp
Go to the documentation of this file.
1 #include "Reader.h"
2 
3 #include <sstream>
4 
7 
8 #include <RobotAPI/libraries/armem/aron/MemoryLink.aron.generated.h>
15 
16 #include "query/Builder.h"
17 #include "query/query_fns.h"
18 
19 #include <mutex>
20 #include <Ice/LocalException.h>
21 
22 namespace armarx::armem::client
23 {
24 
25  Reader::Reader(server::ReadingMemoryInterfacePrx readingMemory,
26  server::PredictingMemoryInterfacePrx predictingMemory) :
27  readingPrx(readingMemory), predictionPrx(predictingMemory)
28  {
29  }
30 
31 
34  {
35  return QueryResult::fromIce(query(input.toIce()));
36  }
37 
38 
39  armem::query::data::Result
40  Reader::query(const armem::query::data::Input& input) const
41  {
42  armem::query::data::Result result;
43  if (!readingPrx)
44  {
45  throw error::ProxyNotSet("ReadingMemoryInterfacePrx",
46  "Reading interface proxy must be set to perform a query.");
47  }
48 
49  try
50  {
51  result = readingPrx->query(input);
52  }
53  catch (const ::Ice::ConnectionRefusedException& e)
54  {
55  // the proxy is invalid. we must perform a reconnect
56  ARMARX_INFO << "Trying to reconnect ...";
57 
58  }
59  catch (const Ice::LocalException& e)
60  {
61  std::stringstream sstream;
62  sstream << "Memory query failed.\nReason: " << e.what();
63  result.errorMessage = sstream.str();
64 
65  ARMARX_VERBOSE << result.errorMessage;
66  }
67  return result;
68  }
69 
70 
71  QueryResult Reader::query(armem::query::data::MemoryQueryPtr query, armem::query::DataMode dataMode) const
72  {
73  return this->query(armem::query::data::MemoryQuerySeq{query}, dataMode);
74  }
75 
76 
77  QueryResult Reader::query(const armem::query::data::MemoryQuerySeq& queries, armem::query::DataMode dataMode) const
78  {
80  input.memoryQueries = queries;
81  input.dataMode = dataMode;
82  return this->query(input);
83  }
84 
85 
86  QueryResult Reader::query(const QueryBuilder& queryBuilder) const
87  {
88  return this->query(queryBuilder.buildQueryInput());
89  }
90 
91 
94  int recursionDepth) const
95  {
96  return QueryResult::fromIce(query(input.toIce(), mns, recursionDepth));
97  }
98 
99 
100  armem::query::data::Result Reader::query(const armem::query::data::Input& input,
102  int recursionDepth) const
103  {
104  if (!readingPrx)
105  {
106  throw error::ProxyNotSet("ReadingMemoryInterfacePrx",
107  "Reading interface proxy must be set to perform a query.");
108  }
109 
110  armem::query::data::Result result;
111  try
112  {
113  result = readingPrx->query(input);
114  QueryResult bObj = QueryResult::fromIce(result);
115  bObj.memory.forEachInstance(
116  [&bObj, &mns, recursionDepth](armem::wm::EntityInstance& instance)
117  { resolveMemoryLinks(instance, bObj.memory, mns, recursionDepth); });
118  result = bObj.toIce();
119  }
120  catch (const Ice::LocalException& e)
121  {
122  std::stringstream sstream;
123  sstream << "Memory query failed.\nReason: " << e.what();
124  result.errorMessage = sstream.str();
125  }
127  {
128  std::stringstream sstream;
129  sstream << "Encountered malformed MemoryLink: " << e.what();
130  result.errorMessage = sstream.str();
131  }
132 
133  return result;
134  }
135 
136 
137  QueryResult Reader::query(armem::query::data::MemoryQueryPtr query, // NOLINT
139  int recursionDepth) const
140  {
141  return this->query(armem::query::data::MemoryQuerySeq{query}, mns, recursionDepth);
142  }
143 
144 
145  QueryResult Reader::query(const armem::query::data::MemoryQuerySeq& queries,
147  int recursionDepth) const
148  {
150  input.memoryQueries = queries;
151  return this->query(input, mns, recursionDepth);
152  }
153 
154 
157  int recursionDepth) const
158  {
159  return this->query(queryBuilder.buildQueryInput(), mns, recursionDepth);
160  }
161 
162 
163  /**
164  * Get the MemoryID and data required to fill in the given MemoryLink.
165  *
166  * Returns nothing if the data could not be retrieved or its type does not
167  * match the MemoryLink's template type.
168  *
169  * @param linkData the data object of the MemoryLink
170  * @param linkType the type object of the MemoryLink
171  * @return a pair of memoryID and data to fill in a MemoryLink, or nothing if not available
172  */
173  std::optional<std::pair<MemoryID, aron::data::VariantPtr>>
175  const aron::type::VariantPtr& linkType,
177  {
178  static const aron::Path memoryLinkIDPath{{"memoryID"}};
179  static const aron::Path memoryLinkDataPath{{"data"}};
181  auto memoryIDDict =
182  aron::data::Dict::DynamicCastAndCheck(linkData->navigateAbsolute(memoryLinkIDPath));
183  dto.fromAron(memoryIDDict);
184  auto memoryID = aron::fromAron<armem::MemoryID>(dto);
186  {
187  ARMARX_INFO << "Encountered unresolvable MemoryID '" << memoryID.str()
188  << "', ignoring.";
189  return {};
190  }
191 
192  auto nextMemory = resolveID(mns, memoryID);
193  if (!nextMemory)
194  {
195  ARMARX_WARNING << "Could not retrieve data for " << memoryID.str() << ", skipping...";
196  return {};
197  }
198  auto nextDataAndType = extractDataAndType(nextMemory.value(), memoryID);
199  if (!nextDataAndType)
200  {
201  ARMARX_WARNING << "Data or type for " << memoryID.str()
202  << " not available in memory containing that MemoryID.";
203  return {};
204  }
205  auto [nextData, nextType] = nextDataAndType.value();
206  auto linkTemplate =
207  aron::type::Object::DynamicCastAndCheck(linkType)->getTemplateInstantiations().at(0);
208  std::string nextObjectName = nextType->getObjectNameWithTemplateInstantiations();
209  if (nextType->getObjectName() != linkTemplate)
210  {
211  ARMARX_WARNING << "Linked object " << memoryID.str() << " is of the type "
212  << nextType->getObjectName() << ", but the link requires the type "
213  << linkTemplate;
214  return {};
215  }
216  return {{memoryID,
217  // This is currently the only method to prefix the path to the data correctly.
219  nextData->toAronDTO(),
220  linkData->getPath().withElement(memoryLinkDataPath.toString()))}};
221  }
222 
223  void
224  Reader::resolveMemoryLinks(armem::wm::EntityInstance& instance,
227  int recursionDepth)
228  {
229  static const aron::Path memoryLinkDataPath{{"data"}};
230  // MemoryID is used for the template instantiation as a placeholder -
231  // you could use any type here.
232  static const std::string linkType =
233  arondto::MemoryLink<arondto::MemoryID>::ToAronType()->getFullName();
234 
235  std::set<armem::MemoryID> seenIDs{instance.id()};
236  std::vector<aron::Path> currentPaths{{{""}}};
237  std::vector<aron::Path> nextPaths;
238  int depth = 0;
239 
240  auto dataAndType = extractDataAndType(input, instance.id());
241  if (!dataAndType)
242  {
243  ARMARX_INFO << "Instance '" << instance.id().str() << "' does not have a defined type.";
244  return;
245  }
246  auto [instanceData, instanceType] = dataAndType.value();
247  while (!currentPaths.empty() && (recursionDepth == -1 || depth < recursionDepth))
248  {
249  for (const auto& path : currentPaths)
250  {
251  aron::SubObjectFinder finder(linkType);
252  if (path.getFirstElement().empty())
253  {
254  armarx::aron::data::visitRecursive(finder, instanceData, instanceType);
255  }
256  else
257  {
259  instanceData->navigateAbsolute(path),
260  instanceType->navigateAbsolute(path));
261  }
262 
263  for (auto& [linkPathStr, linkDataAndType] : finder.getFoundObjects()) // NOLINT
264  {
265  auto [linkData, linkType] = linkDataAndType;
266  auto result = findDataForLink(linkData, linkType, mns);
267  if (result)
268  {
269  auto [memoryID, dataToAppend] = result.value();
270  if (seenIDs.find(memoryID) != seenIDs.end())
271  {
272  continue;
273  }
274  seenIDs.insert(memoryID);
275 
276  aron::data::Dict::DynamicCastAndCheck(linkData)->setElement(
277  memoryLinkDataPath.toString(), dataToAppend);
278  nextPaths.push_back(
279  linkData->getPath().withElement(memoryLinkDataPath.toString()));
280  }
281  }
282  }
283  currentPaths = std::move(nextPaths);
284  nextPaths.clear();
285  ++depth;
286  }
287  }
288 
289 
290  QueryResult Reader::queryMemoryIDs(const std::vector<MemoryID>& ids, armem::query::DataMode dataMode) const
291  {
292  using namespace client::query_fns;
293 
294  query::Builder qb(dataMode);
295  for (const MemoryID& id : ids)
296  {
298 
299  if (id.hasTimestamp())
300  {
301  entity.snapshots(withID(id));
302  }
303  else
304  {
305  entity.snapshots(latest());
306  }
307  }
308  return query(qb);
309  }
310 
311 
312 
313  std::optional<wm::EntitySnapshot> Reader::getLatestSnapshotOf(const std::vector<MemoryID>& _snapshotIDs) const
314  {
315  std::vector<MemoryID> snapshotIDs = _snapshotIDs;
316 
317  client::QueryResult result = this->queryMemoryIDs(snapshotIDs);
318  if (result.success)
319  {
320  std::sort(snapshotIDs.begin(), snapshotIDs.end(), compareTimestampDecreasing);
321  for (const MemoryID& snapshotID : snapshotIDs)
322  {
323  try
324  {
325  wm::EntitySnapshot& snapshot = result.memory.getSnapshot(snapshotID);
326  return snapshot;
327  }
328  catch (const armem::error::ArMemError&)
329  {
330  }
331  }
332  return std::nullopt;
333  }
334  else
335  {
336  ARMARX_INFO << "Error querying " << snapshotIDs.size() << " STT snapshots:\n"
337  << result.errorMessage;
338  return std::nullopt;
339  }
340  }
341 
342 
344  {
345  using namespace client::query_fns;
346  if (!id.isWellDefined())
347  {
348  throw armem::error::InvalidMemoryID(id, "ID must be well defined, but was not.");
349  }
350 
351  query::Builder qb(dataMode);
353  id.hasCoreSegmentName()
354  ? qb.coreSegments(withID(id))
355  : qb.coreSegments(all());
357  id.hasProviderSegmentName()
358  ? core.providerSegments(withID(id))
359  : core.providerSegments(all());
360  query::EntitySelector& entity =
361  id.hasEntityName()
362  ? prov.entities(withID(id))
363  : prov.entities(all());
364  entity.snapshots(latest());
365 
366  return query(qb);
367  }
368 
369 
370  std::optional<wm::EntitySnapshot> Reader::getLatestSnapshotIn(const MemoryID& id, armem::query::DataMode dataMode) const
371  {
372  client::QueryResult result = getLatestSnapshotsIn(id, dataMode);
373  if (result.success)
374  {
375  std::optional<wm::EntitySnapshot> latest = std::nullopt;
376  result.memory.forEachEntity([&latest](const wm::Entity & entity)
377  {
378  if (not entity.empty())
379  {
380  const wm::EntitySnapshot& snapshot = entity.getLatestSnapshot();
381  if (not latest.has_value() or latest->time() < snapshot.time())
382  {
383  latest = snapshot;
384  }
385  }
386  return true;
387  });
388  return latest;
389  }
390  else
391  {
392  ARMARX_INFO << "Error querying latest snapshot in " << id;
393  return std::nullopt;
394  }
395  }
396 
397 
399  {
400  using namespace client::query_fns;
401 
402  query::Builder qb(dataMode);
404 
405  return this->query(qb);
406  }
407 
408 
410  {
411  using namespace client::query_fns;
412 
413  query::Builder qb(dataMode);
415 
416  return this->query(qb);
417  }
418 
419  server::dto::DirectlyStoreResult
420  Reader::directlyStore(const server::dto::DirectlyStoreInput& input) const
421  {
422  server::RecordingMemoryInterfacePrx storingMemoryPrx = server::RecordingMemoryInterfacePrx::checkedCast(readingPrx);
423  if (storingMemoryPrx)
424  {
425  return storingMemoryPrx->directlyStore(input);
426  }
427  else
428  {
429  ARMARX_WARNING << "Could not store a query into the LTM. It seems like the Memory does not implement the StoringMemoryInterface.";
430  return {};
431  }
432  }
433 
435  {
436  server::RecordingMemoryInterfacePrx storingMemoryPrx = server::RecordingMemoryInterfacePrx::checkedCast(readingPrx);
437  if (storingMemoryPrx)
438  {
439  server::dto::StartRecordInput i;
440  i.executionTime = armarx::core::time::dto::DateTime();
441  i.startTime = armarx::core::time::dto::DateTime();
442  i.recordingID = "";
443  i.configuration.clear();
444 
445  storingMemoryPrx->startRecord(i);
446  return;
447  }
448  else
449  {
450  ARMARX_WARNING << "Could not store a query into the LTM. It seems like the Memory does not implement the StoringMemoryInterface.";
451  }
452  }
453 
455  {
456  server::RecordingMemoryInterfacePrx storingMemoryPrx = server::RecordingMemoryInterfacePrx::checkedCast(readingPrx);
457  if (storingMemoryPrx)
458  {
459  storingMemoryPrx->stopRecord();
460  return;
461  }
462  else
463  {
464  ARMARX_WARNING << "Could not store a query into the LTM. It seems like the Memory does not implement the StoringMemoryInterface.";
465  }
466  }
467 
468 
469  void
470  Reader::setReadingMemory(server::ReadingMemoryInterfacePrx readingMemory)
471  {
472  this->readingPrx = readingMemory;
473  }
474 
475  void
476  Reader::setPredictingMemory(server::PredictingMemoryInterfacePrx predictingMemory)
477  {
478  this->predictionPrx = predictingMemory;
479  }
480 
481  std::vector<PredictionResult>
482  Reader::predict(const std::vector<PredictionRequest>& requests) const
483  {
484  if (!predictionPrx)
485  {
486  throw error::ProxyNotSet(
487  "PredictingMemoryInterfacePrx",
488  "Prediction interface proxy must be set to request a prediction.");
489  }
490 
491  armem::prediction::data::PredictionRequestSeq iceRequests;
492  for (const auto& request : requests)
493  {
494  iceRequests.push_back(request.toIce());
495  }
496 
497  armem::prediction::data::PredictionResultSeq results;
498  try
499  {
500  results = predictionPrx->predict(iceRequests);
501  }
502  catch (const Ice::LocalException& e)
503  {
504  armem::prediction::data::PredictionResult failure;
505  failure.success = false;
506  std::stringstream sstream;
507  sstream << "Prediction request failed. Reason: " << e.what();
508  failure.errorMessage = sstream.str();
509 
510  for (size_t i = 0; i < requests.size(); ++i)
511  {
512  results.push_back(failure);
513  }
514  }
515 
516  std::vector<PredictionResult> boResults;
517  for (const auto& result : results)
518  {
519  boResults.push_back(PredictionResult::fromIce(result));
520  }
521 
522  return boResults;
523  }
524 
525  std::map<MemoryID, std::vector<PredictionEngine>>
527  {
528  if (!predictionPrx)
529  {
530  throw error::ProxyNotSet(
531  "PredictingMemoryInterfacePrx",
532  "Prediction interface proxy must be set to request a prediction.");
533  }
534 
535  armem::prediction::data::EngineSupportMap engines;
536  try
537  {
538  engines = predictionPrx->getAvailableEngines();
539  }
540  catch (const Ice::LocalException& e)
541  {
542  // Just leave engines empty in this case.
543  }
544 
545  std::map<MemoryID, std::vector<PredictionEngine>> boMap;
546  armarx::fromIce(engines, boMap);
547 
548  return boMap;
549  }
550 } // namespace armarx::armem::client
armarx::armem::detail::SuccessHeader::success
bool success
Definition: SuccessHeader.h:20
armarx::armem::client::query::ProviderSegmentSelector
Definition: selectors.h:80
armarx::armem::base::detail::MemoryContainerBase::empty
bool empty() const
Definition: MemoryContainerBase.h:44
armarx::armem::MemoryID::isWellDefined
bool isWellDefined() const
Indicate whether this ID is well-defined.
Definition: MemoryID.cpp:177
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::aron::type::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::armem::client::query::ProviderSegmentSelector::entities
EntitySelector & entities()
Start specifying entities.
Definition: selectors.cpp:123
Reader.h
armarx::armem::client::QueryResult::memory
wm::Memory memory
The slice of the memory that matched the query.
Definition: Query.h:58
armarx::armem::client::Reader::getLatestSnapshotsIn
QueryResult getLatestSnapshotsIn(const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get the latest snapshots under the given memory ID.
Definition: Reader.cpp:343
armarx::aron::data::Variant::FromAronDTO
static VariantPtr FromAronDTO(const data::dto::GenericDataPtr &, const Path &=Path())
create a variant from a dto object
Definition: Variant.cpp:39
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition: memory_definitions.h:32
armarx::armem::client::query::Builder::buildQueryInput
QueryInput buildQueryInput() const
Definition: Builder.cpp:11
armarx::armem::client::Reader::setPredictingMemory
void setPredictingMemory(server::PredictingMemoryInterfacePrx predictingMemory)
Definition: Reader.cpp:476
armarx::armem::client::query::EntitySelector::snapshots
SnapshotSelector & snapshots()
Start specifying entity snapshots.
Definition: selectors.cpp:86
armarx::armem::client::Reader::stopRecording
void stopRecording() const
Definition: Reader.cpp:454
armarx::armem::MemoryID::str
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
Definition: MemoryID.cpp:102
armarx::armem::client::Reader::Reader
Reader(const Reader &)=default
Construct a memory reader.
armarx::armem::client
This file is part of ArmarX.
Definition: forward_declarations.h:7
armarx::armem::client::Reader::predictionPrx
server::PredictingMemoryInterfacePrx predictionPrx
Definition: Reader.h:210
armarx::armem::error::ArMemError
Base class for all exceptions thrown by the armem library.
Definition: ArMemError.h:18
MemoryID_operators.h
query_fns.h
armarx::armem::client::QueryResult
Result of a QueryInput.
Definition: Query.h:50
armarx::armem::base::detail::GetFindSnapshotMixin::getSnapshot
auto & getSnapshot(const MemoryID &snapshotID)
Retrieve an entity snapshot.
Definition: lookup_mixins.h:286
armarx::aron::data::detail::SpecializedVariantBase< data::dto::Dict, Dict >::DynamicCastAndCheck
static PointerType DynamicCastAndCheck(const VariantPtr &n)
Definition: SpecializedVariant.h:135
armarx::armem::server::wm::Entity
Definition: memory_definitions.h:30
armarx::status::failure
@ failure
armarx::armem::base::detail::ForEachEntityMixin::forEachEntity
bool forEachEntity(FunctionT &&func)
Definition: iteration_mixins.h:258
armarx::armem::resolveID
std::optional< armarx::armem::wm::Memory > resolveID(armarx::armem::client::MemoryNameSystem &mns, const armarx::armem::MemoryID &memoryID)
resolve a single MemoryID with the given MemoryNameSystem.
Definition: util.cpp:10
armarx::armem::PredictionResult::fromIce
static PredictionResult fromIce(const armem::prediction::data::PredictionResult &ice)
Definition: Prediction.cpp:68
armarx::armem::error::ProxyNotSet
Indicates that a proxy required for an operation wasn't usable.
Definition: ArMemError.h:215
armarx::armem::client::Reader::getAllLatestSnapshots
QueryResult getAllLatestSnapshots(armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get all latest snapshots in the memory.
Definition: Reader.cpp:398
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::armem::client::Reader::queryMemoryIDs
QueryResult queryMemoryIDs(const std::vector< MemoryID > &ids, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Query a specific set of memory IDs.
Definition: Reader.cpp:290
armarx::aron::data::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::armem::client::Reader::predict
std::vector< PredictionResult > predict(const std::vector< PredictionRequest > &requests) const
Get a prediction for the state of multiple entity instances in the future.
Definition: Reader.cpp:482
armarx::armem::client::query_fns::all
auto all()
Definition: query_fns.h:10
armarx::armem::detail::SuccessHeader::errorMessage
std::string errorMessage
Definition: SuccessHeader.h:21
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::query::DataMode
DataMode
Definition: DataMode.h:7
armarx::armem::client::query::Builder::coreSegments
CoreSegmentSelector & coreSegments()
Start specifying core segments.
Definition: Builder.cpp:38
armarx::armem::client::Reader::directlyStore
server::dto::DirectlyStoreResult directlyStore(const server::dto::DirectlyStoreInput &input) const
Definition: Reader.cpp:420
RecursiveVisitor.h
armarx::armem::client::QueryInput
A query for parts of a memory.
Definition: Query.h:23
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::armem::client::Reader::getAll
QueryResult getAll(armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get the whole memory content.
Definition: Reader.cpp:409
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
object_finders.h
armarx::armem::client::Reader::startRecording
void startRecording() const
Definition: Reader.cpp:434
armarx::armem::client::Reader::getAvailablePredictionEngines
std::map< MemoryID, std::vector< PredictionEngine > > getAvailablePredictionEngines() const
Get the list of prediction engines supported by the memory.
Definition: Reader.cpp:526
armarx::armem::compareTimestampDecreasing
bool compareTimestampDecreasing(const MemoryID &lhs, const MemoryID &rhs)
lhs.timestamp > rhs.timstamp
Definition: MemoryID_operators.cpp:23
armarx::armem::wm::EntitySnapshot
Client-side working memory entity snapshot.
Definition: memory_definitions.h:80
armarx::armem::base::detail::MemoryItem::id
MemoryID & id()
Definition: MemoryItem.h:27
aron_conversions.h
memory_definitions.h
armarx::armem::client::findDataForLink
std::optional< std::pair< MemoryID, aron::data::VariantPtr > > findDataForLink(const aron::data::VariantPtr &linkData, const aron::type::VariantPtr &linkType, armem::client::MemoryNameSystem &mns)
Get the MemoryID and data required to fill in the given MemoryLink.
Definition: Reader.cpp:174
armarx::fromIce
void fromIce(const std::map< IceKeyT, IceValueT > &iceMap, boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
Definition: ice_conversions_boost_templates.h:26
armarx::armem::MemoryID::hasEntityName
bool hasEntityName() const
Definition: MemoryID.h:121
armarx::armem::client::query_fns::latest
std::function< void(query::SnapshotSelector &)> latest()
Definition: query_fns.h:109
armarx::armem::error::InvalidMemoryID
Indicates that a memory ID is invalid, e.g.
Definition: ArMemError.h:151
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::armem::client::QueryResult::toIce
armem::query::data::Result toIce() const
Definition: Query.cpp:30
armarx::armem::client::Reader::setReadingMemory
void setReadingMemory(server::ReadingMemoryInterfacePrx readingMemory)
Definition: Reader.cpp:470
armarx::armem::client::query::CoreSegmentSelector
Definition: selectors.h:117
armarx::armem::index::memoryID
const MemoryID memoryID
Definition: memory_ids.cpp:29
armarx::aron::data::visitRecursive
requires isRecursiveVisitor< RecursiveVisitorImplementation, typename RecursiveVisitorImplementation::Input > void visitRecursive(RecursiveVisitorImplementation &v, typename RecursiveVisitorImplementation::Input &o)
Definition: RecursiveVisitor.h:146
armarx::armem::base::detail::ForEachEntityInstanceMixin::forEachInstance
bool forEachInstance(InstanceFunctionT &&func)
Definition: iteration_mixins.h:146
Builder.h
armarx::aron::type::detail::SpecializedVariantBase< type::dto::AronObject, Object >::DynamicCastAndCheck
static std::shared_ptr< Object > DynamicCastAndCheck(const VariantPtr &n)
Definition: SpecializedVariant.h:124
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
armarx::armem::client::query::Builder
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition: Builder.h:22
ice_conversions_templates.h
armarx::armem::client::query::CoreSegmentSelector::providerSegments
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
Definition: selectors.cpp:160
util.h
armarx::armem::client::query::EntitySelector
Definition: selectors.h:42
armarx::exceptions::local::ExpressionException
This exception is thrown if the macro ARMARX_CHECK_EXPRESSION is used.
Definition: ExpressionException.h:39
Logging.h
armarx::armem::client::Reader::readingPrx
server::ReadingMemoryInterfacePrx readingPrx
Definition: Reader.h:209
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::armem::client::QueryResult::fromIce
static QueryResult fromIce(const armem::query::data::Result &ice)
Definition: Query.cpp:25
armarx::armem::extractDataAndType
std::optional< std::pair< armarx::aron::data::DictPtr, armarx::aron::type::ObjectPtr > > extractDataAndType(const armarx::armem::wm::Memory &memory, const armarx::armem::MemoryID &memoryID)
get the data and type of the given MemoryID in the given Memory.
Definition: util.cpp:35
armarx::armem::client::Reader::getLatestSnapshotIn
std::optional< wm::EntitySnapshot > getLatestSnapshotIn(const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get the latest snapshot under the given memory ID.
Definition: Reader.cpp:370
armarx::armem::client::query_fns::withID
auto withID(const MemoryID &id)
Definition: query_fns.h:20
armarx::armem::client::Reader::query
QueryResult query(const QueryInput &input) const
Perform a query.
Definition: Reader.cpp:33
armarx::armem::client::Reader::getLatestSnapshotOf
std::optional< wm::EntitySnapshot > getLatestSnapshotOf(const std::vector< MemoryID > &snapshotIDs) const
Query the given snapshot and return the latest existing snapshot.
Definition: Reader.cpp:313
armarx::human::MemoryID
const armem::MemoryID MemoryID
Definition: memory_ids.cpp:29