X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkConnection.h;h=f69695f112cb749bb4725909af89a3b75e5fdd77;hb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;hp=b75cb20db5b6d702b7842fce5fea430327714daf;hpb=b36ad32968c9523e48d5b853b6b77e9e421709d2;p=bbtk.git diff --git a/kernel/src/bbtkConnection.h b/kernel/src/bbtkConnection.h index b75cb20..f69695f 100644 --- a/kernel/src/bbtkConnection.h +++ b/kernel/src/bbtkConnection.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkConnection.h,v $ Language: C++ - Date: $Date: 2008/03/07 10:21:30 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/04/09 11:16:57 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -56,10 +56,12 @@ namespace bbtk /// Ctor Connection(BlackBox* from, const std::string& output, BlackBox* to, const std::string& input, - const Factory* f ); + const Factory* f); /// Dtor ~Connection(); + void Clear(); + /// Amont direction pipeline processing /// 1) call bbBackwardUpdate(this) on the upstream box /// 2) copies the upstream box output to the downstream box input adapting it if needed @@ -73,6 +75,15 @@ namespace bbtk virtual void SetModifiedStatus(); std::string GetFullName() const; + /// Returns the original initial black box of the connection + BlackBox* GetOriginalBlackBoxFrom() const { return mOriginalFrom; } + /// Returns the origianl final black box of the connection + BlackBox* GetOriginalBlackBoxTo() const { return mOriginalTo; } + /// Returns the original output of the initial black box of the connection + const std::string& GetOriginalBlackBoxFromOutput() const { return mOriginalOutput; } + /// Returns the original input of the final black box of the connection + const std::string& GetOriginalBlackBoxToInput() const { return mOriginalInput; } + /// Returns the initial black box of the connection BlackBox* GetBlackBoxFrom() const { return mFrom; } /// Returns the final black box of the connection @@ -82,17 +93,33 @@ namespace bbtk /// Returns the input of the final black box of the connection const std::string& GetBlackBoxToInput() const { return mInput; } + /// Sets the initial black box of the connection + void SetBlackBoxFrom(BlackBox* b) { mFrom = b; } + /// Sets the final black box of the connection + void SetBlackBoxTo(BlackBox* b) { mTo = b; } + /// Sets the output of the initial black box of the connection + void SetBlackBoxFromOutput(const std::string& o) { mOutput = o; } + /// Sets the input of the final black box of the connection + void SetBlackBoxToInput(const std::string& o) { mInput = o; } + + /// Checks that the connection is ok (throws error if not) + void Check() const; + protected: /// Black box origin of the connection BlackBox* mFrom; + BlackBox* mOriginalFrom; /// Output of mFrom which is connected std::string mOutput; + std::string mOriginalOutput; /// Output connector of mFrom which is connected // BlackBoxOutputConnector* mOutputConnector; /// Black box destination of the connection BlackBox* mTo; + BlackBox* mOriginalTo; /// Input of mTo which is connected std::string mInput; + std::string mOriginalInput; /// Input connector of mTo which is connected // BlackBoxInputConnector* mInputConnector; /// Adaptor black box if needed