/* * Class what_if_t is the model of student what if processing. See the spec * for detailed discussion of what this processing. */ #ifdef TESTING #include WhatIf-test-stubs.h #end class what_if_t { public: what_if_t(roster_t* current_roster); /* * Construct with the given roster. */ what_if_t(); /* * Construct with an intially empty roster. */ ~what_if_t(); /* * Destruct normally. */ set_view(what_if_ui_t* what_if_ui); /* * Set the companion view pointer to that given. */ void do_what_if(char* student_id); /* * Initiate the whatif computation and ensuing dialog for the given * student. Display the what_if dialog view if it's not already. */ void recompute(string_list_t* list); /* * Respond to the user pressing the Recompute button, which basic what if * computation. */ void restore(); /* * Respond to the user pressing the Restore button, which reinstates the * original row data from the roster. */ void done(); /* * Respond to the user pressing the Done button, which closes the display * window. */ protected: roster_t* curent_roster; /* Supporting roster process */ what_if_ui_t* ui; /* Companion view */ row_t* current_row; /* Current working row data, as modified by the * user */ row_t* original_row; /* Original row data from the roster. */ };