X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkConnection.cxx;fp=kernel%2Fsrc%2FbbtkConnection.cxx;h=b3ce70a0b00256df328d49f41fd87df6922cd0b0;hb=e6b2de923e0e69c303c7d18fb8a5c1970541bb3a;hp=4a6b7059e426b6db6e9a90df2c4b6becb6ddfd47;hpb=97b08ef9b0c2a60c4d1f619f6bfef2996afdcab3;p=bbtk.git diff --git a/kernel/src/bbtkConnection.cxx b/kernel/src/bbtkConnection.cxx index 4a6b705..b3ce70a 100644 --- a/kernel/src/bbtkConnection.cxx +++ b/kernel/src/bbtkConnection.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkConnection.cxx,v $ Language: C++ - Date: $Date: 2008/04/25 13:37:48 $ - Version: $Revision: 1.13 $ + Date: $Date: 2008/07/25 07:44:12 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -27,6 +27,7 @@ namespace bbtk { + //================================================================== Connection::Pointer Connection::New(BlackBox::Pointer from, const std::string& output, BlackBox::Pointer to, @@ -45,6 +46,7 @@ namespace bbtk <bbConnectInput(input,this); + bbtkDebugMessage("connection",1,"<== Connection::Connection(\"" + <bbGetFullName()<<"\",\""<bbGetFullName()<<"\",\""< Connection::Connection(\"" + <bbGetName()<<"\",\""<bbGetName()<<"\",\""< Connection::Connection(\"" + <bbGetName()<<"\",\""<bbGetName()<<"\",\""<bbGetName()<<"\",\""<bbGetName()<<"\",\""< Connection::Connection(\"" + <bbGetName()<<"\",\""<bbGetName()<<"\",\""< Connection::Connection(\"" + <bbGetFullName()<<"\",\""<bbGetFullName()<<"\",\""<bbHasOutput(output) ) + { + bbtkError("The box \""<bbGetTypeName()<< + "\" has no output \""<bbHasInput(input) ) + { + bbtkError("The box \""<bbGetTypeName()<< + "\" has no input \""<bbGetInputConnectorMap().find(input)->second->IsConnected()) + { + bbtkError("The input \""<bbGetName() + <<"\" is already connected"); + } + + // std::string t1 ( from->bbGetOutputType(output).name() ); + // std::string t2 ( to->bbGetInputType(input).name() ); + // if //( t1 != t2 ) + if ( from->bbGetOutputType(output) != + to->bbGetInputType(input) ) + { + if ( from->bbGetOutputType(output) == typeid(Data) ) + { + bbtkWarning("Connection '" + <bbGetName()<<"."<() + <<"> : type compatibility with '" + <bbGetName()<<"."<bbGetInputType(input) == typeid(Data) ) + { + bbtkDebugMessage("Kernel",8," -> '"<()<<" : can receive any data" + <bbConnectOutput(output,this); + to->bbConnectInput(input,this); + + bbtkDebugMessage("connection",1,"<== Connection::Connection(\"" <bbGetFullName()<<"\",\""<bbGetFullName()<<"\",\""<