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

#include <DeletePortCmd.hh>

Inheritance diagram for DeletePortCmd:
Inheritance graph
Collaboration diagram for DeletePortCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Port to delete. More...
 

Detailed Description

Command for deleting ports from a machine.

Definition at line 43 of file DeletePortCmd.hh.

Constructor & Destructor Documentation

◆ DeletePortCmd()

DeletePortCmd::DeletePortCmd ( EditPart editPart)

The Constructor.

Parameters
editPartPort to delete.

Definition at line 45 of file DeletePortCmd.cc.

45  :
47  editPart_(editPart) {
48 }

◆ ~DeletePortCmd()

DeletePortCmd::~DeletePortCmd ( )
virtual

The Destructor.

Definition at line 54 of file DeletePortCmd.cc.

54  {
55 }

Member Function Documentation

◆ Do()

bool DeletePortCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 64 of file DeletePortCmd.cc.

64  {
65  Port* port = dynamic_cast<Port*>(editPart_->model());
66  assert (port != NULL);
67  delete port;
68  port = NULL;
69  return true;
70 }

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* DeletePortCmd::editPart_
private

Port to delete.

Definition at line 51 of file DeletePortCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::Port
Definition: Port.hh:54
DeletePortCmd::editPart_
EditPart * editPart_
Port to delete.
Definition: DeletePortCmd.hh:51
EditPart::model
TTAMachine::MachinePart * model() const