Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

milestone.h

Go to the documentation of this file.
00001 // -*- C++ -*- 
00002 /*
00003 ** Copyright (C) 2000 Alan McIvor <alan@mcivor.gen.nz>
00004 **  
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef MILESTONE_H
00021 #define MILESTONE_H
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 using namespace std;
00027 
00028 #include "namedid.h"
00029 #include "task.h"
00030 
00031 class MILESTONE : public NAMED_ID
00032 {
00033 public:
00034 
00035     typedef vector<MILESTONE *> PTRLIST;
00036 
00037     MILESTONE(char *id, char *name);
00038     ~MILESTONE() {};
00039 
00040     void addDepends( TASK * depends ) { mDepends.push_back( depends ); };
00041     TASK::PTRLIST::const_iterator begin_depends() { return mDepends.begin(); }; 
00042     TASK::PTRLIST::const_iterator end_depends() { return mDepends.end(); }; 
00043     
00044     int  day() const { return mDay; };
00045     void setDay(int day) { mDay = day; };
00046     int  bday() const { return mBday; };
00047     void setBday(int bday) { mBday = bday; };
00048     TASK * critical() const { return mCritical; };
00049     void setCritical(TASK * critical) { mCritical = critical; };
00050 
00051     // really part of reporting routines
00052     int x1,y1,x2,y2;  
00053     int nx, ny;       
00054 
00055 private:
00056     int  mDay;          
00057     int  mBday;         
00058     TASK *mCritical;    
00059 
00060     TASK::PTRLIST mDepends;  
00061 };
00062 
00063 class CompareMilestoneDates
00064 {
00065 public:
00066     bool operator()(const MILESTONE * m1, const MILESTONE * m2) const
00067         { return m1->day() < m2->day(); };
00068 };
00069 
00070 
00071 
00072 #endif

Generated on Wed Feb 18 22:23:54 2004 for Opensched by doxygen1.2.15