27 #include <ArmarXCore/interface/core/Log.h>
40 AbstractMemorySegmentPrx
SegmentedMemory::addSegment(
const std::string& segmentName,
const AbstractMemorySegmentPtr& segment, const ::Ice::Current&
c)
44 MemorySegmentMap::const_iterator it =
segments.find(segmentName);
48 throw SegmentAlreadyExistsException();
52 segment->setSegmentName(segmentName);
53 segment->setParentMemory(
this);
55 auto id = segment->getIceId();
57 AbstractMemorySegmentPrx segmentProxy = AbstractMemorySegmentPrx::uncheckedCast(
getObjectAdapter()->add(segment,
id));
61 segmentEntry.
proxy = segmentProxy;
64 segments[segmentName] = segmentEntry;
80 MemorySegmentMap::const_iterator iter =
segments.find(segmentName);
84 ARMARX_ERROR_S <<
"Could not find segment with name " << segmentName << std::endl;
85 throw InvalidEntityException();
88 return iter->second.proxy;
95 MemorySegmentMap::iterator iter =
segments.find(segmentName);
99 AbstractMemorySegmentPrx proxy = iter->second.proxy;
116 for (MemorySegmentMap::const_iterator it =
segments.begin(); it !=
segments.end(); ++it)
118 result.push_back(it->first);
129 MemorySegmentMap::iterator iter =
segments.find(segmentName);
133 ARMARX_ERROR_S <<
"Could not find segment with name " << segmentName << std::endl;
134 throw InvalidEntityException();
137 return iter->second.pointer;
143 NameList
names = getSegmentNames();
145 for (
auto name :
names)
147 EntityMemorySegmentInterfacePtr segment = memoryx::EntityMemorySegmentInterfacePtr::dynamicCast(getSegmentPtr(name));
154 auto entity = segment->getEntityById(entityId);
168 NameList
names = getSegmentNames();
170 for (
auto name :
names)
172 EntityMemorySegmentInterfacePtr segment = memoryx::EntityMemorySegmentInterfacePtr::dynamicCast(getSegmentPtr(name));
179 auto entity = segment->getEntityRefById(entityId);