00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef RESOURCE_H
00021 #define RESOURCE_H
00022
00023 #include "namedid.h"
00024 #include "timeblock.h"
00025 #include "note.h"
00026
00027 class RESOURCE : public NAMED_ID
00028 {
00029 public:
00030
00031 typedef vector<RESOURCE *> PTRLIST;
00032
00033 RESOURCE( char * id, char * name );
00034
00035 double efficiency() { return mEfficiency; };
00036 void setEfficiency(double e);
00037 double rate();
00038 void setRate(double r);
00039 bool IsAvailable( int start, int finish );
00040 bool IsUsed( int dayNo );
00041 bool reverseIsAvailable( int start, int finish );
00042 void AddNote(const string & note);
00043 NOTE_ITERATOR begin_notes() { return mNotes.begin(); };
00044 NOTE_ITERATOR end_notes() { return mNotes.end(); };
00045
00046 void addTimeBlock(TASK *r, int start, int finish, TimeBlock::Type type);
00047 ResourceTimeBlockIterator begin_booked() { return mBooked.begin(); };
00048 ResourceTimeBlockIterator end_booked() { return mBooked.end(); };
00049 void addReverseTimeBlock(TASK *r, int start, int finish, TimeBlock::Type type);
00050 ResourceTimeBlockIterator begin_rbooked() { return mRbooked.begin(); };
00051 ResourceTimeBlockIterator end_rbooked() { return mRbooked.end(); };
00052
00053
00054
00055 int is_group;
00056 PTRLIST belongs_to;
00057 PTRLIST contains;
00058
00059 static void setDefaultRate(double rate);
00060 static double defaultRate() { return sDefaultRate; };
00061
00062 private:
00063 double mEfficiency;
00064
00065 double mRate;
00066
00067 NOTES mNotes;
00068
00069 ResourceTimeBlockList mBooked;
00070 ResourceTimeBlockList mRbooked;
00071
00072 void Error(char *fmt, ...);
00073
00074 static double sDefaultRate;
00075 };
00076
00077 #endif