*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
* Registers a task with a task handler. This method throws a
* TaskAlreadyRegisteredException if the task has already been registered
*
- * @param $taskName A task name to register the task on
+ * @param $taskName A task name to register the task on
* @param $taskInstance The instance we should register as a task
* @return void
- * @throws TaskAlreadyRegisteredException If the given task is already registered
*/
function registerTask ($taskName, Visitable $taskInstance);
+
+ /**
+ * Checks wether tasks are left including idle task.
+ *
+ * @return $tasksLeft Wether there are tasks left to handle
+ */
+ function hasTasksLeft ();
+
+ /**
+ * Handles all tasks by checking if they should startup or if it is their
+ * turn to run. You should use this method in a while() loop in conjuntion
+ * with hasTasksLeft() so you can e.g. shutdown by adding a ShutdownTask
+ * which will attempt to remove all tasks from the task handler.
+ *
+ * @return void
+ */
+ function handleTasks ();
}
-//
+// [EOF]
?>