1 /*=========================================================================
4 Module: $RCSfile: bbtkBlackBoxOutputConnector.cxx,v $
6 Date: $Date: 2008/04/18 12:59:15 $
7 Version: $Revision: 1.4 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
21 * \brief Class bbtk::BlackBoxOutputConnector :
24 #include "bbtkBlackBoxOutputConnector.h"
25 #include "bbtkMessageManager.h"
26 #include "bbtkBlackBox.h"
27 //#include <algorithm>
32 BlackBoxOutputConnector::BlackBoxOutputConnector()
33 // : mStatus(MODIFIED)
35 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::BlackBoxOutputConnector()"<<std::endl);
38 BlackBoxOutputConnector::~BlackBoxOutputConnector()
40 bbtkDebugMessage("Kernel",9,
41 "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()"
43 ConnectionVector::iterator i;
44 for (i=mConnection.begin();
47 (*i) = Connection::WeakPointer();
48 bbtkDebugMessage("Kernel",9,
49 "<== BlackBoxOutputConnector::~BlackBoxOutputConnector()"
54 void BlackBoxOutputConnector::SetConnection(Connection::Pointer c)
56 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::SetConnection("
58 mConnection.push_back(c);
64 void BlackBoxOutputConnector::UnsetConnection(Connection::Pointer c)
66 bbtkDebugMessageInc("Kernel",9,"BlackBoxOutputConnector::UnsetConnection("
71 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : invalid connection");
75 //Connection::WeakPointer w(c);
76 ConnectionVector::iterator i;
77 // = find(mConnection.begin(),mConnection.end(),c);
78 for (i=mConnection.begin();
82 if (i->lock()==c) break;
84 if (i==mConnection.end())
86 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : connection is absent from connections list");
90 bbtkDebugDecTab("Kernel",9);
95 void BlackBoxOutputConnector::SetModifiedStatus()
97 bbtkDebugMessageInc("Process",5,
98 "BlackBoxOutputConnector::SetModifiedStatus()"
100 ConnectionVector::iterator i;
101 for (i=mConnection.begin();i!=mConnection.end();++i)
103 (*i).lock()->SetModifiedStatus();
106 bbtkDebugDecTab("Process",5);