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 bool connectTo(ConnectedInterface* iface);
41 bool connectFrom(ConnectedInterface* iface);
42 ConnectedInterface* getConnectionToParentGroup();
43 ConnectedInterface* getConnectionFromParentGroup();
45 virtual AbstractInterface *clone() = 0;
46 void removeConnectedTo(ConnectedInterface *inter);
48 virtual void clearConnectedTo();
49 inline void clearConnectedFrom() { connectedFrom = NULL; }
50 virtual void clearConnections();
51 //virtual void connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception) = 0;
55 * \brief connectedTo lists of connections to interfaces owned by other blocks (functional or group)
56 * Since the graph is oriented, and taking into account it modles a FPGA desing,
57 * this interface may be connected to several interfaces owned by other blocks (functional or group).
58 * connectedTo references such interfaces if they exist.
60 QList<ConnectedInterface*> connectedTo;
62 * \brief connectedFrom connection from an interface owned by another blocks (functional or group)
63 * Since the graph is oriented, and taking into account it modles a FPGA desing,
64 * there may be a single interface owned by another block (functional or group) that is connected to
65 * this interface. connecteFrom references such an interface if it exists.
67 ConnectedInterface* connectedFrom;
71 #endif // __CONNECTEDINTERFACE_H__