KoMo2  1.0.0
A modern ARM emulator GUI.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RegistersModel Class Reference

Stores data and functions relating to the tracking and manipulation of data within the RegistersView view object. More...

#include <RegistersModel.h>

Inheritance diagram for RegistersModel:
Model

Public Member Functions

 RegistersModel (RegistersView *const view, KoMo2Model *const parent)
 Constructs a new registers model object. More...
 
virtual void changeJimulatorState (const JimulatorState newState) override
 Handles changes in the Jimulator state. More...
 
virtual const bool handleKeyPress (const GdkEventKey *const e) override
 Handles any key press events. More...
 
RegistersView *const getView () const
 Returns the view for this model. More...
 
void refreshViews ()
 Handles updating this particular view. Reads register values from Jimulator, sets the label values of this view to reflect those values.
 

Private Member Functions

const std::array< std::string, 16 > getRegisterValueFromJimulator () const
 Gets the register values out of Jimulator. More...
 
 RegistersModel (const RegistersModel &)=delete
 
 RegistersModel (const RegistersModel &&)=delete
 
RegistersModeloperator= (const RegistersModel &)=delete
 
RegistersModeloperator= (const RegistersModel &&)=delete
 
- Private Member Functions inherited from Model
 Model (KoMo2Model *const parent)
 Constructs a new Model object - just assigns the parent variable. More...
 
KoMo2Model *const getParent () const
 Returns the parent pointer. More...
 
template<class T1 , class T2 >
void setButtonListener (Gtk::Button *const button, const T1 b, const T2 c)
 Connect any button to any member function of. More...
 
void setButtonState (Gtk::Button *const button, const bool state, Gtk::Image *const img=nullptr, const std::string newTooltip="", const std::string newLabelText="") const
 Sets the state of a button to some boolean - the assumption is that if a button is not meant to be sensitive (get_sensitive() == false) then it should also not have a tooltip or many other attributes. You can also optionally update the buttons image, tooltip text, and label text. More...
 
JimulatorState getJimulatorState () const
 Return the jimulatorState member object. More...
 

Private Attributes

RegistersView *const view
 The view this model represents.
 

Detailed Description

Stores data and functions relating to the tracking and manipulation of data within the RegistersView view object.

Definition at line 20 of file RegistersModel.h.

Constructor & Destructor Documentation

RegistersModel::RegistersModel ( RegistersView *const  view,
KoMo2Model *const  parent 
)

Constructs a new registers model object.

Parameters
viewA pointer to the view this register represents.
parentA pointer to the parent model.

Definition at line 23 of file RegistersModel.cpp.

Member Function Documentation

void RegistersModel::changeJimulatorState ( const JimulatorState  newState)
overridevirtual

Handles changes in the Jimulator state.

Parameters
newStateThe state being changed into.

Implements Model.

Definition at line 33 of file RegistersModel.cpp.

const std::array< std::string, 16 > RegistersModel::getRegisterValueFromJimulator ( ) const
private

Gets the register values out of Jimulator.

Returns
const std::array<std::string, 16> An array containing all of the register values.

Definition at line 182 of file RegistersModel.cpp.

RegistersView *const RegistersModel::getView ( ) const

Returns the view for this model.

Returns
RegistersView* The view for this model.

Definition at line 172 of file RegistersModel.cpp.

const bool RegistersModel::handleKeyPress ( const GdkEventKey *const  e)
overridevirtual

Handles any key press events.

Parameters
eThe key press event.
Returns
bool true if the key press was handled.

Implements Model.

Definition at line 40 of file RegistersModel.cpp.


The documentation for this class was generated from the following files: