ModularCGPubSub

The top-level of this model is an ordinary composite actor that is not code generated. It just runs in simulation, as usual. The composite in the model, however, is an instance of ModularCodeGenTypedCompositeActor. This has two key properties: 1) It is lazy. The inside of this model is not expanded until it is needed. 2) When it fires the first time, it will generate code for its inside model. Subsequently, it will use that code and not look at the inside model. If the model is changed (anywhere) then it will regenerate code. If you close and re-open the model and run it, it will run the generated code and will never expand the inside model. The generated code goes (by default) into a directory $HOME/cg. You can look at the generated code. Note that this example supports Publisher and Subscribe actors (in a rather clever way due to Bert Rodiers).

ModularCGPubSub is available in two formats:

See Web Start Help for details.