1 /*=========================================================================
4 Module: $RCSfile: bbtkConnection.h,v $
6 Date: $Date: 2008/03/07 10:21:30 $
7 Version: $Revision: 1.3 $
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"
43 const int MODIFIED = 0;
45 const int UPTODATE = 1;
47 const int UPDATING = 2;
50 class BlackBoxInputConnector;
51 class BlackBoxOutputConnector;
53 class BBTK_EXPORT Connection
57 Connection(BlackBox* from, const std::string& output,
58 BlackBox* to, const std::string& input,
63 /// Amont direction pipeline processing
64 /// 1) call bbBackwardUpdate(this) on the upstream box
65 /// 2) copies the upstream box output to the downstream box input adapting it if needed
66 virtual IOStatus BackwardUpdate();
68 /// Aval direction pipeline processing :
69 /// 1) copies the upstream box output to the downstream box input adapting it if needed
70 /// 2) call bbForwardUpdate(this) on the downstream box
71 // virtual void ForwardUpdate();
73 virtual void SetModifiedStatus();
74 std::string GetFullName() const;
76 /// Returns the initial black box of the connection
77 BlackBox* GetBlackBoxFrom() const { return mFrom; }
78 /// Returns the final black box of the connection
79 BlackBox* GetBlackBoxTo() const { return mTo; }
80 /// Returns the output of the initial black box of the connection
81 const std::string& GetBlackBoxFromOutput() const { return mOutput; }
82 /// Returns the input of the final black box of the connection
83 const std::string& GetBlackBoxToInput() const { return mInput; }
86 /// Black box origin of the connection
88 /// Output of mFrom which is connected
90 /// Output connector of mFrom which is connected
91 // BlackBoxOutputConnector* mOutputConnector;
92 /// Black box destination of the connection
94 /// Input of mTo which is connected
96 /// Input connector of mTo which is connected
97 // BlackBoxInputConnector* mInputConnector;
98 /// Adaptor black box if needed
101 /// The factory used to create adaptors
102 const Factory* mFactory;
104 /// Is the connection input type is any<thing> ?
107 /// Is the connection output type is any<thing> ?
111 /// Have to do dynamic_cast ?
114 /// Ctor with the black box from and to and their input and output
115 /// and a dummy int to differentiate from the public constructor.
116 /// Sets the members but does not test compatibility (used by bbtk::AdaptiveConnection)
117 // Connection(BlackBox* from, const std::string& output,
118 // BlackBox* to, const std::string& input, int );