在Omnet++和Inet中获取模块的子模块名称的方法如下:

huangapple go评论93阅读模式
英文:

How to get submodule names of a module in the Omnet++ and the Inet

问题

如何通过C++代码在Omnet++和Inet中获取模块的子模块名称?

除了上述问题,还可以了解如何以树形视图的方式获取子模块的名称以及它们之间的关系?

谢谢

英文:

How to get submodule names of a module in the Omnet++ and the Inet by C++ code?

In addition to the above question, it would be nice to know how to get the names of the submodules in a tree view with their relationships to each other?

Thanks

答案1

得分: 1

使用getSubmoduleNames()可以获取所有子模块的名称。根据OMNeT++ Simulation Library的说明:

> 返回模块的子模块和子模块向量的名称,包括零大小的子模块向量。

英文:

To get the names of all submodules one may use getSubmoduleNames(). According to OMNeT++ Simulation Library it:

> Returns the names of the module's submodules and submodule vectors, including zero-size submodule vectors.

答案2

得分: 1

API文档可以帮助你。你在问题中几乎已经找到答案了。如果使用cModule类的getSubmoduleNames()方法,可以返回子模块名称。你可以将其与getSubmodule()和其他相关方法结合使用来实现完整的树遍历。

英文:

The API documentation helps you. You almost figured out in the question. The submodule names can be returned by the getSubmoduleNames() method if the cModule class. You can combine that with getSubmodule() and other related methods to implement a full tree walk.

huangapple
  • 本文由 发表于 2023年7月17日 23:04:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76705793.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定