bbtkBlackBoxOutputConnector.cxx

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkBlackBoxOutputConnector.cxx,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:12 $
00006   Version:   $Revision: 1.8 $
00007 =========================================================================*/
00008 
00009 /* ---------------------------------------------------------------------
00010 
00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
00013 *
00014 *  This software is governed by the CeCILL-B license under French law and 
00015 *  abiding by the rules of distribution of free software. You can  use, 
00016 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
00017 *  license as circulated by CEA, CNRS and INRIA at the following URL 
00018 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
00019 *  or in the file LICENSE.txt.
00020 *
00021 *  As a counterpart to the access to the source code and  rights to copy,
00022 *  modify and redistribute granted by the license, users are provided only
00023 *  with a limited warranty  and the software's author,  the holder of the
00024 *  economic rights,  and the successive licensors  have only  limited
00025 *  liability. 
00026 *
00027 *  The fact that you are presently reading this means that you have had
00028 *  knowledge of the CeCILL-B license and that you accept its terms.
00029 * ------------------------------------------------------------------------ */                                                                         
00030 
00031 
00037 #include "bbtkBlackBoxOutputConnector.h"
00038 #include "bbtkMessageManager.h"
00039 #include "bbtkBlackBox.h"
00040 //#include <algorithm>
00041 
00042 namespace bbtk
00043 {
00044 
00045   BlackBoxOutputConnector::BlackBoxOutputConnector() 
00046   // : mStatus(MODIFIED)
00047   {
00048     bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::BlackBoxOutputConnector()"<<std::endl);
00049   }
00050 
00051   BlackBoxOutputConnector::~BlackBoxOutputConnector() 
00052   {
00053     bbtkDebugMessage("Kernel",9,
00054                      "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()"
00055                      <<std::endl);
00056     /*
00057     ConnectionVector::iterator i;
00058     for (i=mConnection.begin();
00059          i!=mConnection.end();
00060          ++i)
00061       (*i) = Connection::WeakPointer();
00062     */
00063     mConnection.clear();
00064     bbtkDebugMessage("Kernel",9,
00065                      "<== BlackBoxOutputConnector::~BlackBoxOutputConnector()"
00066                      <<std::endl);
00067   }
00068 
00070   void BlackBoxOutputConnector::SetConnection(Connection* c)
00071   {
00072     bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::SetConnection("
00073                      <<c<<")"<<std::endl);
00074     mConnection.push_back(c);
00075   }
00076 
00077 
00078 
00080   void BlackBoxOutputConnector::UnsetConnection(Connection* c)
00081   {
00082     bbtkDebugMessageInc("Kernel",9,"BlackBoxOutputConnector::UnsetConnection("
00083                      <<c<<")"<<std::endl);
00084 
00085     if (!c) 
00086       {
00087         bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : invalid connection");
00088 
00089       }
00090     //    c->Check();
00091     //Connection::WeakPointer w(c);
00092     ConnectionVector::iterator i;
00093     //  = find(mConnection.begin(),mConnection.end(),c);
00094     for (i=mConnection.begin();
00095          i!=mConnection.end();
00096          ++i)
00097       {
00098         if (*i==c) break;
00099       }
00100     if (i==mConnection.end())
00101       {
00102         bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : connection is absent from connections list");
00103       }
00104     mConnection.erase(i);
00105 
00106     bbtkDebugDecTab("Kernel",9);
00107   }
00108 
00109 
00110   
00111   void BlackBoxOutputConnector::SetModifiedStatus()
00112   {
00113     bbtkDebugMessage("modified",2,
00114                      "==> BlackBoxOutputConnector::SetModifiedStatus() ["
00115                      <<this<<"]"
00116                      <<std::endl);
00117     ConnectionVector::iterator i;
00118     for (i=mConnection.begin();i!=mConnection.end();++i) 
00119       {
00120         (*i)->SetModifiedStatus();
00121       }
00122     
00123     
00124    }
00125  
00126 
00127 
00128 }
00129 // namespace bbtk
00130 

Generated on Wed Nov 12 11:37:08 2008 for BBTK by  doxygen 1.5.6