1 /*=========================================================================
4 Module: $RCSfile: bbtkConnection.h,v $
6 Date: $Date: 2008/02/20 16:05:38 $
7 Version: $Revision: 1.2 $
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 =========================================================================*/
20 *\brief Class bbtk::Connection
23 *\class bbtk::Connection
28 #ifndef __bbtkConnection_h__
29 #define __bbtkConnection_h__
31 #include "bbtkSystem.h"
39 const int MODIFIED = 0;
41 const int UPTODATE = 1;
43 const int UPDATING = 2;
46 class BlackBoxInputConnector;
47 class BlackBoxOutputConnector;
49 class BBTK_EXPORT Connection
53 Connection(BlackBox* from, const std::string& output,
54 BlackBox* to, const std::string& input );
58 /// Amont direction pipeline processing
59 /// 1) call bbBackwardUpdate(this) on the upstream box
60 /// 2) copies the upstream box output to the downstream box input adapting it if needed
61 virtual IOStatus BackwardUpdate();
63 /// Aval direction pipeline processing :
64 /// 1) copies the upstream box output to the downstream box input adapting it if needed
65 /// 2) call bbForwardUpdate(this) on the downstream box
66 // virtual void ForwardUpdate();
68 virtual void SetModifiedStatus();
69 std::string GetFullName() const;
71 /// Returns the initial black box of the connection
72 BlackBox* GetBlackBoxFrom() const { return mFrom; }
73 /// Returns the final black box of the connection
74 BlackBox* GetBlackBoxTo() const { return mTo; }
75 /// Returns the output of the initial black box of the connection
76 const std::string& GetBlackBoxFromOutput() const { return mOutput; }
77 /// Returns the input of the final black box of the connection
78 const std::string& GetBlackBoxToInput() const { return mInput; }
81 /// Black box origin of the connection
83 /// Output of mFrom which is connected
85 /// Output connector of mFrom which is connected
86 // BlackBoxOutputConnector* mOutputConnector;
87 /// Black box destination of the connection
89 /// Input of mTo which is connected
91 /// Input connector of mTo which is connected
92 // BlackBoxInputConnector* mInputConnector;
93 /// Adaptor black box if needed
96 /// Is the connection input type is any<thing> ?
99 /// Is the connection output type is any<thing> ?
103 /// Have to do dynamic_cast ?
106 /// Ctor with the black box from and to and their input and output
107 /// and a dummy int to differentiate from the public constructor.
108 /// Sets the members but does not test compatibility (used by bbtk::AdaptiveConnection)
109 // Connection(BlackBox* from, const std::string& output,
110 // BlackBox* to, const std::string& input, int );