// Responsible for keeping track of job to be completed // // Copyright (C) 2000 Stephen A. Torri // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Questions, comments or improvements should be sent to: // s.torri@lancaster.ac.uk or storri@stratos.net // #ifndef JOB_LIST_H #define JOB_LIST_H #include #include #include #include using namespace std; class Job_List_Item { public: string command; string directory; bool isComment; Job_List_Item(string cmd, string dir); Job_List_Item(string cmd, string dir, bool com); }; class Job_List_Node { public: Job_List_Node* next; Job_List_Node* prev; Job_List_Item* job_ptr; Job_List_Node(Job_List_Item* job); }; class Job_List : public JTCMonitor { private: Job_List_Node* head; Job_List_Node* end; int list_size; string basedir; bool startsWith(string target, string test); string getNewDirectory(string target); Job_List_Item* removeJob(int position); int indexOf(Job_List_Item* job); public: Job_List(); ~Job_List(); int size(); bool empty(); void addJob (string command); void addJob (string command, string directory); Job_List_Item* getJob(); Job_List_Item* removeJob(Job_List_Item* job); void waitForJob(); }; #endif