| 355 | } |
| 356 | |
| 357 | void Module::DisconnectModulesUpstream(gate_idx_t igate_idx) { |
| 358 | bess::IGate *igate; |
| 359 | |
| 360 | CHECK_LT(igate_idx, module_builder_->NumIGates()); |
| 361 | |
| 362 | /* no error even if the igate is unconnected already */ |
| 363 | if (!is_active_gate<bess::IGate>(igates_, igate_idx)) { |
| 364 | return; |
| 365 | } |
| 366 | |
| 367 | igate = igates_[igate_idx]; |
| 368 | if (igate == nullptr) { |
| 369 | return; |
| 370 | } |
| 371 | |
| 372 | for (const auto &ogate : igate->ogates_upstream()) { |
| 373 | Module *m_prev = ogate->module(); |
| 374 | m_prev->ogates_[ogate->gate_idx()] = nullptr; |
| 375 | ogate->ClearHooks(); |
| 376 | |
| 377 | delete ogate; |
| 378 | } |
| 379 | |
| 380 | igates_[igate_idx] = nullptr; |
| 381 | igate->ClearHooks(); |
| 382 | delete igate; |
| 383 | |
| 384 | return; |
| 385 | } |
| 386 | void Module::DestroyAllTasks() { |
| 387 | for (auto task : tasks_) { |
| 388 | auto c = task->GetTC(); |
nothing calls this directly
no test coverage detected