Linking behavioral ports to their owning instance

If you do not know what the multiplicity of the behavioral port at design time, you can specify it programmatically.

About this task

Behavioral ports are connected to their owning instance using the method connect[ClassName]. For example, to connect behavioral port p to its owner object a (of type A), use the following call:

a.getP()->connectA(a);

If the ports in previous API illustration are behavioral, you would use the following code:

for (int i=0; i<10; ++i) {
   newSrc();
   //hooks the class so it takes care of the messages
   getSrcAt(i)->connectA(this);
}

For more efficiency, use the following code:

for (int i=0; i<10; ++i) {
   newSrc()->connectA(this);

Feedback