X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=kernel%2Fsrc%2FbbtkConnection.h;h=f69695f112cb749bb4725909af89a3b75e5fdd77;hb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;hp=4a7996844034dea487967bf1664fa49849fc9b6d;hpb=3fb0c5f4f00f86519c93413ab2386c47c5224345;p=bbtk.git diff --git a/kernel/src/bbtkConnection.h b/kernel/src/bbtkConnection.h index 4a79968..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/02/20 16:05:38 $ - Version: $Revision: 1.2 $ + 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 @@ -29,10 +29,14 @@ #define __bbtkConnection_h__ #include "bbtkSystem.h" + #include namespace bbtk { + + class Factory; + /// typedef int IOStatus; /// @@ -51,10 +55,13 @@ namespace bbtk public: /// Ctor Connection(BlackBox* from, const std::string& output, - BlackBox* to, const std::string& input ); + BlackBox* to, const std::string& input, + 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 @@ -68,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 @@ -77,22 +93,41 @@ 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 BlackBox* mAdaptor; + /// The factory used to create adaptors + const Factory* mFactory; + /// Is the connection input type is any ? bool mFromAny;