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

#include <ModifySocketCmd.hh>

Inheritance diagram for ModifySocketCmd:
Inheritance graph
Collaboration diagram for ModifySocketCmd:
Collaboration graph

Public Member Functions

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

Private Attributes

EditParteditPart_
 Socket to modify.
 

Detailed Description

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

Definition at line 43 of file ModifySocketCmd.hh.

Constructor & Destructor Documentation

◆ ModifySocketCmd()

ModifySocketCmd::ModifySocketCmd ( EditPart editPart)

The Constructor.

Definition at line 44 of file ModifySocketCmd.cc.

44 :
46 editPart_(editPart) {
47
48}
EditPart * editPart_
Socket to modify.

◆ ~ModifySocketCmd()

ModifySocketCmd::~ModifySocketCmd ( )
virtual

The Destructor.

Definition at line 54 of file ModifySocketCmd.cc.

54 {
55}

Member Function Documentation

◆ Do()

bool ModifySocketCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 64 of file ModifySocketCmd.cc.

64 {
65
66 Socket* socket = dynamic_cast<Socket*>(editPart_->model());
67 assert (socket != NULL);
68
69 assert (parentWindow() != NULL);
70
71 SocketDialog dialog(parentWindow(), socket);
72
73 if (dialog.ShowModal() == wxID_OK) {
74 // socket was modified
75 return true;
76 } else {
77 // modification was cancelled
78 return false;
79 }
80
81 return false;
82}
#define assert(condition)
wxWindow * parentWindow()
TTAMachine::MachinePart * model() const

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

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifySocketCmd::editPart_
private

Socket to modify.

Definition at line 51 of file ModifySocketCmd.hh.

Referenced by Do().


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