next up previous
Next: ProcessReader Up: Class Library Previous: ProcessElement

ProcessContainer

In order to be able to build up a complex block of functionality from smaller blocks, there needs to be a way of grouping elements hierarchically. This is the base class for any object doing this grouping, or containing. It cannot do any processing itself, just contain any number of smaller blocks and connect them together. It must however behave like other elements in the way it handles inputs and outputs, which means that it must inherit these from ProcessBase, and it adds extra functionality related to containing simulation objects. Note that contained objects can be either ProcessElements or other ProcessContainers.


A typical user class derived from ProcessContainer would contain one or more other ProcessBase derived objects. These would be created and destroyed (if necessary) in the constructor and destructor. The constructor here however is slightly more complex than for a ProcessElement. There are actually four tasks is may have to do.

The only new method here is registerInternal, which is provided by ProcessContainer for the containment mechanism. A corresponding getInternal method exists for probing into a container if needed.


The only other method a ProcessContainer has to provide is an override for inputValid. The reason for this is to appear, from the outside, similar to a ProcessElement. The implementation of inputValid for containers is however a little different. The reason for this is that a container has no input ports of its own, but rather it has to forward the connection request to the relevant internal. Note that the forwarded request can use a different name (and number) for the internal connection request.


next up previous
Next: ProcessReader Up: Class Library Previous: ProcessElement
M.P.J.Landon 2003-05-15