25 #include <ArmarXCore/interface/observers/ObserverInterface.h>
28 #include <ArmarXCore/interface/observers/VariantBase.h>
34 #include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
35 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
36 #include <MemoryX/interface/memorytypes/MemorySegments.h>
37 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
59 defineOptionalProperty<std::string>(
"WorkingMemoryListenerTopic",
"WorkingMemoryUpdates",
"Topic for working memory updates");
60 defineOptionalProperty<std::string>(
"WorkingMemoryProxy",
"WorkingMemory",
"Proxy of working memory");
61 defineOptionalProperty<std::string>(
"PriorKnowledgeProxy",
"PriorKnowledge",
"Proxy of PriorKnowledge");
80 virtual public ObjectMemoryObserverInterface
88 armarx::ChannelRefBasePtr
requestObjectClassOnce(
const std::string& objectClassName,
const IceUtil::Optional<Ice::Int>& priority, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
89 armarx::ChannelRefBasePtr
requestObjectClassRepeated(
const std::string& objectClassName,
int cycleTimeMS,
const IceUtil::Optional<Ice::Int>& priority, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
90 void releaseObjectClass(
const armarx::ChannelRefBasePtr& objectClassChannel, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
92 ChannelRefBaseSequence
getObjectInstances(
const armarx::ChannelRefBasePtr& objectClassChannel, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
93 ChannelRefBaseSequence
getObjectInstancesByClass(
const std::string& objectClassName, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
94 armarx::ChannelRefBasePtr
getFirstObjectInstance(
const armarx::ChannelRefBasePtr& objectClassChannel,
const Ice::Current&
c = Ice::emptyCurrent)
override;
97 armarx::ChannelRefBasePtr
getObjectInstanceById(
const std::string&, const ::Ice::Current&
c = ::Ice::Current())
override;
99 armarx::ChannelRefBasePtr
addFrame(
const std::string& frameName, const ::Ice::Current&
c = Ice::emptyCurrent);
100 void removeFrame(
const armarx::ChannelRefBasePtr& frameChannel, const ::Ice::Current&
c = Ice::emptyCurrent);
103 void reportEntityCreated(
const std::string& segmentName,
const EntityBasePtr& entity, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
104 void reportEntityUpdated(
const std::string& segmentName,
const EntityBasePtr& entityOld,
const EntityBasePtr& entityNew, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
105 void reportEntityRemoved(
const std::string& segmentName,
const EntityBasePtr& entity, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
106 void reportSnapshotLoaded(
const std::string& segmentName, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
108 void reportMemoryCleared(
const std::string& segmentName, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
113 return "ObjectMemoryObserver";
130 std::vector<armarx::ChannelRefPtr> getObjectClassQueries(
const std::string& objectClassName);
134 std::string getInstanceChannelName(
const EntityBasePtr& instance, const ::Ice::Current&
c = Ice::emptyCurrent)
const override;
137 AbstractWorkingMemoryInterfacePrx proxyWorkingMemory;
138 ObjectInstanceMemorySegmentBasePrx objectInstancesSegment;
139 ObjectClassMemorySegmentBasePrx objectClassesSegment;
140 PriorKnowledgeInterfacePrx priorKnowledge;
141 PersistentObjectClassSegmentBasePrx priorObjectClassesSegment;
144 unsigned int uniqueId;
146 unsigned int getUniqueId()
148 std::unique_lock lock(idMutex);