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);
}
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()
bbtkDebugMessageInc("Process",4,"BlackBoxInputConnector::BackwardUpdate()"
<<std::endl);
- if (mConnection)
+ if (mConnection.lock())
{
- IOStatus s = mConnection->BackwardUpdate();
+ IOStatus s = mConnection.lock()->BackwardUpdate();
mStatus = s;
}
else