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

Add a memory link in the example memory

parent af2f811c
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@
#include <RobotAPI/libraries/armem/client/query/Builder.h>
#include <RobotAPI/libraries/armem/client/query/query_fns.h>
#include <RobotAPI/libraries/armem/core/error.h>
#include <RobotAPI/libraries/armem/core/aron_conversions.h>
#include <RobotAPI/libraries/armem/core/workingmemory/ice_conversions.h>
#include <RobotAPI/components/armem/server/ExampleMemory/aron/ExampleData.aron.generated.h>
......@@ -410,6 +411,28 @@ namespace armarx
{
ARMARX_WARNING << commitResult.allErrorMessages();
}
// Commit another entity with a link to the_answer
{
armem::Commit commit;
{
armem::EntityUpdate& update = commit.updates.emplace_back();
update.entityID = providerID.withEntityName("link to the_answer");
update.timeCreated = time;
armem::example::ExampleData data;
const armem::MemoryID snapshotID = armem::fromIce<armem::MemoryID>(commitResult.results.at(1).snapshotID);
armem::toAron(data.memoryLink, snapshotID);
update.instancesData = { data.toAron() };
}
armem::CommitResult commitResult = memoryWriter.commit(commit);
if (!commitResult.allSuccess())
{
ARMARX_WARNING << commitResult.allErrorMessages();
}
}
}
void ExampleMemoryClient::queryExampleData()
......
<!--Some fancy comment -->
<?xml version="1.0" encoding="UTF-8" ?>
<AronTypeDefinition>
<CodeIncludes>
<Include include="<Eigen/Core>" />
<Include include="<Image/ByteImage.h>" />
<Include include="<RobotAPI/libraries/armem/aron/MemoryID.aron.generated.h>" />
</CodeIncludes>
<AronIncludes>
<Include include="<RobotAPI/libraries/armem/aron/MemoryID.xml>" />
</AronIncludes>
<GenerateTypes>
<Object name='armarx::armem::example::ExampleData'>
<ObjectChild key='the_int'>
<Int />
</ObjectChild>
......@@ -79,6 +87,11 @@
</Dict>
</ObjectChild>
<ObjectChild key="memoryLink">
<armarx::armem::arondto::MemoryID />
</ObjectChild>
</Object>
</GenerateTypes>
</AronTypeDefinition>
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