00001 //Filename : OCOURRES.H 00002 //Description : Course Template Class Declaration 00003 //Owner : Fred 00004 00005 #ifndef __OCOURRES_H 00006 #define __OCOURRES_H 00007 00008 #include <OSTUDENT.H> 00009 00010 #define FIRST_COURSE_TEMPLATE_CODE 'A' 00011 00012 enum { 00013 COURSE_PREFERENCE_COUNT = 3, 00014 P_SEMINAR=0, P_CLASS_WITH_BREAKOUTS, P_OTHER, // P_OTHER also called P_GENERAL 00015 00016 SUMMER_PERF_COUNT = 3, 00017 SUMMER_COURSE_COUNT = 5, // 0,1,2,3 or 4 summer courses 00018 }; 00019 00020 //------ Define struct Rec for summer course -------// 00021 00024 struct SummerRec { 00025 char course_pref[SUMMER_COURSE_COUNT][9]; 00026 }; 00027 00028 //------ Define struct CourseTemplateRec -------// 00029 00031 struct CourseTemplateRec { 00032 char template_code[9]; 00033 char target_preference[9]; 00034 char normal_class_size[9]; 00035 }; 00036 00037 //------ Define struct CourseTemplate -------// 00038 00040 struct CourseTemplate { 00041 char template_code; 00042 00043 // 99->99% 00044 char target_preference[COURSE_PREFERENCE_COUNT]; 00045 short normal_class_size[COURSE_PREFERENCE_COUNT]; 00046 }; 00047 00048 //------- Define class CourseRes ---------// 00049 00051 class CourseRes { 00052 public: 00053 char init_flag; 00054 00055 // 99->99% 00056 char summer_course_pref[MAX_STUDENT_LEVEL][SUMMER_PERF_COUNT][SUMMER_COURSE_COUNT]; 00057 00058 short course_template_count; 00059 CourseTemplate* course_template_array; 00060 00061 public: 00062 void init(); 00063 void deinit(); 00064 CourseTemplate* get_template(char* templateCode); 00065 CourseTemplate* get_template(int deptId); 00066 00067 int get_normal_class_size(char* templateCode, char teachingMethod); 00068 void get_course_pref(char* templateCode, char* pref); 00069 void change_course_templ_code(char* code); 00070 00071 private: 00072 void load_template(); 00073 void free_template(); 00074 00075 void load_summer_db(); 00076 }; 00077 00078 //------- Define class CourseSummary ---------// 00079 00080 extern CourseRes course_res; 00081 00082 //-----------------------------------------// 00083 #endif