C++ DevKit
C++ set of OOP library
|
This is the Model abstract class of Model_View_Control design pattern. More...
#include <ui_core.h>
Public Member Functions | |
Model () | |
Construct the Model object. | |
~Model () | |
Destroy the Model object. | |
void | update_attached_widgets (Widget *new_widget) |
add a new widget to the set of attached_widgets | |
int | get_number_of_attached_widget () |
get the number of attached widgets | |
bool | has_changed () |
get the change flag status | |
void | set_change_flag () |
Set the change flag object to true. | |
void | draw_widget_done () |
Set the change flag object to false. | |
uint32_t | get_time_since_last_change () |
compute time since the last status change | |
virtual void | draw_refresh_all_attached_widgets () |
update drawing for each attached widgets | |
Protected Attributes | |
std::set< Widget * > | attached_widgets |
the set of widgets that are in charge of viewing this model. | |
This is the Model abstract class of Model_View_Control design pattern.
It handles change_flag, a semaphore used to indicate that a redraw is required for all attached widgets.
The controller or any other entities that modify the model must set the change_flag and the widget in charge of its screen representation must clear the change_flag
int Model::get_number_of_attached_widget | ( | ) |
get the number of attached widgets
uint32_t Model::get_time_since_last_change | ( | ) |
compute time since the last status change
bool Model::has_changed | ( | ) |
get the change flag status
void Model::update_attached_widgets | ( | Widget * | new_widget | ) |
add a new widget to the set of attached_widgets
new_widget |
|
protected |
the set of widgets that are in charge of viewing this model.