bbtkConnection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00041 #ifndef __bbtkConnection_h__
00042 #define __bbtkConnection_h__
00043
00044 #include "bbtkSystem.h"
00045 #include "bbtkObject.h"
00046
00047 #include <string>
00048
00049 namespace bbtk
00050 {
00051
00052 class Factory;
00053 BBTK_FORWARD_DECLARE_POINTER(Factory);
00054 class BlackBox;
00055 BBTK_FORWARD_DECLARE_POINTER(BlackBox);
00056 class BlackBoxInputConnector;
00057 class BlackBoxOutputConnector;
00058
00060 typedef int IOStatus;
00062 const int MODIFIED = 0;
00064 const int UPTODATE = 1;
00066 const int UPDATING = 2;
00067
00068
00069 class BBTK_EXPORT Connection : public Object
00070 {
00071 BBTK_OBJECT_INTERFACE(Connection);
00072 typedef Object Superclass;
00073 public:
00074
00075 static Pointer New(BlackBoxPointer from, const std::string& output,
00076 BlackBoxPointer to, const std::string& input,
00077 const FactoryPointer f);
00078 static Pointer New(BlackBoxPointer from, const std::string& output,
00079 BlackBoxPointer to, const std::string& input);
00081
00082
00083
00084
00088 virtual IOStatus BackwardUpdate();
00089
00093
00094
00095 virtual void SetModifiedStatus();
00096 std::string GetFullName() const;
00097
00099 BlackBoxPointer GetOriginalBlackBoxFrom() const { return mOriginalFrom.lock(); }
00101 BlackBoxPointer GetOriginalBlackBoxTo() const { return mOriginalTo.lock(); }
00103 const std::string& GetOriginalBlackBoxFromOutput() const { return mOriginalOutput; }
00105 const std::string& GetOriginalBlackBoxToInput() const { return mOriginalInput; }
00106
00108 BlackBoxPointer GetBlackBoxFrom() const { return mFrom; }
00110 BlackBoxPointer GetBlackBoxTo() const { return mTo; }
00112 const std::string& GetBlackBoxFromOutput() const { return mOutput; }
00114 const std::string& GetBlackBoxToInput() const { return mInput; }
00115
00117 void SetBlackBoxFrom(BlackBoxPointer b) { mFrom = b; }
00119 void SetBlackBoxTo(BlackBoxPointer b) { mTo = b; }
00121 void SetBlackBoxFromOutput(const std::string& o) { mOutput = o; }
00123 void SetBlackBoxToInput(const std::string& o) { mInput = o; }
00124
00126 void Check() const;
00127
00128 protected:
00130 BlackBoxPointer mFrom;
00131 BlackBoxWeakPointer mOriginalFrom;
00133 std::string mOutput;
00134 std::string mOriginalOutput;
00136
00138 BlackBoxPointer mTo;
00139 BlackBoxWeakPointer mOriginalTo;
00141 std::string mInput;
00142 std::string mOriginalInput;
00144
00146 BlackBoxPointer mAdaptor;
00147
00149 const FactoryWeakPointer mFactory;
00150
00152 bool mFromAny;
00153
00155 bool mToAny;
00156
00157
00159 bool mDoDynamicCast;
00160
00164
00165
00166
00167 void TransferData();
00168
00169 private:
00171 Connection(BlackBoxPointer from, const std::string& output,
00172 BlackBoxPointer to, const std::string& input,
00173 const FactoryPointer f);
00175 Connection(BlackBoxPointer from, const std::string& output,
00176 BlackBoxPointer to, const std::string& input);
00177
00178 };
00179
00180 }
00181
00182 #endif
00183