package cn.amq.traffic;

import java.util.ArrayList;
import java.util.List;
import cn.amq.peas.XdPtzMovedNotifyPeas;

/**
 * 相机移位缓存并推送至前端
 * @author Lenovo
 *
 */
public class PresetPointDateService {

	Object mutex = new Object();
	
	private List<XdPtzMovedNotifyPeas> presetPointDataList = new ArrayList<XdPtzMovedNotifyPeas>();

	public List<XdPtzMovedNotifyPeas> getPresetPointDataList() {
		synchronized (mutex) {
			List<XdPtzMovedNotifyPeas> tempList = new ArrayList<XdPtzMovedNotifyPeas>();
			tempList = presetPointDataList;
			presetPointDataList = new ArrayList<XdPtzMovedNotifyPeas>();
			return tempList;
		}
	}

	public void setPresetPointDataList(List<XdPtzMovedNotifyPeas> ls) {
		synchronized (mutex) {
			if (presetPointDataList != null) {
				presetPointDataList.addAll(ls);
			}
		}
	}
}
