/*========================================================================= Program: bbtk Module: $RCSfile: bbtkConnection.h,v $ Language: C++ Date: $Date: 2008/01/22 15:02:00 $ Version: $Revision: 1.1.1.1 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ /** *\file *\brief Class bbtk::Connection */ /** *\class bbtk::Connection *\brief DDD * */ #ifndef __bbtkConnection_h__ #define __bbtkConnection_h__ #include "bbtkSystem.h" #include namespace bbtk { /// typedef int IOStatus; /// const int MODIFIED = 0; /// const int UPTODATE = 1; /// const int UPDATING = 2; class BlackBox; class BlackBoxInputConnector; class BlackBoxOutputConnector; class BBTK_EXPORT Connection { public: /// Ctor Connection(BlackBox* from, const std::string& output, BlackBox* to, const std::string& input ); /// Dtor ~Connection(); /// Amont direction pipeline processing /// 1) call bbBackwardUpdate(this) on the amont box /// 2) copies the amont box output to the aval box input adapting it if needed virtual IOStatus BackwardUpdate(); /// Aval direction pipeline processing : /// 1) copies the amont box output to the aval box input adapting it if needed /// 2) call bbForwardUpdate(this) on the aval box // virtual void ForwardUpdate(); virtual void SetModifiedStatus(); std::string GetFullName() const; /// Returns the initial black box of the connection BlackBox* GetBlackBoxFrom() const { return mFrom; } /// Returns the final black box of the connection BlackBox* GetBlackBoxTo() const { return mTo; } /// Returns the output of the initial black box of the connection const std::string& GetBlackBoxFromOutput() const { return mOutput; } /// Returns the input of the final black box of the connection const std::string& GetBlackBoxToInput() const { return mInput; } protected: /// Black box origin of the connection BlackBox* mFrom; /// Output of mFrom which is connected std::string mOutput; /// Output connector of mFrom which is connected // BlackBoxOutputConnector* mOutputConnector; /// Black box destination of the connection BlackBox* mTo; /// Input of mTo which is connected std::string mInput; /// Input connector of mTo which is connected // BlackBoxInputConnector* mInputConnector; /// Adaptor black box if needed BlackBox* mAdaptor; /// Is the connection input type is any ? bool mFromAny; /// Is the connection output type is any ? bool mToAny; /// Have to do dynamic_cast ? bool mDoDynamicCast; /// Ctor with the black box from and to and their input and output /// and a dummy int to differentiate from the public constructor. /// Sets the members but does not test compatibility (used by bbtk::AdaptiveConnection) // Connection(BlackBox* from, const std::string& output, // BlackBox* to, const std::string& input, int ); void TransferData(); }; }// namespace bbtk #endif