class BarrierTracker implements CheckpointBarrierHandler {

	@Override
	public BufferOrEvent getNextNonBlocked() throws IOException, InterruptedException {
		while (true) {
			BufferOrEvent next = inputGate.getNextBufferOrEvent();
			if (next == null) {
				return null;
			}
			else if (next.isBuffer() || next.getEvent().getClass() != CheckpointBarrier.class) {
				return next;
			}
			else {
				processBarrier((CheckpointBarrier) next.getEvent());
			}
		}
	}

	public  BarrierTracker(InputGate inputGate);

}