X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..d111eaf49741a0a79d372445f97c314a637e331e:/AbstractBlock.cpp?ds=inline diff --git a/AbstractBlock.cpp b/AbstractBlock.cpp index 6e9cc86..87c973c 100644 --- a/AbstractBlock.cpp +++ b/AbstractBlock.cpp @@ -16,18 +16,8 @@ AbstractBlock::AbstractBlock(const QString& _name) { AbstractBlock::~AbstractBlock() { - foreach(AbstractInterface* iface, inputs) { - delete iface; - } - foreach(AbstractInterface* iface, outputs) { - delete iface; - } - foreach(AbstractInterface* iface, bidirs) { - delete iface; - } - inputs.clear(); - outputs.clear(); - bidirs.clear(); + removeAllInterfaces(); + foreach(BlockParameter* p, params) { delete p; } @@ -54,6 +44,14 @@ bool AbstractBlock::isGroupBlock() { return false; } +bool AbstractBlock::isTopGroupBlock() { + return false; +} + +bool AbstractBlock::isSourceBlock() { + return false; +} + void AbstractBlock::addParameter(BlockParameter *param) { params.append(param); } @@ -90,6 +88,23 @@ void AbstractBlock::removeInterface(AbstractInterface *inter) { delete inter; } +void AbstractBlock::removeAllInterfaces() { + + foreach(AbstractInterface* iface, inputs) { + delete iface; + } + foreach(AbstractInterface* iface, outputs) { + delete iface; + } + foreach(AbstractInterface* iface, bidirs) { + delete iface; + } + inputs.clear(); + outputs.clear(); + bidirs.clear(); + +} + void AbstractBlock::defineBlockParam(BlockParameter *param) { cout << "definition of param : " << param->getName().toStdString() << endl; @@ -112,6 +127,16 @@ QList AbstractBlock::getInterfaces() { return list; } +QList AbstractBlock::getDataInputs() { + QList list; + foreach(AbstractInterface* iface, inputs) { + if (iface->getPurpose() == AbstractInterface::Data) { + list.append(iface); + } + } + return list; +} + AbstractInterface* AbstractBlock::getIfaceFromName(QString name) { foreach(AbstractInterface* iface, inputs) {