OpenASIP
2.0
|
#include <MachineEditPartFactory.hh>
Public Member Functions | |
MachineEditPartFactory (EditPolicyFactory &editPolicyFactory) | |
virtual | ~MachineEditPartFactory () |
virtual EditPart * | createEditPart (TTAMachine::MachinePart *component) |
EditPart * | createEditPart (TTAMachine::Machine *machine) |
Public Member Functions inherited from EditPartFactory | |
virtual | ~EditPartFactory () |
void | registerFactory (Factory *factory) |
Public Member Functions inherited from Factory | |
virtual | ~Factory () |
Private Member Functions | |
MachineEditPartFactory & | operator= (MachineEditPartFactory &old) |
Assignment not allowed. More... | |
MachineEditPartFactory (MachineEditPartFactory &old) | |
Copying not allowed. More... | |
EditPart * | getUnits (TTAMachine::Machine *machine) |
EditPart * | getSockets (TTAMachine::Machine *machine) |
EditPart * | getBusChains (TTAMachine::Machine *machine) |
ConnectionEditPart * | createBiDirBridge (ConnectionEditPart *bridge, TTAMachine::Bridge *opposite) |
void | findConnectedBridges (ConnectionEditPart *&bridgeEditPart, ConnectionEditPart *&biDirBridge, std::vector< TTAMachine::Bridge * > &bridges, TTAMachine::Bus *bus) |
bool | connected (const TTAMachine::Bridge *bridge, const TTAMachine::Bus *bus1, const TTAMachine::Bus *bus2) |
Additional Inherited Members | |
Protected Member Functions inherited from EditPartFactory | |
EditPartFactory (EditPolicyFactory &editPolicyFactory) | |
EditPart * | checkCache (const TTAMachine::MachinePart *component) const |
void | writeToCache (EditPart *editPart) |
Protected Member Functions inherited from Factory | |
Factory () | |
Protected Attributes inherited from EditPartFactory | |
std::vector< Factory * > | factories_ |
Registered factories. More... | |
EditPolicyFactory & | editPolicyFactory_ |
Factory which creates edit policies for edit parts. More... | |
Static Protected Attributes inherited from EditPartFactory | |
static std::vector< EditPart * > | created_ |
Container for already created EditParts. More... | |
Factory for creating EditParts from any Machine component or the Machine itself.
Definition at line 55 of file MachineEditPartFactory.hh.
|
explicit |
The Constructor.
Definition at line 73 of file MachineEditPartFactory.cc.
References EditPartFactory::registerFactory().
|
virtual |
|
private |
Copying not allowed.
|
private |
Tells whether a bridge is connected to two specific buses.
bridge | The bridge. |
bus1 | One bus. |
bus2 | The other bus. |
Definition at line 415 of file MachineEditPartFactory.cc.
References TTAMachine::Bridge::destinationBus(), and TTAMachine::Bridge::sourceBus().
Referenced by findConnectedBridges().
|
private |
Creates an EditPart for a bidirectional bridge.
bridge | EditPart representing one of the bridges. |
opposite | The opposite bridge. |
Definition at line 340 of file MachineEditPartFactory.cc.
References EditPart::addChild(), EditPolicyFactory::createBridgeEditPolicy(), createEditPart(), BridgeFigure::DIR_BIDIR, EditPartFactory::editPolicyFactory_, EditPart::installEditPolicy(), EditPart::model(), BridgeFigure::setDirection(), EditPart::setFigure(), EditPart::setModel(), EditPart::setSelectable(), ConnectionEditPart::setSource(), ConnectionEditPart::setTarget(), ConnectionEditPart::source(), and ConnectionEditPart::target().
Referenced by findConnectedBridges().
EditPart * MachineEditPartFactory::createEditPart | ( | TTAMachine::Machine * | machine | ) |
Overloaded implementation for creating the contents EditPart from the machine.
machine | Machine to create the EditPart from. |
Definition at line 130 of file MachineEditPartFactory.cc.
References EditPart::addChild(), getBusChains(), getSockets(), getUnits(), machine, and EditPart::setFigure().
|
virtual |
Delegates to registered factories to create the EditPart.
component | Component of which to create the corresponding EditPart. |
Implements Factory.
Definition at line 101 of file MachineEditPartFactory.cc.
References EditPartFactory::checkCache(), EditPartFactory::factories_, and EditPartFactory::writeToCache().
Referenced by createBiDirBridge(), findConnectedBridges(), getBusChains(), getSockets(), getUnits(), and MachineCanvas::updateMachine().
|
private |
Finds and returns the bridge or bridges that are connected to a bus.
bridgeEditPart | Where to store one bridge, no change if no bridge found. |
biDirBridge | Where to store the other bridge, no change if no other bridge found. |
bridges | Which bridges to search. |
bus | Bus to which the searched bridges should be connected. |
Definition at line 377 of file MachineEditPartFactory.cc.
References connected(), createBiDirBridge(), createEditPart(), and TTAMachine::Bus::nextBus().
Referenced by getBusChains().
|
private |
Navigates through the machine and creates a bus container EditPart.
Returns a NULL pointer if there are no buses in the given machine.
machine | Machine to navigate through. |
Definition at line 239 of file MachineEditPartFactory.cc.
References EditPart::addChild(), assert, TTAMachine::Machine::bridgeNavigator(), TTAMachine::Machine::busNavigator(), ContainerTools::containsValue(), TTAMachine::Machine::Navigator< ComponentType >::count(), createEditPart(), findConnectedBridges(), TTAMachine::Bus::hasNextBus(), TTAMachine::Bus::hasPreviousBus(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Bus::nextBus(), TTAMachine::Bus::previousBus(), and EditPart::setFigure().
Referenced by createEditPart().
|
private |
Navigates through the machine and creates a socket container EditPart.
Returns a NULL pointer if there are no sockets in the given machine.
machine | Machine to navigate through. |
Definition at line 208 of file MachineEditPartFactory.cc.
References EditPart::addChild(), assert, TTAMachine::Machine::Navigator< ComponentType >::count(), createEditPart(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, EditPart::setFigure(), and TTAMachine::Machine::socketNavigator().
Referenced by createEditPart().
|
private |
Navigates through the machine and creates a unit container EditPart.
Returns a NULL pointer if there are no units in the given machine.
machine | Machine to navigate through. |
Definition at line 152 of file MachineEditPartFactory.cc.
References EditPart::addChild(), assert, TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), createEditPart(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Machine::registerFileNavigator(), and EditPart::setFigure().
Referenced by createEditPart().
|
private |
Assignment not allowed.