00001 /* 00002 00003 MegaPlusPlus a C++ implementation for the MegaSquirt-II 00004 Copyright (C) 2006 Keith Ballantyne 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 version 2 as published by the Free Software Foundation. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 00019 */ 00020 00025 #ifndef SYSTEMTASKLIST_H 00026 #define SYSTEMTASKLIST_H 00027 00031 class SystemTask; 00032 #include "Constants.h" 00033 00044 class SystemTaskList { 00045 public: 00050 enum Status { 00052 OK, 00054 TOO_MANY_TASKS, 00056 FAILED 00057 }; 00058 00074 Status registerTask(SystemTask &task); 00075 00082 static SystemTaskList &getInstance(); 00083 00095 Status getNextTask(SystemTask **task); 00096 00097 private: 00101 SystemTaskList(); 00102 00103 SystemTask *taskList[Constants::TOTAL_TASKS]; 00104 int taskCount; 00105 int loopPointer; 00106 }; 00107 00108 #endif