在缺省情况下,端口通过值创建。但是,如果您在设计时不知道端口数(多重性为 *),那么可以通过编程方式来创建端口。
例如,要将 10 个 src 端口实例化,请使用以下调用:
for (int i=0; i<10; ++1) { // instantiate and add to the container of the owner newSrc(); }