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

Tweak example

parent ed7fbd46
No related branches found
No related tags found
2 merge requests!102ArMem Memory Updates,!100Memory QueryBuilder
......@@ -79,9 +79,12 @@ namespace armarx
entityID = providerID.withEntityName("example_entity");
// Subscribe to example_entity updates
memoryReader.subscribe(entityID, [&](const armem::MemoryID & sid, const std::vector<armem::MemoryID>& sids)
memoryReader.subscribe(entityID, [&](
const armem::MemoryID & entityID,
const std::vector<armem::MemoryID>& snapshotIDs)
{
example_entityUpdated(sid);
(void) snapshotIDs;
example_entityUpdated(entityID);
});
task = new RunningTask<ArMemExampleClient>(this, &ArMemExampleClient::run);
......@@ -123,6 +126,13 @@ namespace armarx
commitPrimitives(writer);
queryPrimitives(reader);
}
CycleUtil c(500);
while (!task->isStopped())
{
commitSingleSnapshot(writer, entityID);
c.waitForCycleDuration();
}
}
......@@ -232,7 +242,7 @@ namespace armarx
void ArMemExampleClient::example_entityUpdated(const armem::MemoryID& id)
{
ARMARX_IMPORTANT << "example_entity got updated: " << id;
ARMARX_IMPORTANT << "############### example_entity got updated: " << id << " ##################";
// Fetch new data of example_entity and do something with it.
}
......
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