Go to the documentation of this file.
5 #include <unordered_map>
9 #include <RobotAPI/interface/armem/client/MemoryListenerInterface.h>
16 class ManagedIceObject;
30 const std::vector<MemoryID>& updatedSnapshotIDs)>;
32 std::function<void(
const std::vector<MemoryID>& updatedSnapshotIDs)>;
34 template <
class CalleeT>
36 const std::vector<MemoryID>& updatedSnapshotIDs);
37 template <
class CalleeT>
39 void (CalleeT::*)(
const std::vector<MemoryID>& updatedSnapshotIDs);
58 template <
class CalleeT>
62 auto cb = [callee, callback](
const MemoryID& subscriptionID,
63 const std::vector<MemoryID>& updatedSnapshotIDs)
64 { (callee->*callback)(subscriptionID, updatedSnapshotIDs); };
68 template <
class CalleeT>
75 [callee, callback](
const MemoryID&,
const std::vector<MemoryID>& updatedSnapshotIDs)
79 (callee->*callback)(updatedSnapshotIDs);
88 void updated(
const std::vector<MemoryID>& updatedIDs)
const;
89 void updated(
const std::vector<data::MemoryID>& updatedIDs)
const;
101 std::unordered_map<MemoryID, std::vector<ManagedCallback>>
callbacks;
void updated(const std::vector< MemoryID > &updatedIDs) const
Function handling updates from the MemoryListener ice topic.
std::unordered_map< MemoryID, std::vector< ManagedCallback > > callbacks
static std::string MakeMemoryTopicName(const MemoryID &memoryID)
void(CalleeT::*)(const MemoryID &subscriptionID, const std::vector< MemoryID > &updatedSnapshotIDs) MemberCallback
std::function< void(const MemoryID &subscriptionID, const std::vector< MemoryID > &updatedSnapshotIDs)> Callback
SubscriptionHandle subscribe(const MemoryID &subscriptionID, Callback Callback)
void(CalleeT::*)(const std::vector< MemoryID > &updatedSnapshotIDs) MemberCallbackUpdatedOnly
SubscriptionHandle subscribe(const MemoryID &subscriptionID, CalleeT *callee, MemberCallback< CalleeT > callback)
Subscribe with a class member function:
The ManagedIceObject is the base class for all ArmarX objects.
Handles update signals from the memory system and distributes it to its subsribers.
MemoryListener(ManagedIceObject *component=nullptr)
void setComponent(ManagedIceObject *component)
SubscriptionHandle subscribe(const MemoryID &subscriptionID, CalleeT *callee, MemberCallbackUpdatedOnly< CalleeT > callback)
void unsubscribe(SubscriptionHandle &subscriptionHandle)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::function< void(const std::vector< MemoryID > &updatedSnapshotIDs)> CallbackUpdatedOnly
std::unordered_map< std::string, int > memoryRefCount
memoryName -> callbacks needing memory topic