OpenASIP  2.0
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. More...
 

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 }

◆ ~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 }

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:
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
ModifySocketCmd::editPart_
EditPart * editPart_
Socket to modify.
Definition: ModifySocketCmd.hh:51
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::Socket
Definition: Socket.hh:53
SocketDialog
Definition: SocketDialog.hh:50
EditPart::model
TTAMachine::MachinePart * model() const
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66