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

#include <ModifyBusCmd.hh>

Inheritance diagram for ModifyBusCmd:
Inheritance graph
Collaboration diagram for ModifyBusCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Bus to modify. More...
 

Detailed Description

Command which displays a bus dialog with precompleted values for modifying a bus.

Definition at line 43 of file ModifyBusCmd.hh.

Constructor & Destructor Documentation

◆ ModifyBusCmd()

ModifyBusCmd::ModifyBusCmd ( EditPart editPart)

The Constructor.

Definition at line 45 of file ModifyBusCmd.cc.

45  :
47  editPart_(editPart) {
48 
49 }

◆ ~ModifyBusCmd()

ModifyBusCmd::~ModifyBusCmd ( )
virtual

The Destructor.

Definition at line 55 of file ModifyBusCmd.cc.

55  {
56 }

Member Function Documentation

◆ Do()

bool ModifyBusCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 65 of file ModifyBusCmd.cc.

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

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifyBusCmd::editPart_
private

Bus to modify.

Definition at line 51 of file ModifyBusCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
TTAMachine::Bus
Definition: Bus.hh:53
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
assert
#define assert(condition)
Definition: Application.hh:86
EditPart::model
TTAMachine::MachinePart * model() const
ModifyBusCmd::editPart_
EditPart * editPart_
Bus to modify.
Definition: ModifyBusCmd.hh:51
BusDialog
Definition: BusDialog.hh:54
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66