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

#include <ModifySRPortCmd.hh>

Inheritance diagram for ModifySRPortCmd:
Inheritance graph
Collaboration diagram for ModifySRPortCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Function unit port to modify. More...
 

Detailed Description

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

Definition at line 44 of file ModifySRPortCmd.hh.

Constructor & Destructor Documentation

◆ ModifySRPortCmd()

ModifySRPortCmd::ModifySRPortCmd ( EditPart editPart)

The Constructor.

Parameters
editPartPort to modify.

Definition at line 47 of file ModifySRPortCmd.cc.

47  :
49  editPart_(editPart) {
50 }

◆ ~ModifySRPortCmd()

ModifySRPortCmd::~ModifySRPortCmd ( )
virtual

The Destructor.

Definition at line 56 of file ModifySRPortCmd.cc.

56  {
57 }

Member Function Documentation

◆ Do()

bool ModifySRPortCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 66 of file ModifySRPortCmd.cc.

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

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifySRPortCmd::editPart_
private

Function unit port to modify.

Definition at line 52 of file ModifySRPortCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
ModifySRPortCmd::editPart_
EditPart * editPart_
Function unit port to modify.
Definition: ModifySRPortCmd.hh:52
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::SpecialRegisterPort
Definition: SpecialRegisterPort.hh:48
SRPortDialog
Definition: SRPortDialog.hh:44
EditPart::model
TTAMachine::MachinePart * model() const
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66