Skip to content
Snippets Groups Projects
Commit 3bacc924 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Minor style changes

parent 53802ef9
No related branches found
No related tags found
1 merge request!210Resolve "ArMem Servers + Viewer: Add general framework to allow visualization and other operations triggered by Viewer"
......@@ -29,6 +29,7 @@
#include <RobotAPI/libraries/armem/core/error.h>
#include <RobotAPI/libraries/armem/core/ice_conversions.h>
#include <RobotAPI/libraries/armem/server/MemoryRemoteGui.h>
#include <RobotAPI/libraries/armem/core/ice_conversions_templates.h>
#include <RobotAPI/components/armem/server/ExampleMemory/aron/ExampleData.aron.generated.h>
......@@ -152,7 +153,7 @@ namespace armarx
ExecuteActionOutputSeq output;
for (const auto& [id, path] : input)
{
auto memoryID = armem::fromIce<armem::MemoryID>(id);
armem::MemoryID memoryID = armem::fromIce<armem::MemoryID>(id);
if (path == ActionPath{"hi"})
{
ARMARX_INFO << "Hello, " << memoryID.str() << "!";
......@@ -163,7 +164,7 @@ namespace armarx
ARMARX_WARNING << "Alas, I am gravely wounded!";
output.emplace_back(false, "Why would you do that to him?");
}
else if (path.front() == "four" && path.back() == "null")
else if (not path.empty() and path.front() == "four" and path.back() == "null")
{
// Do nothing.
ARMARX_INFO << "Nested action (path: " << path << ")";
......@@ -183,8 +184,7 @@ namespace armarx
update.instancesData = { instance->data() };
armem::Commit newCommit;
newCommit.add(update);
ReadWritePluginUser::commit(armem::toIce<armem::data::Commit>(newCommit));
this->commit(armem::toIce<armem::data::Commit>(newCommit));
tab.rebuild = true;
ARMARX_INFO << "Duplicated " << memoryID;
......
......@@ -58,7 +58,7 @@ namespace armarx
// WritingInterface interface
public:
armem::data::AddSegmentsResult addSegments(const armem::data::AddSegmentsInput& input, const Ice::Current&) override;
armem::data::CommitResult commit(const armem::data::Commit& commit, const Ice::Current&) override;
armem::data::CommitResult commit(const armem::data::Commit& commit, const Ice::Current& = Ice::emptyCurrent) override;
// LightweightRemoteGuiComponentPluginUser interface
......
......@@ -156,15 +156,16 @@ namespace armarx::armem::server::obj
{
}
armem::actions::GetActionsOutputSeq ObjectMemory::getActions(const armem::actions::GetActionsInputSeq& inputs)
armem::actions::GetActionsOutputSeq ObjectMemory::getActions(
const armem::actions::GetActionsInputSeq& inputs)
{
using namespace armem::actions;
GetActionsOutputSeq outputs;
for (const auto& input : inputs)
{
auto memoryID = fromIce<armem::MemoryID>(input.id);
if (armem::contains(armem::MemoryID::fromString("Object/Class"), memoryID) &&
!memoryID.hasGap() && memoryID.hasEntityName())
if (armem::contains(armem::MemoryID("Object", "Class"), memoryID)
and memoryID.hasEntityName() and not memoryID.hasGap())
{
Menu menu {
Action{"vis", "Visualize object"},
......@@ -177,7 +178,8 @@ namespace armarx::armem::server::obj
return outputs;
}
armem::actions::ExecuteActionOutputSeq ObjectMemory::executeActions(const armem::actions::ExecuteActionInputSeq& inputs)
armem::actions::ExecuteActionOutputSeq ObjectMemory::executeActions(
const armem::actions::ExecuteActionInputSeq& inputs)
{
using namespace armem::actions;
ExecuteActionOutputSeq outputs;
......@@ -187,8 +189,8 @@ namespace armarx::armem::server::obj
auto memoryID = fromIce<armem::MemoryID>(input.id);
if (input.actionPath == ActionPath{"vis"})
{
if (armem::contains(armem::MemoryID::fromString("Object/Class"), memoryID) &&
!memoryID.hasGap() && memoryID.hasEntityName())
if (armem::contains(armem::MemoryID("Object", "Class"), memoryID)
and memoryID.hasEntityName() and not memoryID.hasGap())
{
classSegment.visualizeClass(memoryID);
outputs.emplace_back(true, "");
......@@ -204,7 +206,7 @@ namespace armarx::armem::server::obj
else
{
std::stringstream sstream;
sstream << "Action path " << input.actionPath << "is not defined.";
sstream << "Action path " << input.actionPath << " is not defined.";
outputs.emplace_back(false, sstream.str());
}
}
......
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