|
Handles update signals from the memory system and distributes it to its subsribers. More...
#include <RobotAPI/libraries/armem/client/util/MemoryListener.h>
Public Types | |
using | Callback = std::function< void(const MemoryID &subscriptionID, const std::vector< MemoryID > &updatedSnapshotIDs)> |
using | CallbackUpdatedOnly = std::function< void(const std::vector< MemoryID > &updatedSnapshotIDs)> |
template<class CalleeT > | |
using | MemberCallback = void(CalleeT::*)(const MemoryID &subscriptionID, const std::vector< MemoryID > &updatedSnapshotIDs) |
template<class CalleeT > | |
using | MemberCallbackUpdatedOnly = void(CalleeT::*)(const std::vector< MemoryID > &updatedSnapshotIDs) |
Public Member Functions | |
MemoryListener (ManagedIceObject *component=nullptr) | |
void | setComponent (ManagedIceObject *component) |
void | subscribe (const MemoryID &subscriptionID, Callback Callback) |
void | subscribe (const MemoryID &subscriptionID, CallbackUpdatedOnly Callback) |
template<class CalleeT > | |
void | subscribe (const MemoryID &subscriptionID, CalleeT *callee, MemberCallback< CalleeT > callback) |
Subscribe with a class member function: More... | |
template<class CalleeT > | |
void | subscribe (const MemoryID &subscriptionID, CalleeT *callee, MemberCallbackUpdatedOnly< CalleeT > callback) |
void | updated (const std::vector< data::MemoryID > &updatedIDs) const |
void | updated (const std::vector< MemoryID > &updatedIDs) const |
Function handling updates from the MemoryListener ice topic. More... | |
Static Public Member Functions | |
static std::string | MakeMemoryTopicName (const MemoryID &memoryID) |
Protected Attributes | |
std::unordered_map< MemoryID, std::vector< Callback > > | callbacks |
Handles update signals from the memory system and distributes it to its subsribers.
Definition at line 27 of file MemoryListener.h.
using Callback = std::function<void(const MemoryID& subscriptionID, const std::vector<MemoryID>& updatedSnapshotIDs)> |
Definition at line 31 of file MemoryListener.h.
using CallbackUpdatedOnly = std::function<void(const std::vector<MemoryID>& updatedSnapshotIDs)> |
Definition at line 32 of file MemoryListener.h.
using MemberCallback = void(CalleeT::*)(const MemoryID& subscriptionID, const std::vector<MemoryID>& updatedSnapshotIDs) |
Definition at line 35 of file MemoryListener.h.
using MemberCallbackUpdatedOnly = void(CalleeT::*)(const std::vector<MemoryID>& updatedSnapshotIDs) |
Definition at line 37 of file MemoryListener.h.
MemoryListener | ( | ManagedIceObject * | component = nullptr | ) |
Definition at line 23 of file MemoryListener.cpp.
|
static |
void setComponent | ( | ManagedIceObject * | component | ) |
Definition at line 123 of file MemoryListener.cpp.
void subscribe | ( | const MemoryID & | subscriptionID, |
CallbackUpdatedOnly | Callback | ||
) |
|
inline |
Subscribe with a class member function:
Definition at line 58 of file MemoryListener.h.
|
inline |
void updated | ( | const std::vector< data::MemoryID > & | updatedIDs | ) | const |
void updated | ( | const std::vector< MemoryID > & | updatedIDs | ) | const |
Function handling updates from the MemoryListener ice topic.
Definition at line 45 of file MemoryListener.cpp.
Definition at line 88 of file MemoryListener.h.