OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ConnectionEditPart Class Reference

#include <ConnectionEditPart.hh>

Inheritance diagram for ConnectionEditPart:
Inheritance graph
Collaboration diagram for ConnectionEditPart:
Collaboration graph

Public Member Functions

 ConnectionEditPart ()
 
virtual ~ConnectionEditPart ()
 
EditPartsource () const
 
EditParttarget () const
 
void setSource (EditPart *source)
 
void setTarget (EditPart *target)
 
- Public Member Functions inherited from EditPart
 EditPart ()
 
virtual ~EditPart ()
 
void putGarbage (std::set< EditPart * > &trashbag)
 
EditPartparent () const
 
void setParent (EditPart *parent)
 
TTAMachine::MachinePartmodel () const
 
void setModel (TTAMachine::MachinePart *model)
 
Figurefigure () const
 
void setFigure (Figure *figure)
 
EditPartfind (wxPoint point)
 
EditPartfind (const TTAMachine::MachinePart *model)
 
EditPartfindNearest (wxPoint point, const EditPart *exclude=NULL)
 
int findInRange (wxPoint point, float radius, std::vector< EditPart * > &found)
 
bool hasEditPartRecursive (const EditPart *part) const
 
bool selectable () const
 
bool selected () const
 
void setSelectable (bool selectable)
 
void setSelected (bool select)
 
void installEditPolicy (EditPolicy *editpolicy)
 
void addChild (EditPart *child)
 
int childCount () const
 
EditPartchild (unsigned int index) const
 
ComponentCommandperformRequest (Request *request) const
 
bool canHandle (Request *request) const
 

Private Member Functions

ConnectionEditPartoperator= (ConnectionEditPart &old)
 Assignment not allowed. More...
 
 ConnectionEditPart (ConnectionEditPart &old)
 Copying not allowed. More...
 

Private Attributes

EditPartsource_
 Source of connection. More...
 
EditParttarget_
 Target of connection. More...
 

Additional Inherited Members

- Protected Attributes inherited from EditPart
EditPartparent_
 Parent of this EditPart. More...
 
Figurefigure_
 Figure of this EditPart. More...
 
TTAMachine::MachinePartmodel_
 Machine component corresponding to this EditPart. More...
 
bool selectable_
 Tells whether the EditPart is selectable or not. More...
 
bool selected_
 Tells whether the EditPart is selected or not. More...
 
bool garbageCollected_
 Helper member to prevent improper deletion. More...
 
std::vector< EditPolicy * > editPolicies_
 List of supported EditPolicies. More...
 
std::vector< EditPart * > children_
 List of children EditParts. More...
 

Detailed Description

A directed connection between two machine blocks on the canvas.

Definition at line 42 of file ConnectionEditPart.hh.

Constructor & Destructor Documentation

◆ ConnectionEditPart() [1/2]

ConnectionEditPart::ConnectionEditPart ( )

The Constructor.

Definition at line 41 of file ConnectionEditPart.cc.

41  : source_(NULL), target_(NULL) {
42 }

◆ ~ConnectionEditPart()

ConnectionEditPart::~ConnectionEditPart ( )
virtual

The Destructor.

Definition at line 47 of file ConnectionEditPart.cc.

47  {
48 }

◆ ConnectionEditPart() [2/2]

ConnectionEditPart::ConnectionEditPart ( ConnectionEditPart old)
private

Copying not allowed.

Member Function Documentation

◆ operator=()

ConnectionEditPart& ConnectionEditPart::operator= ( ConnectionEditPart old)
private

Assignment not allowed.

◆ setSource()

void ConnectionEditPart::setSource ( EditPart source)

Sets the source of this connection.

Parameters
sourceNew source.

Definition at line 56 of file ConnectionEditPart.cc.

56  {
57  assert(figure_ != NULL);
58  ConnectionFigure* fig = dynamic_cast<ConnectionFigure*>(figure_);
59  assert(fig != NULL);
60  fig->setSource(source->figure());
61  figure_ = fig;
62  source_ = source;
63 }

References assert, EditPart::figure(), EditPart::figure_, ConnectionFigure::setSource(), source(), and source_.

Referenced by MachineEditPartFactory::createBiDirBridge(), SocketPortConnFactory::createConnection(), SocketBusConnFactory::createConnection(), ConnectionFactory::createConnection(), and BridgeFactory::createEditPart().

Here is the call graph for this function:

◆ setTarget()

void ConnectionEditPart::setTarget ( EditPart target)

Sets the target of this connection.

Parameters
targetNew target.

Definition at line 71 of file ConnectionEditPart.cc.

71  {
72  assert(figure_ != NULL);
73  ConnectionFigure* fig = dynamic_cast<ConnectionFigure*>(figure_);
74  assert(fig != NULL);
75  fig->setTarget(target->figure());
76  figure_ = fig;
77  target_ = target;
78 }

References assert, EditPart::figure(), EditPart::figure_, ConnectionFigure::setTarget(), target(), and target_.

Referenced by MachineEditPartFactory::createBiDirBridge(), SocketPortConnFactory::createConnection(), SocketBusConnFactory::createConnection(), ConnectionFactory::createConnection(), and BridgeFactory::createEditPart().

Here is the call graph for this function:

◆ source()

EditPart* ConnectionEditPart::source ( ) const

◆ target()

EditPart* ConnectionEditPart::target ( ) const

Member Data Documentation

◆ source_

EditPart* ConnectionEditPart::source_
private

Source of connection.

Definition at line 60 of file ConnectionEditPart.hh.

Referenced by setSource().

◆ target_

EditPart* ConnectionEditPart::target_
private

Target of connection.

Definition at line 62 of file ConnectionEditPart.hh.

Referenced by setTarget().


The documentation for this class was generated from the following files:
ConnectionFigure
Definition: ConnectionFigure.hh:44
ConnectionEditPart::target_
EditPart * target_
Target of connection.
Definition: ConnectionEditPart.hh:62
EditPart::figure_
Figure * figure_
Figure of this EditPart.
Definition: EditPart.hh:93
ConnectionEditPart::target
EditPart * target() const
ConnectionEditPart::source
EditPart * source() const
assert
#define assert(condition)
Definition: Application.hh:86
EditPart::figure
Figure * figure() const
ConnectionEditPart::source_
EditPart * source_
Source of connection.
Definition: ConnectionEditPart.hh:60
ConnectionFigure::setSource
void setSource(Figure *figure)
ConnectionFigure::setTarget
void setTarget(Figure *figure)