INET Framework for OMNeT++/OMNEST
inet::OmittedModule Class Reference

#include <OmittedModule.h>

Inheritance diagram for inet::OmittedModule:

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual bool initializeModules (int stage) override
 

Member Function Documentation

◆ initialize()

void inet::OmittedModule::initialize ( int  stage)
overrideprotectedvirtual
17 {
18  if (stage == INITSTAGE_LOCAL) {
19  for (cModule::GateIterator ig(this); !ig.end(); ++ig) {
20  auto gateIn = *ig;
21  if (gateIn->getType() == cGate::INPUT && gateIn->findTransmissionChannel() == nullptr) {
22  auto gateOut = gateIn->getNextGate();
23  auto previousGate = gateIn->getPreviousGate();
24  auto nextGate = gateOut->getNextGate();
25  if (previousGate != nullptr && nextGate != nullptr) {
26  EV_INFO << "Reconnecting gates: " << previousGate->getFullPath() << " --> " << nextGate->getFullPath() << std::endl;
27  std::string direction;
28  if (previousGate->getChannel()) {
29  direction = opp_nulltoempty(previousGate->getDisplayString().getTagArg("m", 0));
30  }
31  if (direction.empty() && gateOut->getChannel())
32  direction = opp_nulltoempty(gateOut->getDisplayString().getTagArg("m", 0));
33  gateOut->disconnect();
34  previousGate->disconnect();
35  previousGate->connectTo(nextGate);
36  if (!direction.empty())
37  previousGate->getDisplayString().setTagArg("m", 0, direction.c_str());
38  }
39  }
40  }
41  }
42 }

◆ initializeModules()

bool inet::OmittedModule::initializeModules ( int  stage)
overrideprotectedvirtual
45 {
46  bool result = cModule::initializeModules(stage);
47  if (stage == INITSTAGE_LAST) {
48  auto parentModule = getParentModule();
49  deleteModule();
50  layoutSubmodulesWithGates(parentModule);
51  }
52  return result;
53 }

◆ numInitStages()

virtual int inet::OmittedModule::numInitStages ( ) const
inlineoverrideprotectedvirtual
18 { return NUM_INIT_STAGES; }

The documentation for this class was generated from the following files:
inet::INITSTAGE_LAST
INET_API InitStage INITSTAGE_LAST
Operations that no other initializations can depend on, e.g.
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::layoutSubmodulesWithGates
void layoutSubmodulesWithGates(cModule *module, int dimensionIndex, double moduleSpacing)
Definition: SubmoduleLayout.cc:39