Skip to content
Snippets Groups Projects

Draft: Make RobotStateMemory ready

Merged Rainer Kartmann requested to merge armem/robot-state-memory into master
2 files
+ 7
6
Compare changes
  • Side-by-side
  • Inline
Files
2
#include "ComponentPlugin.h"
#include <ArmarXCore/core/Component.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <RobotAPI/libraries/armem/core/error.h>
@@ -11,8 +12,7 @@
namespace armarx::armem::server::plugins
{
ComponentPlugin::~ComponentPlugin()
{}
ComponentPlugin::~ComponentPlugin() = default;
void ComponentPlugin::postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties)
@@ -118,6 +118,8 @@ namespace armarx::armem::server
addPlugin(plugin);
}
ComponentPluginUser::~ComponentPluginUser() = default;
// WRITING
data::AddSegmentsResult ComponentPluginUser::addSegments(const data::AddSegmentsInput& input, const Ice::Current&)
@@ -128,7 +130,7 @@ namespace armarx::armem::server
data::AddSegmentsResult ComponentPluginUser::addSegments(const data::AddSegmentsInput& input, bool addCoreSegments)
{
std::scoped_lock lock(workingMemoryMutex);
// std::scoped_lock lock(workingMemoryMutex);
data::AddSegmentsResult result = iceMemory.addSegments(input, addCoreSegments);
return result;
}
@@ -136,7 +138,7 @@ namespace armarx::armem::server
data::CommitResult ComponentPluginUser::commit(const data::Commit& commitIce, const Ice::Current&)
{
std::scoped_lock lock(workingMemoryMutex);
// std::scoped_lock lock(workingMemoryMutex);
return iceMemory.commit(commitIce);
}
@@ -144,19 +146,20 @@ namespace armarx::armem::server
// READING
armem::query::data::Result ComponentPluginUser::query(const armem::query::data::Input& input, const Ice::Current&)
{
std::scoped_lock lock(workingMemoryMutex);
// std::scoped_lock lock(workingMemoryMutex);
return iceMemory.query(input);
}
// LTM LOADING
// LTM STORING
data::StoreResult ComponentPluginUser::store(const data::StoreInput& input, const Ice::Current&)
{
std::scoped_lock lock(workingMemoryMutex, longtermMemoryMutex);
std::scoped_lock lock(/*workingMemoryMutex,*/ longtermMemoryMutex);
return iceMemory.store(input);
}
// LTM STORING
// LTM LOADING
armem::query::data::Result ComponentPluginUser::load(const armem::query::data::Input& input, const Ice::Current&)
{
std::scoped_lock lock(longtermMemoryMutex);
Loading