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);
29 inline QList<ConnectedInterface*> getConnectedTo() { return connectedTo;}
30 inline ConnectedInterface* getConnectedFrom() { return connectedFrom;}
31 inline QList<char> getOutputPattern() { return outputPattern; }
34 inline void setOutputPattern(QList<char> pattern) { outputPattern = pattern; }
37 inline bool isConnectedTo(){return connectedTo.length() != 0;}
38 inline bool isConnectedFrom(){return connectedFrom != NULL;}
39 virtual bool canConnectTo(AbstractInterface* iface) = 0;
40 virtual bool canConnectFrom(AbstractInterface* iface) = 0;
43 void connectTo(ConnectedInterface* iface);
44 void disconnectTo(ConnectedInterface* iface);
45 //bool connectFrom(ConnectedInterface* iface);
46 ConnectedInterface* getConnectionToParentGroup();
47 ConnectedInterface* getConnectionFromParentGroup();
49 virtual AbstractInterface *clone() = 0;
50 void removeConnectedTo(ConnectedInterface *inter);
52 virtual void clearConnectedTo();
53 inline void clearConnectedFrom() { connectedFrom = NULL; }
54 virtual void clearConnections();
55 //virtual void connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception) = 0;
59 * \brief connectedTo lists of connections to interfaces owned by other blocks (functional or group)
60 * Since the graph is oriented, and taking into account it modles a FPGA desing,
61 * this interface may be connected to several interfaces owned by other blocks (functional or group).
62 * connectedTo references such interfaces if they exist.
64 QList<ConnectedInterface*> connectedTo;
66 * \brief connectedFrom connection from an interface owned by another blocks (functional or group)
67 * Since the graph is oriented, and taking into account it modles a FPGA desing,
68 * there may be a single interface owned by another block (functional or group) that is connected to
69 * this interface. connecteFrom references such an interface if it exists.
71 ConnectedInterface* connectedFrom;
74 QList<char> outputPattern; //! only usefull for output interfaces
78 #endif // __CONNECTEDINTERFACE_H__