OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
ModifyRFCmd Class Reference

#include <ModifyRFCmd.hh>

Inheritance diagram for ModifyRFCmd:
Inheritance graph
Collaboration diagram for ModifyRFCmd:
Collaboration graph

Public Member Functions

 ModifyRFCmd (EditPart *editPart)
 
virtual ~ModifyRFCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

EditParteditPart_
 Register file to modify. More...
 

Detailed Description

Command which displays a register file dialog with precompleted values for modifying a register file.

Definition at line 43 of file ModifyRFCmd.hh.

Constructor & Destructor Documentation

◆ ModifyRFCmd()

ModifyRFCmd::ModifyRFCmd ( EditPart editPart)

The Constructor.

Definition at line 47 of file ModifyRFCmd.cc.

47  :
48  editPart_(editPart) {
49 
50 }

◆ ~ModifyRFCmd()

ModifyRFCmd::~ModifyRFCmd ( )
virtual

The Destructor.

Definition at line 56 of file ModifyRFCmd.cc.

56  {
57 }

Member Function Documentation

◆ Do()

bool ModifyRFCmd::Do ( )
virtual

Executes the command.

Returns
true, if the command was succesfully executed, false otherwise.

Implements ComponentCommand.

Definition at line 66 of file ModifyRFCmd.cc.

66  {
67 
68  RegisterFile* rf = dynamic_cast<RegisterFile*>(editPart_->model());
69  assert (rf != NULL);
70  assert (parentWindow() != NULL);
71 
72  RFDialog dialog(parentWindow(), rf);
73 
74  if (dialog.ShowModal() == wxID_OK) {
75  // register file was modified
76  return true;
77  } else {
78  // modification was cancelled
79  return false;
80  }
81 
82  return false;
83 }

References assert, editPart_, EditPart::model(), and ComponentCommand::parentWindow().

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifyRFCmd::editPart_
private

Register file to modify.

Definition at line 51 of file ModifyRFCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
assert
#define assert(condition)
Definition: Application.hh:86
EditPart::model
TTAMachine::MachinePart * model() const
ModifyRFCmd::editPart_
EditPart * editPart_
Register file to modify.
Definition: ModifyRFCmd.hh:51
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
RFDialog
Definition: RFDialog.hh:47
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66