1 /*=========================================================================
3 Module: $RCSfile: bbtkBlackBoxOutputConnector.cxx,v $
5 Date: $Date: 2008/10/17 08:18:12 $
6 Version: $Revision: 1.8 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
34 * \brief Class bbtk::BlackBoxOutputConnector :
37 #include "bbtkBlackBoxOutputConnector.h"
38 #include "bbtkMessageManager.h"
39 #include "bbtkBlackBox.h"
40 //#include <algorithm>
45 BlackBoxOutputConnector::BlackBoxOutputConnector()
46 // : mStatus(MODIFIED)
48 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::BlackBoxOutputConnector()"<<std::endl);
51 BlackBoxOutputConnector::~BlackBoxOutputConnector()
53 bbtkDebugMessage("Kernel",9,
54 "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()"
57 ConnectionVector::iterator i;
58 for (i=mConnection.begin();
61 (*i) = Connection::WeakPointer();
64 bbtkDebugMessage("Kernel",9,
65 "<== BlackBoxOutputConnector::~BlackBoxOutputConnector()"
70 void BlackBoxOutputConnector::SetConnection(Connection* c)
72 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::SetConnection("
74 mConnection.push_back(c);
80 void BlackBoxOutputConnector::UnsetConnection(Connection* c)
82 bbtkDebugMessageInc("Kernel",9,"BlackBoxOutputConnector::UnsetConnection("
87 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : invalid connection");
91 //Connection::WeakPointer w(c);
92 ConnectionVector::iterator i;
93 // = find(mConnection.begin(),mConnection.end(),c);
94 for (i=mConnection.begin();
100 if (i==mConnection.end())
102 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : connection is absent from connections list");
104 mConnection.erase(i);
106 bbtkDebugDecTab("Kernel",9);
111 void BlackBoxOutputConnector::SetModifiedStatus()
113 bbtkDebugMessage("modified",2,
114 "==> BlackBoxOutputConnector::SetModifiedStatus() ["
117 ConnectionVector::iterator i;
118 for (i=mConnection.begin();i!=mConnection.end();++i)
120 (*i)->SetModifiedStatus();