X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkConnection.cxx;h=8d60b38699afa0f73b65fa34d6243c95155a5d09;hb=6bfa05367895a6a7cdb78e708a080818c314e906;hp=ff8bd77d3940f0f0bd6343d971ea85528e463c34;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/kernel/src/bbtkConnection.cxx b/kernel/src/bbtkConnection.cxx index ff8bd77..8d60b38 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/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/03/18 12:51:26 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -32,12 +32,14 @@ namespace bbtk /// Ctor with the black box from and to and their input and output. /// Check the input and output compatibility Connection::Connection(BlackBox* from, const std::string& output, - BlackBox* to, const std::string& input ) + BlackBox* to, const std::string& input , + const Factory* f ) : mAdaptor(0), + mFactory(f), mFromAny(false), mToAny(false) { - bbtkDebugMessageInc("Core",7,"Connection::Connection(\"" + bbtkDebugMessageInc("Kernel",7,"Connection::Connection(\"" <bbGetName()<<"\",\""<bbGetName()<<"\",\""<bbGetInputConnectorMap().find(input)->second->IsConnected()) { - bbtkError("The input \""<bbGetTypeName() + bbtkError("The input \""<bbGetName() <<"\" is already connected"); } @@ -86,7 +88,7 @@ namespace bbtk } else if ( to->bbGetInputType(input) == typeid(Data) ) { - bbtkDebugMessage("Core",8," -> '"< '"<()<<" : can receive any data" <bbGetName() + "." + output + "-" + to->bbGetName() + "." + input; - mAdaptor = NewAdaptor(from->bbGetOutputType(output), + mAdaptor = mFactory->NewAdaptor(from->bbGetOutputType(output), to->bbGetInputType(input), name); if (!mAdaptor) @@ -115,7 +117,7 @@ namespace bbtk from->bbConnectOutput(output,this); to->bbConnectInput(input,this); - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -125,7 +127,7 @@ namespace bbtk /// Dtor Connection::~Connection() { - bbtkDebugMessageInc("Core",7, + bbtkDebugMessageInc("Kernel",7, "Connection::~Connection() [" <bbDisconnectInput(mInput,this); if (mAdaptor) mAdaptor->bbDelete(); - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -229,7 +231,7 @@ namespace bbtk bbtk::BlackBox* adaptor = 0; try { - adaptor = NewAdaptor(mFrom->bbGetOutput(mOutput).type(), + adaptor = mFactory->NewAdaptor(mFrom->bbGetOutput(mOutput).type(), mTo->bbGetInputType(mInput), ""); }