OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FullyConnectBussesCmd Class Reference

#include <FullyConnectBussesCmd.hh>

Inheritance diagram for FullyConnectBussesCmd:
Inheritance graph
Collaboration diagram for FullyConnectBussesCmd:
Collaboration graph

Public Member Functions

 FullyConnectBussesCmd ()
 
virtual ~FullyConnectBussesCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual FullyConnectBussesCmdcreate () const
 
virtual bool isEnabled ()
 
virtual std::string shortName () const
 
- Public Member Functions inherited from EditorCommand
 EditorCommand (std::string name, wxWindow *parent=NULL)
 
virtual ~EditorCommand ()
 
void setView (wxView *view)
 
wxView * view () const
 
virtual std::string icon () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

Command for connecting all sockets to all busses.

Definition at line 49 of file FullyConnectBussesCmd.hh.

Constructor & Destructor Documentation

◆ FullyConnectBussesCmd()

FullyConnectBussesCmd::FullyConnectBussesCmd ( )

The Constructor.

Definition at line 60 of file FullyConnectBussesCmd.cc.

60 :
62}
static const std::string CMD_NAME_FULLY_CONNECT_BUSSES
Command name for the "Fully connect busses" command.

Referenced by create().

◆ ~FullyConnectBussesCmd()

FullyConnectBussesCmd::~FullyConnectBussesCmd ( )
virtual

The Destructor.

Definition at line 68 of file FullyConnectBussesCmd.cc.

68{}

Member Function Documentation

◆ create()

FullyConnectBussesCmd * FullyConnectBussesCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 108 of file FullyConnectBussesCmd.cc.

108 {
109 return new FullyConnectBussesCmd();
110}

References FullyConnectBussesCmd().

Here is the call graph for this function:

◆ Do()

bool FullyConnectBussesCmd::Do ( )
virtual

Executes the command.

Returns
True, if the command was succesfully executed, false otherwise.

Implements GUICommand.

Definition at line 77 of file FullyConnectBussesCmd.cc.

77 {
78
79 assert(view() != NULL);
80
81 Model* model = dynamic_cast<MDFDocument*>(
82 view()->GetDocument())->getModel();
83
84 model->pushToStack();
85
86 Machine& machine = *model->getMachine();
87
88 FullyConnectedCheck checker;
89 checker.fix(machine);
90
91 model->notifyObservers();
92 return true;
93}
#define assert(condition)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
wxView * view() const
virtual std::string fix(TTAMachine::Machine &mach) const
Definition Model.hh:50
void pushToStack()
Definition Model.cc:167
void notifyObservers(bool modified=true)
Definition Model.cc:152
TTAMachine::Machine * getMachine()
Definition Model.cc:88

References assert, FullyConnectedCheck::fix(), Model::getMachine(), machine, Model::notifyObservers(), Model::pushToStack(), and EditorCommand::view().

Here is the call graph for this function:

◆ id()

int FullyConnectBussesCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 99 of file FullyConnectBussesCmd.cc.

References ProDeConstants::COMMAND_FULLY_CONNECT_BUSSES.

◆ isEnabled()

bool FullyConnectBussesCmd::isEnabled ( )
virtual

Returns true when the command is executable, false when not.

This command is executable when a document is open.

Returns
True, if a document is open.

Reimplemented from EditorCommand.

Definition at line 130 of file FullyConnectBussesCmd.cc.

130 {
131
132 wxDocManager* manager = wxGetApp().docManager();
133 wxView* view = manager->GetCurrentView();
134
135 if (view == NULL) {
136 return false;
137 }
138
139 Model* model = dynamic_cast<MDFDocument*>(
140 view->GetDocument())->getModel();
141
142 if (model == NULL) {
143 return false;
144 }
145
146 FullyConnectedCheck checker;
147 MachineCheckResults results;
148 if (!checker.check(*model->getMachine(), results)) {
149 return checker.canFix(*model->getMachine());
150 } else {
151 return false;
152 }
153}
virtual bool check(const TTAMachine::Machine &mach) const
virtual bool canFix(const TTAMachine::Machine &mach) const

References FullyConnectedCheck::canFix(), FullyConnectedCheck::check(), Model::getMachine(), and EditorCommand::view().

Here is the call graph for this function:

◆ shortName()

string FullyConnectBussesCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 117 of file FullyConnectBussesCmd.cc.

117 {
119}
static const std::string CMD_SNAME_FULLY_CONNECT_BUSSES
Command name for the "Fully connect busses" command.

References ProDeConstants::CMD_SNAME_FULLY_CONNECT_BUSSES.


The documentation for this class was generated from the following files: