]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBoxInputConnector.cxx
=== MAJOR RELEASE ====
[bbtk.git] / kernel / src / bbtkBlackBoxInputConnector.cxx
index 9269ec1d1f235767faca011893777a6847fded88..1bbde7331d0a0d202ed8821a029a4b9e2cb8d5df 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxInputConnector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/05 13:23:46 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/04/18 12:59:15 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
  */
 #include "bbtkBlackBoxInputConnector.h"
 #include "bbtkMessageManager.h"
+#include "bbtkBlackBox.h"
 
 namespace bbtk
 {
-  BlackBoxInputConnector::BlackBoxInputConnector(BlackBox* b)  
-    : mBox(b), mConnection(0), mStatus(MODIFIED)
+  BlackBoxInputConnector::BlackBoxInputConnector(BlackBox::Pointer b)  
+    : mBox(b), mConnection(), mStatus(MODIFIED)
   {
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::BlackBoxInputConnector()"<<std::endl);
   }
@@ -35,21 +36,20 @@ namespace bbtk
   BlackBoxInputConnector::~BlackBoxInputConnector() 
   {
     bbtkDebugMessageInc("Kernel",9,"BlackBoxInputConnector::~BlackBoxInputConnector()"<<std::endl);
-    if (mConnection) delete mConnection;
     bbtkDebugDecTab("Kernel",9);
   }
   
-  void BlackBoxInputConnector::SetConnection(Connection* c) 
+  void BlackBoxInputConnector::SetConnection(Connection::Pointer c) 
   { 
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::SetConnection("<<c<<")"<<std::endl);
     mConnection = c; 
   }
   
-  void BlackBoxInputConnector::UnsetConnection(Connection* c) 
+  void BlackBoxInputConnector::UnsetConnection(Connection::Pointer c) 
   { 
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::UnsetConnection("
                     <<c<<")"<<std::endl);
-    mConnection = 0; 
+    mConnection.reset();
   }
   
   IOStatus BlackBoxInputConnector::BackwardUpdate()
@@ -57,9 +57,9 @@ namespace bbtk
     bbtkDebugMessageInc("Process",4,"BlackBoxInputConnector::BackwardUpdate()"
                        <<std::endl);
 
-    if (mConnection) 
+    if (mConnection.lock()
       {
-       IOStatus s = mConnection->BackwardUpdate();
+       IOStatus s = mConnection.lock()->BackwardUpdate();
        mStatus = s;
       }
     else