1 #ifndef __CONNECTEDINTERFACE_H__
2 #define __CONNECTEDINTERFACE_H__
9 #include "AbstractInterface.h"
10 class ReferenceInterface;
12 #include "Exception.h"
18 * \brief The ConnectedInterface class represents an interface of block (functional or group) that may be connected from/to other interfaces
19 * A ConnectedInterface is used to establish connection between blocks.
21 class ConnectedInterface : public AbstractInterface {
25 ConnectedInterface(AbstractBlock* _owner);
26 ConnectedInterface(AbstractBlock* _owner, const QString& _name, const QString& _type, const QString& _width, int _direction, int _purpose);
28 inline QList<ConnectedInterface*> getConnectedTo() { return connectedTo;}
29 inline ConnectedInterface* getConnectedFrom() { return connectedFrom;}
34 inline bool isConnectedTo(){return connectedTo.length() != 0;}
35 inline bool isConnectedFrom(){return connectedFrom != NULL;}
36 virtual bool canConnectTo(AbstractInterface* iface) = 0;
37 virtual bool canConnectFrom(AbstractInterface* iface) = 0;
40 void connectTo(ConnectedInterface* iface);
41 void disconnectTo(ConnectedInterface* iface);
42 //bool connectFrom(ConnectedInterface* iface);
43 ConnectedInterface* getConnectionToParentGroup();
44 ConnectedInterface* getConnectionFromParentGroup();
46 virtual AbstractInterface *clone() = 0;
47 void removeConnectedTo(ConnectedInterface *inter);
49 virtual void clearConnectedTo();
50 inline void clearConnectedFrom() { connectedFrom = NULL; }
51 virtual void clearConnections();
52 //virtual void connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception) = 0;
56 * \brief connectedTo lists of connections to interfaces owned by other blocks (functional or group)
57 * Since the graph is oriented, and taking into account it modles a FPGA desing,
58 * this interface may be connected to several interfaces owned by other blocks (functional or group).
59 * connectedTo references such interfaces if they exist.
61 QList<ConnectedInterface*> connectedTo;
63 * \brief connectedFrom connection from an interface owned by another blocks (functional or group)
64 * Since the graph is oriented, and taking into account it modles a FPGA desing,
65 * there may be a single interface owned by another block (functional or group) that is connected to
66 * this interface. connecteFrom references such an interface if it exists.
68 ConnectedInterface* connectedFrom;
72 #endif // __CONNECTEDINTERFACE_H__