1 #ifndef __CONNECTEDINTERFACE_H__
2 #define __CONNECTEDINTERFACE_H__
9 #include "AbstractInterface.h"
10 class ReferenceInterface;
12 #include "Exception.h"
18 class ConnectedInterface : public AbstractInterface {
22 ConnectedInterface(AbstractBlock* _owner);
23 ConnectedInterface(AbstractBlock* _owner, const QString& _name, const QString& _type, const QString& _width, int _direction, int _purpose);
25 inline QList<ConnectedInterface*> getConnectedTo() { return connectedTo;}
26 inline ConnectedInterface* getConnectedFrom() { return connectedFrom;}
31 inline bool isConnectedTo(){return connectedTo.length() != 0;}
32 inline bool isConnectedFrom(){return connectedFrom != NULL;}
33 virtual bool canConnectTo(AbstractInterface* iface) = 0;
34 virtual bool canConnectFrom(AbstractInterface* iface) = 0;
37 bool connectTo(ConnectedInterface* iface);
38 bool connectFrom(ConnectedInterface* iface);
39 ConnectedInterface* getConnectionToParentGroup();
40 ConnectedInterface* getConnectionFromParentGroup();
42 virtual AbstractInterface *clone() = 0;
44 void removeConnectedTo(ConnectedInterface *inter);
46 virtual void clearConnectedTo();
47 inline void clearConnectedFrom() { connectedFrom = NULL; }
48 virtual void clearConnections();
49 //virtual void connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception) = 0;
52 QList<ConnectedInterface*> connectedTo;
53 ConnectedInterface* connectedFrom;
58 #endif // __CONNECTEDINTERFACE_H__