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

#include <AddBusEntryCmd.hh>

Inheritance diagram for AddBusEntryCmd:
Inheritance graph
Collaboration diagram for AddBusEntryCmd:
Collaboration graph

Public Member Functions

 AddBusEntryCmd ()
 
virtual ~AddBusEntryCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddBusEntryCmdcreate () 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 bus entries to a HDB.

Definition at line 41 of file AddBusEntryCmd.hh.

Constructor & Destructor Documentation

◆ AddBusEntryCmd()

AddBusEntryCmd::AddBusEntryCmd ( )

The Constructor.

Definition at line 45 of file AddBusEntryCmd.cc.

Referenced by create().

◆ ~AddBusEntryCmd()

AddBusEntryCmd::~AddBusEntryCmd ( )
virtual

The Destructor.

Definition at line 53 of file AddBusEntryCmd.cc.

53  {
54 }

Member Function Documentation

◆ create()

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

103  {
104  return new AddBusEntryCmd();
105 }

References AddBusEntryCmd().

Here is the call graph for this function:

◆ Do()

bool AddBusEntryCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 60 of file AddBusEntryCmd.cc.

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

References HDB::HDBManager::addBusEntry().

Here is the call graph for this function:

◆ icon()

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

Returns name of the command icon file.

Returns
Command icon file name.

Implements GUICommand.

Definition at line 81 of file AddBusEntryCmd.cc.

81  {
82  return "";
83 }

◆ id()

int AddBusEntryCmd::id ( ) const
virtual

Returns command identifier for this command.

Returns
Command identifier of this command.

Implements GUICommand.

Definition at line 92 of file AddBusEntryCmd.cc.

92  {
94 }

References HDBEditorConstants::COMMAND_ADD_BUS_ENTRY.

◆ isEnabled()

bool AddBusEntryCmd::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 AddBusEntryCmd.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:
AddBusEntryCmd::AddBusEntryCmd
AddBusEntryCmd()
Definition: AddBusEntryCmd.cc:45
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDBEditorConstants::COMMAND_ADD_BUS_ENTRY
@ COMMAND_ADD_BUS_ENTRY
Definition: HDBEditorConstants.hh:55
HDB::HDBManager
Definition: HDBManager.hh:82
HDB::HDBManager::addBusEntry
RowID addBusEntry() const
Definition: HDBManager.cc:3393
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
HDBEditorConstants::COMMAND_NAME_ADD_BUS_ENTRY
static const std::string COMMAND_NAME_ADD_BUS_ENTRY
Name of the add new bus entry command.
Definition: HDBEditorConstants.hh:78