]> Creatis software - bbtk.git/blob - kernel/src/bbtkBlackBoxInputConnector.cxx
=== MAJOR RELEASE ====
[bbtk.git] / kernel / src / bbtkBlackBoxInputConnector.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkBlackBoxInputConnector.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/04/18 12:59:15 $
7   Version:   $Revision: 1.3 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 /**
20  *  \file 
21  *  \brief Class bbtk::BlackBoxInputConnector : 
22  */
23 #include "bbtkBlackBoxInputConnector.h"
24 #include "bbtkMessageManager.h"
25 #include "bbtkBlackBox.h"
26
27 namespace bbtk
28 {
29   BlackBoxInputConnector::BlackBoxInputConnector(BlackBox::Pointer b)  
30     : mBox(b), mConnection(), mStatus(MODIFIED)
31   {
32     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::BlackBoxInputConnector()"<<std::endl);
33   }
34
35
36   BlackBoxInputConnector::~BlackBoxInputConnector() 
37   {
38     bbtkDebugMessageInc("Kernel",9,"BlackBoxInputConnector::~BlackBoxInputConnector()"<<std::endl);
39     bbtkDebugDecTab("Kernel",9);
40   }
41   
42   void BlackBoxInputConnector::SetConnection(Connection::Pointer c) 
43   { 
44     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::SetConnection("<<c<<")"<<std::endl);
45     mConnection = c; 
46   }
47   
48   void BlackBoxInputConnector::UnsetConnection(Connection::Pointer c) 
49   { 
50     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::UnsetConnection("
51                      <<c<<")"<<std::endl);
52     mConnection.reset();
53   }
54   
55   IOStatus BlackBoxInputConnector::BackwardUpdate()
56   {
57     bbtkDebugMessageInc("Process",4,"BlackBoxInputConnector::BackwardUpdate()"
58                         <<std::endl);
59
60     if (mConnection.lock()) 
61       {
62         IOStatus s = mConnection.lock()->BackwardUpdate();
63         mStatus = s;
64       }
65     else 
66       {
67         mStatus = UPTODATE;
68       }
69
70     bbtkDecTab("Process",4);
71
72     return mStatus;
73
74   }
75
76
77   //    void Modified();
78   
79 }
80 // namespace bbtk
81