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

#include <AddRFEntryCmd.hh>

Inheritance diagram for AddRFEntryCmd:
Inheritance graph
Collaboration diagram for AddRFEntryCmd:
Collaboration graph

Public Member Functions

 AddRFEntryCmd ()
 
virtual ~AddRFEntryCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddRFEntryCmdcreate () 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 RF entries to a HDB.

Definition at line 41 of file AddRFEntryCmd.hh.

Constructor & Destructor Documentation

◆ AddRFEntryCmd()

AddRFEntryCmd::AddRFEntryCmd ( )

The Constructor.

Definition at line 45 of file AddRFEntryCmd.cc.

Referenced by create().

◆ ~AddRFEntryCmd()

AddRFEntryCmd::~AddRFEntryCmd ( )
virtual

The Destructor.

Definition at line 53 of file AddRFEntryCmd.cc.

53  {
54 }

Member Function Documentation

◆ create()

AddRFEntryCmd * AddRFEntryCmd::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 AddRFEntryCmd.cc.

103  {
104  return new AddRFEntryCmd();
105 }

References AddRFEntryCmd().

Here is the call graph for this function:

◆ Do()

bool AddRFEntryCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 60 of file AddRFEntryCmd.cc.

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

References HDB::HDBManager::addRFEntry().

Here is the call graph for this function:

◆ icon()

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

Returns name of the command icon file.

Returns
Command icon file name.

Implements GUICommand.

Definition at line 81 of file AddRFEntryCmd.cc.

81  {
82  return "";
83 }

◆ id()

int AddRFEntryCmd::id ( ) const
virtual

Returns command identifier for this command.

Returns
Command identifier of this command.

Implements GUICommand.

Definition at line 92 of file AddRFEntryCmd.cc.

92  {
94 }

References HDBEditorConstants::COMMAND_ADD_RF_ENTRY.

◆ isEnabled()

bool AddRFEntryCmd::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 AddRFEntryCmd.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:
HDBEditorConstants::COMMAND_ADD_RF_ENTRY
@ COMMAND_ADD_RF_ENTRY
Definition: HDBEditorConstants.hh:54
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDB::HDBManager::addRFEntry
RowID addRFEntry() const
Definition: HDBManager.cc:1557
AddRFEntryCmd::AddRFEntryCmd
AddRFEntryCmd()
Definition: AddRFEntryCmd.cc:45
HDB::HDBManager
Definition: HDBManager.hh:82
HDBEditorConstants::COMMAND_NAME_ADD_RF_ENTRY
static const std::string COMMAND_NAME_ADD_RF_ENTRY
Name of the add new rf entry command.
Definition: HDBEditorConstants.hh:76
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42