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