Shandy
Shandy

Reputation: 311

Setting up new gate connections in initialize()

I wish to increase the size of my gate vector within initialize() in my simple module class file and make a connection to another node.

cModule *nodeA= getSimulation()->getModule(0);
cModule *nodeB= getSimulation()->getModule(1);
nodeA->gate("port$o")->connectTo(nodeB->gate("port$i"));

The gate vectors for nodeA and nodeB are already full, i.e. all gates of the gate vectors have been assigned. Within a NED file in the connections section, I would be able to write something like the following:

nodeA.port++ --> ned.IdealChannel --> nodeB.port++;

This allows me to expand the size of the gate vectors and make a connection between the nodes. Is it possible to do something similar in C++?

Upvotes: 0

Views: 38

Answers (1)

Jerzy D.
Jerzy D.

Reputation: 7002

No, the size of a gate vectors cannot be controlled using C++.

Upvotes: 1

Related Questions