KoMo2  1.0.0
A modern ARM emulator GUI.
ControlsModel.h
Go to the documentation of this file.
1 
9 #include <gtkmm/button.h>
10 #include "CompileLoadModel.h"
11 
12 class ControlsView;
13 
21 class ControlsModel : private Model {
22  public:
24  const std::string manual,
25  KoMo2Model* const parent);
26  virtual const bool handleKeyPress(const GdkEventKey* const e) override;
27  virtual void changeJimulatorState(const JimulatorState newState) override;
28 
29  private:
34 
35  // Click handlers
37  void onPauseResumeClick();
39  void onHaltExecutionClick();
40 
41  // ! Deleted special member functions
42  // stops these functions from being misused, creates a sensible error
43  ControlsModel(const ControlsModel&) = delete;
44  ControlsModel(const ControlsModel&&) = delete;
45  ControlsModel& operator=(const ControlsModel&) = delete;
46  ControlsModel& operator=(const ControlsModel&&) = delete;
47 };
The class definition of the ControlsModel class, a data model which encapsulates all state...
Definition: ControlsModel.h:21
virtual const bool handleKeyPress(const GdkEventKey *const e) override
Handles a key press event pertaining to this model.
std::string manual
Manual information read from variables.json is stored here.
Definition: main.cpp:71
void onReloadJimulatorClick()
Handles the reloadJimulatorButton click events - sends a command to Jimulator and changes JimulatorSt...
virtual void changeJimulatorState(const JimulatorState newState) override
Handles the Jimulator state change for this model. For each value of newState, it will update the sta...
ControlsModel(ControlsView *const view, const std::string manual, KoMo2Model *const parent)
Construct a new ControlsModel::ControlsModel object.
void onSingleStepExecuteClick()
Handles the singleStepExecuteButton click events - changes JimulatorState to "JimulatorState::PAUSED"...
KoMo2Model *const parent
All models have a parent model - KoMo2Model, the most senior model in the hierarchy, sets its parent to self.
Definition: Model.h:87
ControlsView is the visual aspect of the controls that run along the top of the KoMo2 GUI...
Definition: ControlsView.h:22
ControlsView *const view
A pointer to the view which this model represents.
Definition: ControlsModel.h:33
JimulatorState
Describe the 5 states of Jimulator.
Definition: Model.h:19
void onPauseResumeClick()
Handles the pauseResumeButton click events - changes JimulatorState to "JimulatorState::RUNNING" if c...
The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
Definition: Model.h:35
void onHaltExecutionClick()
Handles the haltExecutionButton click events - changes JimulatorState to "JimulatorState::UNLOADED".
The logical model of the entire application. All other models should be member variables of this mode...
Definition: KoMo2Model.h:34
A file containing the definition of the CompileLoadModel class.