MCPcopy Create free account
hub / github.com/NetSys/bess / DisconnectModulesUpstream

Method DisconnectModulesUpstream

core/module.cc:357–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357void 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}
386void Module::DestroyAllTasks() {
387 for (auto task : tasks_) {
388 auto c = task->GetTC();

Callers

nothing calls this directly

Calls 4

NumIGatesMethod · 0.80
gate_idxMethod · 0.80
ClearHooksMethod · 0.80
moduleMethod · 0.45

Tested by

no test coverage detected