0

Inside a module, I can get a cGate pointer calling the method:

const cGate* cModule::gate  (   const char *    gatename, int   index = -1) 

But once obtained the cGate pointer, I don't see a way to get the associate module that is connected (in output) to the gate. I don't see it in the cChannel class either. Is there a way?

4

1 回答 1

1

检查cGate::getPathStartGate()cGate::getPathEndGate()方法。根据连接的方向,这些将为您提供端点门(它甚至会跨越模块边界跟随连接,直到它在连接链的另一侧找到一个简单的模块)。(cGate::getNextGate()并且cGate::getPreviousGate()只给出链上的下一个/上一个门)

一旦你从另一边得到了cGate对象,你就可以使用cGate::getOwnerModule()

于 2015-02-12T09:57:13.320 回答