MemoryToIceAdapter.cpp
Go to the documentation of this file.
1 #include "MemoryToIceAdapter.h"
2 
3 #include <thread>
4 #include <list>
5 #include <iostream>
6 #include <sstream>
7 
12 
20 
22 #include "query_proc/wm/wm.h"
23 
24 namespace armarx::armem::server
25 {
26 
28  server::ltm::Memory* longtermMemory) :
29  workingMemory(workingMemory), longtermMemory(longtermMemory)
30  {
31  }
32 
33  void
34  MemoryToIceAdapter::setMemoryListener(client::MemoryListenerInterfacePrx memoryListener)
35  {
36  this->memoryListenerTopic = memoryListener;
37  }
38 
39  // WRITING
40  data::AddSegmentResult
41  MemoryToIceAdapter::addSegment(const data::AddSegmentInput& input, bool addCoreSegments)
42  {
45 
46  data::AddSegmentResult output;
47 
48  server::wm::CoreSegment* coreSegment = nullptr;
49  try
50  {
51  coreSegment = &workingMemory->getCoreSegment(input.coreSegmentName);
52  }
53  catch (const armem::error::MissingEntry& e)
54  {
55  if (addCoreSegments)
56  {
57  coreSegment = &workingMemory->addCoreSegment(input.coreSegmentName);
58  }
59  else
60  {
61  output.success = false;
62  output.errorMessage = e.what();
63  return output;
64  }
65  }
66  ARMARX_CHECK_NOT_NULL(coreSegment);
67 
68  if (input.providerSegmentName.size() > 0)
69  {
70  coreSegment->doLocked(
71  [&coreSegment, &input]()
72  {
73  try
74  {
75  coreSegment->addProviderSegment(input.providerSegmentName);
76  }
78  {
79  // This is ok.
80  if (input.clearWhenExists)
81  {
82  server::wm::ProviderSegment& provider =
83  coreSegment->getProviderSegment(input.providerSegmentName);
84  provider.clear();
85  }
86  }
87  });
88  }
89 
90  armem::MemoryID segmentID;
91  segmentID.memoryName = workingMemory->name();
92  segmentID.coreSegmentName = input.coreSegmentName;
93  segmentID.providerSegmentName = input.providerSegmentName;
94 
95  output.success = true;
96  output.segmentID = segmentID.str();
97  return output;
98  }
99 
100  data::AddSegmentsResult
101  MemoryToIceAdapter::addSegments(const data::AddSegmentsInput& input, bool addCoreSegments)
102  {
103  ARMARX_TRACE;
105 
106  data::AddSegmentsResult output;
107  for (const auto& i : input)
108  {
109  output.push_back(addSegment(i, addCoreSegments));
110  }
111  return output;
112  }
113 
114  data::CommitResult
115  MemoryToIceAdapter::commit(const data::Commit& commitIce, Time timeArrived)
116  {
117  ARMARX_TRACE;
119  auto handleException = [](const std::string& what)
120  {
121  data::CommitResult result;
122  data::EntityUpdateResult& r = result.results.emplace_back();
123  r.success = false;
124  r.errorMessage = what;
125  return result;
126  };
127 
129  try
130  {
131  ::armarx::armem::fromIce(commitIce, commit, timeArrived);
132  }
133  catch (const aron::error::AronNotValidException& e)
134  {
135  throw;
136  return handleException(e.what());
137  }
138  catch (const Ice::Exception& e)
139  {
140  throw;
141  return handleException(e.what());
142  }
143 
144  armem::CommitResult result = this->commit(commit);
145  data::CommitResult resultIce;
146  toIce(resultIce, result);
147 
148  return resultIce;
149  }
150 
151  data::CommitResult
152  MemoryToIceAdapter::commit(const data::Commit& commitIce)
153  {
154  ARMARX_TRACE;
155  return commit(commitIce, armem::Time::Now());
156  }
157 
160  {
161  ARMARX_TRACE;
162  return this->_commit(commit, false);
163  }
164 
165  data::CommitResult
166  MemoryToIceAdapter::commitLocking(const data::Commit& commitIce, Time timeArrived)
167  {
168  ARMARX_TRACE;
170  auto handleException = [](const std::string& what)
171  {
172  data::CommitResult result;
173  data::EntityUpdateResult& r = result.results.emplace_back();
174  r.success = false;
175  r.errorMessage = what;
176  return result;
177  };
178 
180  try
181  {
182  ::armarx::armem::fromIce(commitIce, commit, timeArrived);
183  }
184  catch (const aron::error::AronNotValidException& e)
185  {
186  throw;
187  return handleException(e.what());
188  }
189  catch (const Ice::Exception& e)
190  {
191  throw;
192  return handleException(e.what());
193  }
194 
195  armem::CommitResult result = this->commitLocking(commit);
196  data::CommitResult resultIce;
197  toIce(resultIce, result);
198 
199  return resultIce;
200  }
201 
202  data::CommitResult
203  MemoryToIceAdapter::commitLocking(const data::Commit& commitIce)
204  {
205  ARMARX_TRACE;
206  return commitLocking(commitIce, armem::Time::Now());
207  }
208 
211  {
212  ARMARX_TRACE;
213  return this->_commit(commit, true);
214  }
215 
217  MemoryToIceAdapter::_commit(const armem::Commit& commit, bool locking)
218  {
219  ARMARX_TRACE;
220  std::vector<data::MemoryID> updatedIDs;
221  const bool publishUpdates = bool(memoryListenerTopic);
222 
223  CommitResult commitResult;
224  for (const EntityUpdate& update : commit.updates)
225  {
226  EntityUpdateResult& result = commitResult.results.emplace_back();
227  try
228  {
229  auto updateResult =
231 
232  result.success = true;
233  result.snapshotID = updateResult.id;
234  result.arrivedTime = update.arrivedTime;
235 
236  for (const auto& snapshot : updateResult.removedSnapshots)
237  {
238  ARMARX_DEBUG << "The id " << snapshot.id() << " was removed from wm";
239  }
240 
241 
242  // Consollidate to ltm(s)
244  {
245  // convert removedSnapshots to Memory
247  armem::wm::toMemory(m, *workingMemory, updateResult.removedSnapshots);
248  //this removes information about segments, because new memory (wm) is used
249 
250  // store memory
251  longtermMemory->store(m);
252  }
253 
254  if (publishUpdates)
255  {
256  data::MemoryID& id = updatedIDs.emplace_back();
257  toIce(id, result.snapshotID);
258  }
259  }
260  catch (const error::ArMemError& e)
261  {
262  result.success = false;
263  result.errorMessage = e.what();
264  }
265  catch (const aron::error::AronException& e)
266  {
267  result.success = false;
268  result.errorMessage = e.what();
269  }
270  catch (const Ice::Exception& e)
271  {
272  result.success = false;
273  result.errorMessage = e.what();
274  }
275  catch (...)
276  {
277  ARMARX_INFO << "Error during LTM consollidation";
278  }
279  }
280 
281  if (publishUpdates)
282  {
283  memoryListenerTopic->memoryUpdated(updatedIDs);
284  }
285 
286  return commitResult;
287  }
288 
289  // READING
290  armem::query::data::Result
291  MemoryToIceAdapter::query(const armem::query::data::Input& input)
292  {
293  ARMARX_TRACE;
296 
297  // Core segment processors will aquire the core segment locks.
300  armem::wm::Memory wmResult = wmServerProcessor.process(input, *workingMemory);
301 
302  armem::query::data::Result result;
303 
304  /*query_proc::ltm_server::MemoryQueryProcessor ltmProcessor;
305  armem::wm::Memory ltmResult = ltmProcessor.process(input, *longtermMemory);
306 
307  if (not ltmResult.empty())
308  {
309 
310  // convert memory ==> meaning resolving references
311  // upon query, the LTM only returns a structure of the data (memory without data)
312  longtermMemory->resolve(ltmResult);
313 
314  // append result to return memory and sanity check
315  wmResult.append(ltmResult);
316  ARMARX_CHECK(not wmResult.empty());
317 
318  // Ist das wirklich notwendig?
319  // query again to limit output size (TODO: Skip if querytype is all)
320  //auto queryInput = armem::client::QueryInput::fromIce(input);
321  //query_proc::wm::MemoryQueryProcessor wm2wmProcessor(armem::query::boolToDataMode(input.withData));
322  //wmResult = wm2wmProcessor.process(queryInput.toIce(), wmResult);
323  //if (wmResult.empty())
324  //{
325  // ARMARX_ERROR << "A merged and postprocessed Memory has no data although at least the LTM result contains data. This indicates that something is wrong.";
326  //}
327 
328  if (longtermMemory->isRecording())
329  {
330  // TODO: also move results of ltm to wm
331  //this->commit(toCommit(ltm_converted));
332 
333  // mark removed entries of wm in viewer
334  // TODO
335  }
336  }*/
337 
338  result.memory = armarx::toIce<data::MemoryPtr>(wmResult);
339 
340  result.success = true;
341  if (result.memory->coreSegments.size() == 0)
342  {
343  ARMARX_DEBUG << "No data in memory found after query.";
344  }
345 
346  return result;
347  }
348 
351  {
352  ARMARX_TRACE;
353  return client::QueryResult::fromIce(query(input.toIce()));
354  }
355 
356  armem::structure::data::GetServerStructureResult
358  {
359  ARMARX_TRACE;
362 
363  armem::structure::data::GetServerStructureResult ret;
364  ret.success = true;
365 
366  wm::Memory structure;
367  structure.id() = workingMemory->id();
368 
369  // Get all info from the WM
371  builder.all();
372  auto query_result = this->query(builder.buildQueryInput());
373  if (query_result.success)
374  {
375  structure.append(query_result.memory);
376  }
377 
378  // Get all info from the LTM
380 
381  ret.serverStructure = armarx::toIce<data::MemoryPtr>(structure);
382 
383  return ret;
384  }
385 
386  // WM LOADING FROM LTM
389  {
390  if(this->longtermMemory->p.importOnStartUp){
391  ARMARX_INFO << "Reloading of data from LTM into WM triggered";
392  //define which core segments to load and how many snapshots:
393  auto coreNames = this->longtermMemory->p.coreSegmentsToLoad;
394  //convert string to list of names:
395  std::list<std::string> names;
396  std::stringstream ss(coreNames);
397  std::string item;
398 
399  while (std::getline(ss, item, ',')) {
400  names.push_back(item);
401  }
402  int maxAmountOfSnapshots = this->longtermMemory->p.maxAmountOfSnapshotsLoaded;
403  //create WM and load latest references
405  this->longtermMemory->loadLatestNReferences(maxAmountOfSnapshots, m, names);
406  ARMARX_DEBUG << "After loading";
407  //construct a commit of the loaded data and commit it to the working memory
408  auto com = armem::toCommit(m);
409  auto res = this->commit(com);
410  ARMARX_DEBUG << "After commit";
411  //the CommitResult contains some information which might be helpful:
412  return res;
413  } else {
414  ARMARX_INFO << "Not loading initial data from LTM due to importOnStartup being " << this->longtermMemory->p.importOnStartUp;
416  return r;
417  }
418 
419  }
420 
421  // LTM STORING AND RECORDING
422  dto::DirectlyStoreResult
423  MemoryToIceAdapter::directlyStore(const dto::DirectlyStoreInput& directlStoreInput)
424  {
425  ARMARX_TRACE;
427 
428  dto::DirectlyStoreResult output;
429  output.success = true;
430 
431  armem::wm::Memory m = armarx::fromIce<armem::wm::Memory>(directlStoreInput.memory);
433 
434  return output;
435  }
436 
437  dto::StartRecordResult
438  MemoryToIceAdapter::startRecord(const dto::StartRecordInput& startRecordInput)
439  {
440  ARMARX_TRACE;
442  ARMARX_IMPORTANT << "Enabling the recording of memory " << longtermMemory->id().str();
444 
445  dto::StartRecordResult ret;
446  ret.success = true;
447 
448  return ret;
449  }
450 
451  dto::StopRecordResult
453  {
454  ARMARX_TRACE;
456  ARMARX_IMPORTANT << "Disabling the recording of memory " << longtermMemory->id().str();
457 
458  //put calling stopRecording into a seperate thread and detach to make sure GUI does not freeze
459  auto ltm = longtermMemory;
460  std::thread stopRecordingThread([&ltm](){
461  ltm->stopRecording();
462  });
463  std::thread savingDataUpdateThread([&ltm](){
464  ltm->bufferFinished();
465  });
466  stopRecordingThread.detach();
467  savingDataUpdateThread.detach();
468 
470  << "Stopped all LTM recordings, please wait with stopping the component until "
471  "all files are written";
472 
473  dto::StopRecordResult ret;
474  ret.success = true;
475 
476  return ret;
477  }
478 
479  dto::RecordStatusResult
481  {
482  dto::RecordStatusResult ret;
483  ret.success = true;
484 
485  long savedSnapshots;
486  long totalSnapshots;
488  [&savedSnapshots, &totalSnapshots](const auto& c)
489  {
490  c.forEachProviderSegment(
491  [&savedSnapshots, &totalSnapshots](const auto& p)
492  {
493  p.forEachEntity(
494  [&savedSnapshots, &totalSnapshots](const auto& e)
495  {
496  savedSnapshots += e.getStatistics().recordedSnapshots;
497 
498  e.forEachSnapshot([&totalSnapshots](const auto&)
499  { totalSnapshots++; });
500  });
501  });
502  });
503 
504  ret.status.savedSnapshots = savedSnapshots;
505  ret.status.totalSnapshots = totalSnapshots;
506 
507  return ret;
508  }
509 
510  // PREDICTION
511  prediction::data::PredictionResultSeq
512  MemoryToIceAdapter::predict(prediction::data::PredictionRequestSeq requests)
513  {
515  armarx::fromIce<std::vector<PredictionRequest>>(requests));
516  return armarx::toIce<prediction::data::PredictionResultSeq>(res);
517  }
518 
519  prediction::data::EngineSupportMap
521  {
522  prediction::data::EngineSupportMap result;
524 
525  // Uncomment once LTM also supports prediction engines.
526 
527  /*prediction::data::EngineSupportMap ltmMap;
528  armarx::toIce(ltmMap, longtermMemory->getAllPredictionEngines());
529  for (const auto& [memoryID, engines] : ltmMap)
530  {
531  auto entryIter = result.find(memoryID);
532  if (entryIter == result.end())
533  {
534  result.emplace(memoryID, engines);
535  }
536  else
537  {
538  // Merge LTM-supported engines with WM-supported engines, removing duplicates
539  std::set<prediction::data::PredictionEngine> engineSet;
540  engineSet.insert(entryIter->second.begin(), entryIter->second.end());
541  engineSet.insert(engines.begin(), engines.end());
542  entryIter->second.assign(engineSet.begin(), engineSet.end());
543  }
544  }*/
545 
546  return result;
547  }
548 
549 } // namespace armarx::armem::server
armarx::armem::server::MemoryToIceAdapter::workingMemory
server::wm::Memory * workingMemory
Definition: MemoryToIceAdapter.h:65
armarx::armem::server::ltm::detail::MemoryBase::isRecording
bool isRecording() const
Definition: MemoryBase.h:261
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
memory_conversions.h
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::armem::MemoryID::providerSegmentName
std::string providerSegmentName
Definition: MemoryID.h:52
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::armem::client::query::Builder::buildQueryInput
QueryInput buildQueryInput() const
Definition: Builder.cpp:11
armarx::core::time::DateTime::Now
static DateTime Now()
Definition: DateTime.cpp:55
armarx::armem::EntityUpdateResult
Result of an EntityUpdate.
Definition: Commit.h:72
armarx::armem::server::ltm::detail::MemoryBase::Properties::coreSegmentsToLoad
std::string coreSegmentsToLoad
Definition: MemoryBase.h:359
armarx::armem::server::MemoryToIceAdapter::longtermMemory
server::ltm::Memory * longtermMemory
Definition: MemoryToIceAdapter.h:66
armarx::armem::EntityUpdateResult::arrivedTime
Time arrivedTime
Definition: Commit.h:77
armarx::armem::base::MemoryBase::getCoreSegment
CoreSegmentT & getCoreSegment(const std::string &name)
Definition: MemoryBase.h:132
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::armem::server::MemoryToIceAdapter::startRecord
dto::StartRecordResult startRecord(const dto::StartRecordInput &startRecordInput)
Definition: MemoryToIceAdapter.cpp:438
armarx::armem::server::MemoryToIceAdapter::memoryListenerTopic
client::MemoryListenerInterfacePrx memoryListenerTopic
Definition: MemoryToIceAdapter.h:68
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::wm::toMemory
void toMemory(Memory &m, const std::vector< CoreSegment > &e)
Definition: memory_conversions.cpp:6
armarx::armem::toIce
void toIce(data::MemoryID &ice, const MemoryID &id)
Definition: ice_conversions.cpp:21
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::armem::server::ltm::detail::MemoryBase::Properties::importOnStartUp
bool importOnStartUp
Definition: MemoryBase.h:357
armarx::armem::query::boolToDataMode
DataMode boolToDataMode(bool withData)
Definition: DataMode.cpp:5
armarx::armem::base::MemoryBase::name
std::string & name()
Definition: MemoryBase.h:92
armarx::armem::server::ltm::detail::MemoryBase::p
struct armarx::armem::server::ltm::detail::MemoryBase::Properties p
ice_conversions.h
ltm.h
armarx::armem::client::QueryResult
Result of a QueryInput.
Definition: Query.h:50
armarx::armem::server::query_proc::wm_server::MemoryQueryProcessor
Definition: wm.h:195
armarx::armem::MemoryID::coreSegmentName
std::string coreSegmentName
Definition: MemoryID.h:51
armarx::armem::server::MemoryToIceAdapter::predict
prediction::data::PredictionResultSeq predict(prediction::data::PredictionRequestSeq requests)
Definition: MemoryToIceAdapter.cpp:512
armarx::armem::server::MemoryToIceAdapter::getServerStructure
armem::structure::data::GetServerStructureResult getServerStructure()
Definition: MemoryToIceAdapter.cpp:357
armarx::armem::server::ltm::Memory
A memory storing data on the hard drive and in mongodb (needs 'armarx memory start' to start the mong...
Definition: Memory.h:19
armarx::toIce
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
Definition: ice_conversions_boost_templates.h:15
armarx::armem::server::MemoryToIceAdapter::reloadFromLTM
armem::CommitResult reloadFromLTM()
Definition: MemoryToIceAdapter.cpp:388
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::armem::server::MemoryToIceAdapter::setMemoryListener
void setMemoryListener(client::MemoryListenerInterfacePrx memoryListenerTopic)
Definition: MemoryToIceAdapter.cpp:34
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::server::query_proc::base::MemoryQueryProcessorBase::process
ResultMemoryT process(const armem::query::data::Input &input, const MemoryT &memory) const
Definition: MemoryQueryProcessorBase.h:43
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::base::detail::PredictiveContainer::getAllPredictionEngines
std::map< MemoryID, std::vector< PredictionEngine > > getAllPredictionEngines() const
Definition: Predictive.h:99
armarx::core::eigen::fromIce
void fromIce(Eigen::Vector2f &e, const Ice::FloatSeq &ice)
Definition: ice_conversions.cpp:10
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::armem::server::ltm::detail::MemoryBase::loadLatestNReferences
armem::wm::Memory loadLatestNReferences(int n)
Definition: MemoryBase.h:141
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
error.h
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
armarx::armem::server::ltm::detail::MemoryBase::Properties::maxAmountOfSnapshotsLoaded
int maxAmountOfSnapshotsLoaded
Definition: MemoryBase.h:358
wm.h
armarx::aron::error::AronNotValidException
The AronNotValidException class.
Definition: Exception.h:102
armarx::armem::EntityUpdate
An update of an entity for a specific point in time.
Definition: Commit.h:27
armarx::armem::CommitResult
Result of a Commit.
Definition: Commit.h:110
ice_conversions.h
armarx::armem::base::MemoryBase::addCoreSegment
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
Definition: MemoryBase.h:259
armarx::armem::server::ltm::Memory::forEachCoreSegment
bool forEachCoreSegment(std::function< void(CoreSegment &)> func) const final
iterate over all core segments of this ltm
Definition: Memory.cpp:82
armarx::armem::server::MemoryToIceAdapter::getRecordStatus
dto::RecordStatusResult getRecordStatus()
Definition: MemoryToIceAdapter.cpp:480
armarx::armem::base::detail::MemoryItem::id
MemoryID & id()
Definition: MemoryItem.h:27
armarx::armem::server::wm::CoreSegment::doLocked
auto doLocked(FunctionT &&function) const
Definition: memory_definitions.h:120
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::armem::EntityUpdateResult::snapshotID
MemoryID snapshotID
Definition: Commit.h:76
armarx::armem::server::ltm::detail::MemoryBase::startRecording
void startRecording()
enable/disable
Definition: MemoryBase.h:246
MemoryToIceAdapter.h
armarx::armem::server::MemoryToIceAdapter::getAvailableEngines
prediction::data::EngineSupportMap getAvailableEngines()
Definition: MemoryToIceAdapter.cpp:520
ice_conversions.h
armarx::armem::server::MemoryToIceAdapter::stopRecord
dto::StopRecordResult stopRecord()
Definition: MemoryToIceAdapter.cpp:452
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::memoryName
std::string memoryName
Definition: MemoryID.h:50
armarx::armem::server
Definition: GraspMemory.cpp:19
armarx::armem::server::MemoryToIceAdapter::directlyStore
dto::DirectlyStoreResult directlyStore(const dto::DirectlyStoreInput &directlStoreInput)
Definition: MemoryToIceAdapter.cpp:423
ExpressionException.h
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:86
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::server::MemoryToIceAdapter::addSegment
data::AddSegmentResult addSegment(const data::AddSegmentInput &input, bool addCoreSegments=false)
Definition: MemoryToIceAdapter.cpp:41
Exception.h
armarx::armem::server::ltm::detail::MemoryItem::id
MemoryID id() const
Definition: MemoryItem.cpp:37
armarx::viz::data::ElementFlags::names
const simox::meta::IntEnumNames names
Definition: json_elements.cpp:14
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::armem::server::ltm::detail::MemoryBase::loadAllReferences
armem::wm::Memory loadAllReferences()
return the full ltm as a wm::Memory with only references the ltm may be huge, use with caution
Definition: MemoryBase.h:123
armarx::armem::CommitResult::results
std::vector< EntityUpdateResult > results
Definition: Commit.h:112
armarx::armem::server::MemoryToIceAdapter::addSegments
data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, bool addCoreSegments=false)
Definition: MemoryToIceAdapter.cpp:101
armarx::armem::server::MemoryToIceAdapter::MemoryToIceAdapter
MemoryToIceAdapter(server::wm::Memory *workingMemory=nullptr, server::ltm::Memory *longtermMemory=nullptr)
Construct an MemoryToIceAdapter from an existing Memory.
Definition: MemoryToIceAdapter.cpp:27
armarx::armem::query::DataMode::NoData
@ NoData
Just get the structure, but no ARON data.
Builder.h
armarx::armem::base::MemoryBase::append
void append(const OtherDerivedT &other)
Merge another memory into this one.
Definition: MemoryBase.h:347
armarx::armem::EntityUpdateResult::errorMessage
std::string errorMessage
Definition: Commit.h:79
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::server::wm::detail::PredictionContainer::dispatchPredictions
std::vector< PredictionResult > dispatchPredictions(const std::vector< PredictionRequest > &requests)
Definition: Prediction.h:169
armarx::armem::base::MemoryBase::update
std::vector< UpdateResult > update(const Commit &commit, const bool addMissingCoreSegmentDuringUpdate=false, const bool checkMemoryName=true)
Store all updates in commit.
Definition: MemoryBase.h:297
armarx::armem::error::ContainerEntryAlreadyExists
Indicates that a name in a given ID does not match a container's own name.
Definition: ArMemError.h:57
Logging.h
armarx::armem::client::query::Builder::all
void all()
Get all snapshots from all entities in all segments.
Definition: Builder.cpp:49
armarx::armem::server::wm::CoreSegment::addProviderSegment
ProviderSegment & addProviderSegment(const std::string &name, Args... args)
Definition: memory_definitions.h:101
armarx::armem::server::wm::Memory::updateLocking
std::vector< Base::UpdateResult > updateLocking(const Commit &commit)
Perform the commit, locking the core segments.
Definition: memory_definitions.cpp:51
armarx::armem::client::QueryResult::fromIce
static QueryResult fromIce(const armem::query::data::Result &ice)
Definition: Query.cpp:25
armarx::armem::EntityUpdateResult::success
bool success
Definition: Commit.h:74
armarx::armem::toCommit
Commit toCommit(const ContainerT &container)
Definition: operations.h:27
armarx::armem::server::MemoryToIceAdapter::commitLocking
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:166
armarx::armem::server::MemoryToIceAdapter::commit
data::CommitResult commit(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:115
ice_conversions.h
armarx::armem::error::MissingEntry
Indicates that a container did not have an entry under a given name.
Definition: ArMemError.h:74
armarx::armem::server::MemoryToIceAdapter::query
query::data::Result query(const armem::query::data::Input &input)
Definition: MemoryToIceAdapter.cpp:291
armarx::armem::server::ltm::detail::MemoryBase::store
void store(const armem::wm::Memory &memory)
append a wm::Memory instance to the ltm
Definition: MemoryBase.h:195
armarx::armem::server::ltm::detail::mixin::BufferedMemoryMixin::directlyStore
void directlyStore(const armem::wm::Memory &memory)
Definition: BufferedMemoryMixin.h:31
armarx::armem::server::ltm::detail::MemoryItem::name
std::string name() const
Definition: MemoryItem.cpp:43
armarx::human::MemoryID
const armem::MemoryID MemoryID
Definition: memory_ids.cpp:29