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

#include <AddFUEntryCmd.hh>

Inheritance diagram for AddFUEntryCmd:
Inheritance graph
Collaboration diagram for AddFUEntryCmd:
Collaboration graph

Public Member Functions

 AddFUEntryCmd ()
 
virtual ~AddFUEntryCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddFUEntryCmdcreate () 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 FU entries to a HDB.

Definition at line 41 of file AddFUEntryCmd.hh.

Constructor & Destructor Documentation

◆ AddFUEntryCmd()

AddFUEntryCmd::AddFUEntryCmd ( )

The Constructor.

Definition at line 45 of file AddFUEntryCmd.cc.

Referenced by create().

◆ ~AddFUEntryCmd()

AddFUEntryCmd::~AddFUEntryCmd ( )
virtual

The Destructor.

Definition at line 53 of file AddFUEntryCmd.cc.

53  {
54 }

Member Function Documentation

◆ create()

AddFUEntryCmd * AddFUEntryCmd::create ( ) const
virtual

Creates a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 102 of file AddFUEntryCmd.cc.

102  {
103  return new AddFUEntryCmd();
104 }

References AddFUEntryCmd().

Here is the call graph for this function:

◆ Do()

bool AddFUEntryCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 60 of file AddFUEntryCmd.cc.

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

References HDB::HDBManager::addFUEntry().

Here is the call graph for this function:

◆ icon()

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

Returns name of the command icon file.

Returns
Command icon file name.

Implements GUICommand.

Definition at line 81 of file AddFUEntryCmd.cc.

81  {
82  return "";
83 }

◆ id()

int AddFUEntryCmd::id ( ) const
virtual

Returns command id.

Returns
Command identifier.

Implements GUICommand.

Definition at line 91 of file AddFUEntryCmd.cc.

91  {
93 }

References HDBEditorConstants::COMMAND_ADD_FU_ENTRY.

◆ isEnabled()

bool AddFUEntryCmd::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 113 of file AddFUEntryCmd.cc.

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

The documentation for this class was generated from the following files:
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDB::HDBManager
Definition: HDBManager.hh:82
HDB::HDBManager::addFUEntry
RowID addFUEntry() const
Definition: HDBManager.cc:1014
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
AddFUEntryCmd::AddFUEntryCmd
AddFUEntryCmd()
Definition: AddFUEntryCmd.cc:45
HDBEditorConstants::COMMAND_ADD_FU_ENTRY
@ COMMAND_ADD_FU_ENTRY
Definition: HDBEditorConstants.hh:53
HDBEditorConstants::COMMAND_NAME_ADD_FU_ENTRY
static const std::string COMMAND_NAME_ADD_FU_ENTRY
Name of the add new fu entry command.
Definition: HDBEditorConstants.hh:74