OpenASIP  2.0
Public Member Functions | List of all members
AddSocketEntryCmd Class Reference

#include <AddSocketEntryCmd.hh>

Inheritance diagram for AddSocketEntryCmd:
Inheritance graph
Collaboration diagram for AddSocketEntryCmd:
Collaboration graph

Public Member Functions

 AddSocketEntryCmd ()
 
virtual ~AddSocketEntryCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddSocketEntryCmdcreate () const
 
virtual std::string icon () const
 
virtual bool isEnabled ()
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
virtual std::string shortName () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

Command for adding new socket entries to a HDB.

Definition at line 41 of file AddSocketEntryCmd.hh.

Constructor & Destructor Documentation

◆ AddSocketEntryCmd()

AddSocketEntryCmd::AddSocketEntryCmd ( )

The Constructor.

Definition at line 45 of file AddSocketEntryCmd.cc.

Referenced by create().

◆ ~AddSocketEntryCmd()

AddSocketEntryCmd::~AddSocketEntryCmd ( )
virtual

The Destructor.

Definition at line 53 of file AddSocketEntryCmd.cc.

53  {
54 }

Member Function Documentation

◆ create()

AddSocketEntryCmd * AddSocketEntryCmd::create ( ) const
virtual

Creates and returns new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 103 of file AddSocketEntryCmd.cc.

103  {
104  return new AddSocketEntryCmd();
105 }

References AddSocketEntryCmd().

Here is the call graph for this function:

◆ Do()

bool AddSocketEntryCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 60 of file AddSocketEntryCmd.cc.

60  {
61  HDB::HDBManager* manager = wxGetApp().mainFrame().hdbManager();
62 
63  if (manager == NULL) {
64  return false;
65  }
66 
67  RowID id = manager->addSocketEntry();
68 
69  wxGetApp().mainFrame().update();
70  wxGetApp().mainFrame().browser()->selectSocketEntry(id);
71 
72  return true;
73 }

References HDB::HDBManager::addSocketEntry().

Here is the call graph for this function:

◆ icon()

std::string AddSocketEntryCmd::icon ( ) const
virtual

Returns name of the command icon file.

Returns
Command icon file name.

Implements GUICommand.

Definition at line 81 of file AddSocketEntryCmd.cc.

81  {
82  return "";
83 }

◆ id()

int AddSocketEntryCmd::id ( ) const
virtual

Returns command identifier for this command.

Returns
Command identifier of this command.

Implements GUICommand.

Definition at line 92 of file AddSocketEntryCmd.cc.

References HDBEditorConstants::COMMAND_ADD_SOCKET_ENTRY.

◆ isEnabled()

bool AddSocketEntryCmd::isEnabled ( )
virtual

Returns true, if the command should be enabled in the menu/toolbar.

Returns
True, if the command is enabled, false if not.

Implements GUICommand.

Definition at line 114 of file AddSocketEntryCmd.cc.

114  {
115  HDB::HDBManager* manager = wxGetApp().mainFrame().hdbManager();
116 
117  if (manager == NULL) {
118  return false;
119  }
120 
121  return true;
122 }

The documentation for this class was generated from the following files:
HDB::HDBManager::addSocketEntry
RowID addSocketEntry() const
Definition: HDBManager.cc:3606
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDBEditorConstants::COMMAND_NAME_ADD_SOCKET_ENTRY
static const std::string COMMAND_NAME_ADD_SOCKET_ENTRY
Name of the add new socket entry command.
Definition: HDBEditorConstants.hh:80
AddSocketEntryCmd::AddSocketEntryCmd
AddSocketEntryCmd()
Definition: AddSocketEntryCmd.cc:45
HDB::HDBManager
Definition: HDBManager.hh:82
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
HDBEditorConstants::COMMAND_ADD_SOCKET_ENTRY
@ COMMAND_ADD_SOCKET_ENTRY
Definition: HDBEditorConstants.hh:56