如何将模块连接到门

How to get the module connected to a gate?

本文关键字:连接 模块      更新时间:2023-10-16

在模块内部,我可以得到一个调用该方法的cGate指针:

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

但是一旦获得了cGate指针,我就看不到将(输出中)连接到门的关联模块的方法。我在cChannel课上也没有看到它。有办法吗?

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

从另一端获得cGate对象后,可以使用cGate::getOwnerModule()获取模块