bbtkBlackBoxOutputConnector.cxx
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
00031
00037 #include "bbtkBlackBoxOutputConnector.h"
00038 #include "bbtkMessageManager.h"
00039 #include "bbtkBlackBox.h"
00040
00041
00042 namespace bbtk
00043 {
00044
00045 BlackBoxOutputConnector::BlackBoxOutputConnector()
00046
00047 {
00048 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::BlackBoxOutputConnector()"<<std::endl);
00049 }
00050
00051 BlackBoxOutputConnector::~BlackBoxOutputConnector()
00052 {
00053 bbtkDebugMessage("Kernel",9,
00054 "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()"
00055 <<std::endl);
00056
00057
00058
00059
00060
00061
00062
00063 mConnection.clear();
00064 bbtkDebugMessage("Kernel",9,
00065 "<== BlackBoxOutputConnector::~BlackBoxOutputConnector()"
00066 <<std::endl);
00067 }
00068
00070 void BlackBoxOutputConnector::SetConnection(Connection* c)
00071 {
00072 bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::SetConnection("
00073 <<c<<")"<<std::endl);
00074 mConnection.push_back(c);
00075 }
00076
00077
00078
00080 void BlackBoxOutputConnector::UnsetConnection(Connection* c)
00081 {
00082 bbtkDebugMessageInc("Kernel",9,"BlackBoxOutputConnector::UnsetConnection("
00083 <<c<<")"<<std::endl);
00084
00085 if (!c)
00086 {
00087 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : invalid connection");
00088
00089 }
00090
00091
00092 ConnectionVector::iterator i;
00093
00094 for (i=mConnection.begin();
00095 i!=mConnection.end();
00096 ++i)
00097 {
00098 if (*i==c) break;
00099 }
00100 if (i==mConnection.end())
00101 {
00102 bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<<c<<") : connection is absent from connections list");
00103 }
00104 mConnection.erase(i);
00105
00106 bbtkDebugDecTab("Kernel",9);
00107 }
00108
00109
00110
00111 void BlackBoxOutputConnector::SetModifiedStatus()
00112 {
00113 bbtkDebugMessage("modified",2,
00114 "==> BlackBoxOutputConnector::SetModifiedStatus() ["
00115 <<this<<"]"
00116 <<std::endl);
00117 ConnectionVector::iterator i;
00118 for (i=mConnection.begin();i!=mConnection.end();++i)
00119 {
00120 (*i)->SetModifiedStatus();
00121 }
00122
00123
00124 }
00125
00126
00127
00128 }
00129
00130