]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkConnection.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkConnection.cxx
index 507c6f09b893cea991cf0bb5a2220267209d7293..5f26be0b7b3beb7f7f0bb98a1968dfa0c354af55 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConnection.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 08:29:09 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -142,9 +142,9 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
     mOutput = mOriginalOutput = output;
 
      // Lock this pointer !!!
-    Pointer p = MakePointer(this,true);
-    from->bbConnectOutput(output,p);
-    to->bbConnectInput(input,p);
+    //Pointer p = MakePointer(this,true);
+    from->bbConnectOutput(output,this);
+    to->bbConnectInput(input,this);
 
     
     bbtkDebugMessage("connection",1,"<== Connection::Connection(\""
@@ -168,12 +168,11 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                     <<GetFullName()<<"]"<<std::endl);
 
     if (mAdaptor) mAdaptor.reset();
-    mOriginalFrom.reset();
-    mOriginalTo.reset();
     if (mFrom!=0) 
       {
-       mFrom->bbDisconnectOutput(mOutput,
-                                 GetThisPointer<Connection>());
+       mFrom->bbDisconnectOutput(mOutput,this);
+       //                                GetThisPointer<Connection>());
+       mFrom.reset();
       }
     else 
       {
@@ -181,15 +180,14 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
       }
     if (mTo!=0) 
       {
-       mTo->bbDisconnectInput(mInput,
-                              GetThisPointer<Connection>());
+       mTo->bbDisconnectInput(mInput,this);//   GetThisPointer<Connection>());
+       mTo.reset();
       }
     else 
       {
        bbtkInternalError("Connection::~Connection() : invalid final box pointer");
       }
-   mFrom.reset();
-    mTo.reset();
+
 
     bbtkDebugMessage("object",2,
                     "<== Connection::~Connection() ["
@@ -422,18 +420,19 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
        bbtkMessage("debug",2," - From : Output '"<<mOutput
                    <<"' is in OutputConnectorMap"<<std::endl);
 
-        std::vector< Connection::WeakPointer >::const_iterator j;
+        std::vector< Connection* >::const_iterator j;
+       /*
        for (j  = i->second->GetConnectionVector().begin();
             j != i->second->GetConnectionVector().end();
             ++j)
          {
-           if ((*j).lock()==GetThisPointer<Connection>()) break;
+           if ((*j)==this) break;
          }
-       /*
+       */
        j = find(i->second->GetConnectionVector().begin(),
                 i->second->GetConnectionVector().end(),
-                GetThisPointer<Connection>());
-       */
+                this);
+       
        if (j==i->second->GetConnectionVector().end())
          {
            bbtkError("** Checking Connection "<<(void*)this