Преглед на файлове

Refactoring of timer interfaces of java generator.

markus.muehlbrandt@gmail.com преди 12 години
родител
ревизия
e116f0d18b

+ 0 - 30
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/ITimedStatemachine.java

@@ -1,30 +0,0 @@
-package org.yakindu.sct.examples.trafficlight.cyclebased;
-
-/**
-* Interface for state machines which use timed event triggers.
-*/
-public interface ITimedStatemachine {
-
-	/**
-	* Set the {@link ITimerService} for the state machine. It must be set
-	* externally on a timed state machine before a run cycle can be correct
-	* executed.
-	* 
-	* @param timerService
-	*/
-	public void setTimerService(ITimerService timerService);
-
-	/**
-	* Returns the currently used timer service.
-	* 
-	* @return {@link ITimerService}
-	*/
-	public ITimerService getTimerService();
-
-	/**
-	* Callback method if a {@link TimeEvent} occurred.
-	* 
-	* @param timeEvent
-	*/
-	public void onTimeEventRaised(TimeEvent timeEvent);
-}

+ 0 - 46
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/ITimerService.java

@@ -1,46 +0,0 @@
-package org.yakindu.sct.examples.trafficlight.cyclebased;
-
-/**
- * Interface a timer service has to implement. Use to implement your own timer
- * service. A timer service has to be added to a timed state machine.
- * 
- */
-public interface ITimerService {
-
-	/**
-	 * Starts the timing for a given {@link TimeEvent}.
-	 * 
-	 * @param event
-	 *            : The TimeEvent the timer service should throw if timed out.
-	 * @param time
-	 *            : Time in milliseconds after the given time event should be
-	 *            triggered
-	 * @param cycleStartTime
-	 *            : The absolute start time in milliseconds at which the last
-	 *            run cycle was called. Can be used to produce a more accurate
-	 *            timing behavior.
-	 */
-	public void setTimer(TimeEvent event, long time, long cycleStartTime);
-
-	/**
-	 * Unset the given {@link TimeEvent}. Use to unset cyclic repeated time
-	 * events.
-	 * 
-	 * @param event
-	 */
-	public void resetTimer(TimeEvent event);
-
-	/**
-	 * Cancel timer service. Use this to end possible timing threads and free
-	 * memory resources.
-	 */
-	public void cancel();
-
-	/**
-	 * Returns the system time in milliseconds.
-	 * 
-	 * @return the difference, measured in milliseconds, between the current
-	 *         time and a defined point of time in the past.
-	 */
-	public long getSystemTimeMillis();
-}

+ 0 - 58
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/TimeEvent.java

@@ -1,58 +0,0 @@
-package org.yakindu.sct.examples.trafficlight.cyclebased;
-
-/**
- * Event that reflects a time event. It's internally used by
- * {@link ITimedStatemachine}.
- * 
- * @author muehlbrandt
- * 
- * @param <T>
- */
-public class TimeEvent {
-
-	private boolean periodic;
-
-	private ITimedStatemachine statemachine;
-	
-	int index;
-
-	/**
-	 * Constructor for a time event.
-	 * 
-	 * @param periodic
-	 *            : Set to {@code true} if event should be repeated
-	 *            periodically.
-	 * 
-	 * @param index
-	 *            : Index position within the state machine's timeEvent array.
-	 */
-	public TimeEvent(boolean periodic, int index) {
-		this.periodic = periodic;
-		this.index = index;
-	}
-
-	/**
-	 * Returns the state machine reference of the event.
-	 * 
-	 */
-	public ITimedStatemachine getStatemachine() {
-		return statemachine;
-	}
-
-	/**
-	 * Sets the state machine reference of the event.
-	 * 
-	 * @param statemachine
-	 */
-	public void setStatemachine(ITimedStatemachine statemachine) {
-		this.statemachine = statemachine;
-	}
-
-	public boolean isPeriodic() {
-		return periodic;
-	}
-
-	public int getIndex() {
-		return index;
-	}
-}