1 #ifndef __FUNCTIONALINTERFACE_H__
\r
2 #define __FUNCTIONALINTERFACE_H__
\r
9 #include "ConnectedInterface.h"
\r
10 class ReferenceInterface;
\r
12 #include "Exception.h"
\r
14 using namespace std;
\r
20 - A FunctionalInterface instance can be obtained by:
\r
21 - cloning an existing ReferenceInterface when a new functionalBlock is created by cloning a ReferenceBlock
\r
22 - cloning an existing FunctionalInterface when its reference has a multiplicity > 1
\r
24 - For an Input, the list connectedFrom can contain ONLY ONE element
\r
25 - For an Output, the list connectedTo can contain several element
\r
26 - If connectedTo contains something, then connectedFrom is NULL
\r
27 - If connectedFrom contains something, the connectedTo is empty.
\r
30 class FunctionalInterface : public ConnectedInterface {
\r
33 FunctionalInterface();
\r
34 FunctionalInterface(AbstractBlock* _owner, ReferenceInterface* _reference) throw(Exception); // create a default interface (see AbstractInterface)
\r
37 inline ReferenceInterface* getReference() { return reference; }
\r
38 inline QList<char> getConsumptionPattern() { return consumptionPattern; }
\r
39 inline QList<char> getProductionPattern() { return productionPattern; }
\r
42 inline void setConsumptionPattern(QList<char> pattern) { consumptionPattern = pattern; }
\r
43 inline void setProductionPattern(QList<char> pattern) { productionPattern = pattern; }
\r
46 bool isFunctionalInterface();
\r
47 bool canConnectTo(AbstractInterface* iface);
\r
48 bool canConnectFrom(AbstractInterface* iface);
\r
52 AbstractInterface* clone();
\r
54 void connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception);
\r
55 int getInterfaceMultiplicity();
\r
59 ReferenceInterface* reference;
\r
62 QList<char> consumptionPattern; //! only usefull for input interfaces
\r
63 QList<char> productionPattern; //! only usefull for output interfaces
\r
66 #endif // __FUNCTIONALINTERFACE_H__
\r