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

#include <ModifyIUPortCmd.hh>

Inheritance diagram for ModifyIUPortCmd:
Inheritance graph
Collaboration diagram for ModifyIUPortCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Immediate unit port to modify. More...
 

Detailed Description

Command which displays an immediate unit port dialog with precompleted values for modifying an imediate unit port.

Definition at line 44 of file ModifyIUPortCmd.hh.

Constructor & Destructor Documentation

◆ ModifyIUPortCmd()

ModifyIUPortCmd::ModifyIUPortCmd ( EditPart editPart)

The Constructor.

Parameters
editPartPort to modify.

Definition at line 47 of file ModifyIUPortCmd.cc.

47  :
49  editPart_(editPart) {
50 }

◆ ~ModifyIUPortCmd()

ModifyIUPortCmd::~ModifyIUPortCmd ( )
virtual

The Destructor.

Definition at line 56 of file ModifyIUPortCmd.cc.

56  {
57 }

Member Function Documentation

◆ Do()

bool ModifyIUPortCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 66 of file ModifyIUPortCmd.cc.

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

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifyIUPortCmd::editPart_
private

Immediate unit port to modify.

Definition at line 52 of file ModifyIUPortCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
ModifyIUPortCmd::editPart_
EditPart * editPart_
Immediate unit port to modify.
Definition: ModifyIUPortCmd.hh:52
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::Port
Definition: Port.hh:54
IUPortDialog
Definition: IUPortDialog.hh:45
EditPart::model
TTAMachine::MachinePart * model() const
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66