30 #include <MemoryX/interface/core/EntityBase.h>
31 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
32 #include <MemoryX/interface/memorytypes/MemorySegments.h>
39 virtual public ActiveOacMemorySegmentBase
42 ActiveOacMemorySegment(ObjectInstanceMemorySegmentBasePrx objectInstanceSegmentPrx, OacMemorySegmentBasePrx oacSegmentPrx):
44 ActiveOacMemorySegmentBase(),
45 objectInstanceSegmentPrx(objectInstanceSegmentPrx),
46 oacSegmentPrx(oacSegmentPrx)
50 std::string
addEntity(
const EntityBasePtr& entity, const ::Ice::Current&
c = Ice::emptyCurrent)
override
52 activeOac =
new ActiveOacFull;
55 WorkingMemoryListenerInterfacePrx tmpListenerProxy = listenerProxy;
58 listenerProxy = tmpListenerProxy;
60 ActiveOacPtr actualEntity = ActiveOacPtr::dynamicCast(getEntityById(
id));
61 activeOac->oac = oacSegmentPrx->getOacById(actualEntity->getOacRef()->entityId);
63 ObjectInstanceList args;
64 std::vector<std::string> ids = actualEntity->getArgumentInstanceIds();
66 for (std::vector<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it)
68 ObjectInstancePtr object = ObjectInstancePtr::dynamicCast(objectInstanceSegmentPrx->getObjectInstanceById(*it));
69 args.push_back(
object);
72 activeOac->parameters = args;
73 activeOac->entity = actualEntity;
77 listenerProxy->reportEntityCreated(segmentName, actualEntity);
83 ActiveOacFullPtr
getActiveOac(const ::Ice::Current& = Ice::emptyCurrent)
override
88 void changeState(OacExecState state, const ::Ice::Current& = Ice::emptyCurrent)
override
90 activeOac->entity->setState(state);
91 updateEntity(activeOac->entity->getId(), activeOac->entity);