Skip to content
Snippets Groups Projects
Commit f1bd96ef authored by Christian Dreher's avatar Christian Dreher
Browse files

feature: Add dummy code to subscribe to entities (not working).

parent 53509eee
No related branches found
No related tags found
3 merge requests!102ArMem Memory Updates,!100Memory QueryBuilder,!99Memory subscriptions
......@@ -115,6 +115,12 @@ namespace armarx
armem::MemoryID entityID = providerID;
entityID.entityName = "example_entity";
// Subscribe to example_entity updates
memoryReader.subscribe(entityID, [&](const armem::MemoryID & sid, const std::vector<armem::MemoryID>& sids)
{
example_entityUpdated(sid);
});
armem::MemoryID snapshotID;
{
armem::Commit commit;
......@@ -279,6 +285,13 @@ namespace armarx
}
void ArMemExampleClient::example_entityUpdated(const armem::MemoryID& id)
{
ARMARX_IMPORTANT << "example_entity got updated";
// Fetch new data of example_entity and do something with it.
}
bool ArMemExampleClient::primitives(armem::Writer& writer)
{
ARMARX_IMPORTANT << "Adding segment " << "Primitive" << "/" << getName();
......
......@@ -63,9 +63,9 @@ namespace armarx
* Detailed description of class ArMemExampleClient.
*/
class ArMemExampleClient :
virtual public armarx::Component
, virtual public armarx::armem::client::ComponentPluginUser
, virtual public LightweightRemoteGuiComponentPluginUser
virtual public armarx::Component,
virtual public armarx::armem::client::ComponentPluginUser,
virtual public LightweightRemoteGuiComponentPluginUser
{
public:
......@@ -98,6 +98,10 @@ namespace armarx
private:
// Callback for updates on `example_entity`.
void example_entityUpdated(const armem::MemoryID& id);
// Examples
bool primitives(armem::Writer& writer);
......
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