comparison host/libcdl/value.cxx @ 90:70190fa0fe10 ecos-sw-2000-05-19

Merge from eCos master repository on 2000-05-19-07:47:03-BST
author jlarmour
date Fri, 19 May 2000 12:47:51 +0000
parents 6736c52df507
children 95f3e12a6327
comparison
equal deleted inserted replaced
89:fb6e7cf186a5 90:70190fa0fe10
2146 // checks all of the implementors and recalculates the value from 2146 // checks all of the implementors and recalculates the value from
2147 // scratch. It needs to be invoked whenever there is a relevant 2147 // scratch. It needs to be invoked whenever there is a relevant
2148 // change to the implementors. Currently no attempt is made to 2148 // change to the implementors. Currently no attempt is made to
2149 // optimise interface updates, although this may have to change in 2149 // optimise interface updates, although this may have to change in
2150 // future. 2150 // future.
2151
2152 // Any changes to the interface itself can be ignored.
2153 if ((CdlUpdate_ValueChange == change) || (CdlUpdate_ActiveChange == change)) {
2154 CYG_REPORT_RETURN();
2155 return;
2156 }
2157
2158 // The second stage init is irrelevant
2159 if (CdlUpdate_Init == change) {
2160 CYG_REPORT_RETURN();
2161 return;
2162 }
2163
2164 // Possibilities:
2165 // 1) source is being loaded, dest valid
2166 // 2) source is being loaded, dest unknown
2167 // 3) source is being unloaded, dest valid
2168 // 4) source is being unloaded, dest unknown
2169 // 5) dest has been created
2170 // 6) dest is going away
2151 // 2171 //
2152 // As far as this code is concerned, any time that an implementor 2172 // If we have a valid dest, it needs to be updated and any structural
2153 // is loaded or unloaded the interface needs to be recalculated. 2173 // conflicts have to be cleared.
2154 // Also if the destination is created then it needs to be 2174 //
2155 // recalculated, although that should really be the responsibility 2175 // If there is no dest, the implements property remains unbound.
2156 // of the interface itself. In due course interfaces should be 2176 // A suitable conflict is created in the base class.
2157 // auto-generated if not explicitly defined. 2177 //
2158 if ((CdlUpdate_Loaded == change) || (CdlUpdate_Unloading == change) || (CdlUpdate_Created == change)) { 2178 // If the dest is invalid, a structural conflict has to be created.
2159 if (0 != dest) { 2179 if (CdlUpdate_Destroyed == change) {
2160 CdlInterface interface = dynamic_cast<CdlInterface>(dest); 2180 // There is no need to do any clean-ups in the dest.
2161 CYG_ASSERT_CLASSC(interface); 2181 dest = 0;
2182 }
2183 if (0 == dest) {
2184 transaction->clear_structural_conflicts(source, prop, &CdlConflict_DataBody::test);
2185 } else {
2186 CdlInterface interface = dynamic_cast<CdlInterface>(dest);
2187
2188 if (0 == interface) {
2189 std::string msg = source->get_class_name() + " " + source->get_name() + " cannot implement " +
2190 dest->get_name() + "\n The latter is not an interface.";
2191 CdlConflict_DataBody::make(transaction, source, prop, msg);
2192 } else {
2193 transaction->clear_structural_conflicts(source, prop, &CdlConflict_DataBody::test);
2162 interface->recalculate(transaction); 2194 interface->recalculate(transaction);
2163 } 2195 }
2164 } 2196 }
2165 2197
2166 CYG_REPORT_RETURN(); 2198 CYG_REPORT_RETURN();