* */
| 179 | * |
| 180 | */ |
| 181 | void |
| 182 | Effect::add_effect(const Effect &e, bool include_lhs_effects) |
| 183 | { |
| 184 | if (this == &e) { |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | // Stuff that so badly wants to be rewritten using decent STL containers |
| 189 | // and algorithms... compute the union effect. |
| 190 | |
| 191 | vector<const Variable *>::size_type len; |
| 192 | vector<const Variable *>::size_type i; |
| 193 | |
| 194 | len = e.read_vars.size(); |
| 195 | for (i = 0; i < len; ++i) { |
| 196 | // this->read_var(e.read_vars[i]); |
| 197 | if (!is_read(e.read_vars[i])) { |
| 198 | this->read_vars.push_back(e.read_vars[i]); |
| 199 | } |
| 200 | } |
| 201 | len = e.write_vars.size(); |
| 202 | for (i = 0; i < len; ++i) { |
| 203 | // this->write_var(e.write_vars[i]); |
| 204 | if (!is_written(e.write_vars[i])) { |
| 205 | this->write_vars.push_back(e.write_vars[i]); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | if (include_lhs_effects) { |
| 210 | add_variables_to_set(lhs_write_vars, e.get_lhs_write_vars()); |
| 211 | } |
| 212 | pure &= e.pure; |
| 213 | side_effect_free &= e.side_effect_free; |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | * |
no test coverage detected