OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DeleteSegmentCmd Class Reference

#include <DeleteSegmentCmd.hh>

Inheritance diagram for DeleteSegmentCmd:
Inheritance graph
Collaboration diagram for DeleteSegmentCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Segment to delete.
 

Detailed Description

Command for deleting segments from a machine.

Definition at line 43 of file DeleteSegmentCmd.hh.

Constructor & Destructor Documentation

◆ DeleteSegmentCmd()

DeleteSegmentCmd::DeleteSegmentCmd ( EditPart editPart)

The Constructor.

Parameters
editPartSegment to delete.

Definition at line 46 of file DeleteSegmentCmd.cc.

46 :
47 ComponentCommand(), editPart_(editPart) {
48}
EditPart * editPart_
Segment to delete.

◆ ~DeleteSegmentCmd()

DeleteSegmentCmd::~DeleteSegmentCmd ( )
virtual

The Destructor.

Definition at line 54 of file DeleteSegmentCmd.cc.

54 {
55}

Member Function Documentation

◆ Do()

bool DeleteSegmentCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 64 of file DeleteSegmentCmd.cc.

64 {
65 Segment* segment = dynamic_cast<Segment*>(editPart_->model());
66 assert (segment != NULL);
67 delete segment;
68 return true;
69}
#define assert(condition)
TTAMachine::MachinePart * model() const

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* DeleteSegmentCmd::editPart_
private

Segment to delete.

Definition at line 51 of file DeleteSegmentCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files: