cz.cuni.amis.pogamut.base3d.worldview.impl
Class LockableBatchAwareWorldView
java.lang.Object
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView
cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView
cz.cuni.amis.pogamut.base3d.worldview.impl.VisionWorldView
cz.cuni.amis.pogamut.base3d.worldview.impl.BatchAwareWorldView
cz.cuni.amis.pogamut.base3d.worldview.impl.LockableBatchAwareWorldView
- All Implemented Interfaces:
- ILockableWorldView, IWorldChangeEventInput, IWorldView, IComponent, IVisionWorldView
public abstract class LockableBatchAwareWorldView
- extends BatchAwareWorldView
- implements ILockableWorldView
Method Summary |
protected abstract boolean |
isBatchBeginEvent(IWorldChangeEvent evt)
Is this event a batch begin event? |
boolean |
isLocked()
Whether the worldview is locked. |
void |
lock()
When the world view is locked - no batches are processes until unlocked. |
void |
notify(IWorldChangeEvent event)
Implements locking logic. |
void |
unlock()
Unlocks the world view - triggers processing of all events till the last EndMessage that
came between lock() / unlock() calls. |
Methods inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView |
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addWorldObject, get, get, get, getAll, getAll, getComponentId, getEventBus, getLog, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, pause, prePause, preStop, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, removeWorldObject, reset, resume, start, stop, toString |
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldView |
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, get, getAll, getAll, getEventBus, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener |
WORLDVIEW_DEPENDENCY
public static final String WORLDVIEW_DEPENDENCY
- See Also:
- Constant Field Values
LockableBatchAwareWorldView
public LockableBatchAwareWorldView(ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger log)
isBatchBeginEvent
protected abstract boolean isBatchBeginEvent(IWorldChangeEvent evt)
- Is this event a batch begin event? It is needed for the locking to be working correctly.
- Specified by:
isBatchBeginEvent
in class BatchAwareWorldView
- Parameters:
evt
-
- Returns:
- true if this is a batch ending event
lock
public void lock()
- When the world view is locked - no batches are processes until unlocked.
- Specified by:
lock
in interface ILockableWorldView
unlock
public void unlock()
- Unlocks the world view - triggers processing of all events till the last EndMessage that
came between lock() / unlock() calls.
- Specified by:
unlock
in interface ILockableWorldView
isLocked
public boolean isLocked()
- Description copied from interface:
ILockableWorldView
- Whether the worldview is locked.
- Specified by:
isLocked
in interface ILockableWorldView
- Returns:
notify
public void notify(IWorldChangeEvent event)
- Implements locking logic.
- Specified by:
notify
in interface IWorldChangeEventInput
- Overrides:
notify
in class BatchAwareWorldView
Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.