53 bool flush,
const char* displayString)
58 char red[] =
"ls=red,1";
60 if (displayString == NULL)
63 cModule* neighborTerminal;
67 for (
int l = 0; l <
thisTerminal->gateSize(
"overlayNeighborArrowOut"); l++) {
69 thisTerminal->gate(
"overlayNeighborArrowOut", l)->getNextGate();
71 thisTerminal->gate(
"overlayNeighborArrowOut", l)->disconnect();
82 getPeerInfo(neighbor)->getModuleID());
84 if (neighborTerminal == NULL)
91 for (
int i = 0; i <
thisTerminal->gateSize(
"overlayNeighborArrowOut"); i++)
93 ->getNextGate() != NULL &&
95 ->gate(
"overlayNeighborArrowOut", i)
96 ->getNextGate()->getOwnerModule())
101 if (neighborTerminal->gateSize(
"overlayNeighborArrowIn") == 0) {
102 neighborTerminal->setGateSize(
"overlayNeighborArrowIn", 1);
104 for (i = 0; i < neighborTerminal->gateSize(
"overlayNeighborArrowIn") - 1; i++) {
105 if (!(neighborTerminal->gate(
"overlayNeighborArrowIn", i)
106 ->isConnectedOutside()))
109 if (neighborTerminal->gate(
"overlayNeighborArrowIn", i)
110 ->isConnectedOutside()) {
111 neighborTerminal->setGateSize(
"overlayNeighborArrowIn", i + 2);
118 if (
thisTerminal->gateSize(
"overlayNeighborArrowOut") == 0)
119 thisTerminal->setGateSize(
"overlayNeighborArrowOut", 1);
121 for (j = 0; j < (
thisTerminal->gateSize(
"overlayNeighborArrowOut") - 1); j++) {
123 ->isConnectedOutside()))
127 ->isConnectedOutside()) {
128 thisTerminal->setGateSize(
"overlayNeighborArrowOut", j + 2);
133 thisTerminal->gate(
"overlayNeighborArrowOut", j)->connectTo(neighborTerminal->gate(
"overlayNeighborArrowIn", i));
135 thisTerminal->gate(
"overlayNeighborArrowOut", j)->setDisplayString(displayString);
144 if (peerInfo == NULL) {
148 cModule* neighborTerminal = simulation.getModule(peerInfo->
getModuleID());
149 if (neighborTerminal == NULL) {
154 bool compactOut =
false;
155 bool compactIn =
false;
156 for (
int i = 0; i <
thisTerminal->gateSize(
"overlayNeighborArrowOut"); i++) {
159 ->getNextGate() == NULL) {
165 ->getNextGate()->getOwnerModule()->getId() == neighborTerminal->getId()) {
166 thisTerminal->gate(
"overlayNeighborArrowOut", i)->disconnect();
183 const char* gateName = (dir ==
VIS_OUT ?
"overlayNeighborArrowOut"
184 :
"overlayNeighborArrowIn");
186 for (
int j = 0; j < terminal->gateSize(gateName) - 1; j++) {
187 if (terminal->gate(gateName, j)->isConnectedOutside())
190 cGate* tempGate = NULL;
192 while ((tempGate == NULL) && ((j + k) != terminal->gateSize(gateName))) {
194 terminal->gate(gateName, j + k)->getNextGate() :
195 terminal->gate(gateName, j + k)->getPreviousGate());
199 if (tempGate == NULL)
202 cDisplayString tempDisplayStr;
204 tempDisplayStr = terminal->gate(gateName, j + k - 1)->getDisplayString();
205 terminal->gate(gateName, j + k - 1)->disconnect();
206 terminal->gate(gateName, j)->connectTo(tempGate);
207 terminal->gate(gateName, j)->setDisplayString(tempDisplayStr.str());
209 tempDisplayStr = tempGate->getDisplayString();
210 tempGate->disconnect();
211 tempGate->connectTo(terminal->gate(gateName, j));
212 tempGate->setDisplayString(tempDisplayStr.str());
217 for (
int j = 0; j < terminal->gateSize(gateName); j++)
218 if (!terminal->gate(gateName, j)->isConnectedOutside())
221 terminal->setGateSize(gateName, terminal->gateSize(gateName) - nullGates);