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

#include <ModifyFUCmd.hh>

Inheritance diagram for ModifyFUCmd:
Inheritance graph
Collaboration diagram for ModifyFUCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Function unit to modify. More...
 

Detailed Description

Command which displays a function unit dialog with precompleted values for modifying a function unit.

Definition at line 43 of file ModifyFUCmd.hh.

Constructor & Destructor Documentation

◆ ModifyFUCmd()

ModifyFUCmd::ModifyFUCmd ( EditPart editPart)

The Constructor.

Definition at line 44 of file ModifyFUCmd.cc.

44  :
46  editPart_(editPart) {
47 }

◆ ~ModifyFUCmd()

ModifyFUCmd::~ModifyFUCmd ( )
virtual

The Destructor.

Definition at line 53 of file ModifyFUCmd.cc.

53  {
54 }

Member Function Documentation

◆ Do()

bool ModifyFUCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 63 of file ModifyFUCmd.cc.

63  {
64 
65  FunctionUnit* fu = dynamic_cast<FunctionUnit*>(editPart_->model());
66 
67  assert (fu != NULL);
68  assert (parentWindow() != NULL);
69 
70  FUDialog dialog(parentWindow(), fu);
71 
72  if (dialog.ShowModal() == wxID_OK) {
73  // function unit was modified
74  return true;
75  } else {
76  // modification was cancelled
77  return false;
78  }
79 }

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifyFUCmd::editPart_
private

Function unit to modify.

Definition at line 51 of file ModifyFUCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
FUDialog
Definition: FUDialog.hh:48
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
ModifyFUCmd::editPart_
EditPart * editPart_
Function unit to modify.
Definition: ModifyFUCmd.hh:51
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
EditPart::model
TTAMachine::MachinePart * model() const
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66