This is the most fundamental element of the simulation. It provides the base class for any individual process that takes one or more inputs and provides one or more outputs. ProcessElement adds the code necessary to perform a processing stage on each step of the simulation. The usage of ProcessElement to the programmer is to derive a class from it which contains output DataPorts, and references to input DataPorts, and provide four methods, as described below.
Firstly, the user class should have a constructor and destructor. In
the constructor, the output ports are created if necessary, and registered
as outputs using registerOutput. Secondly, the ProcessBase method
inputValid must be overridden to be able to connect up inputs. This
method will be used to request an input connection. The class should
check that the name and type of the input are correct, and if so, set the
internal reference to that input to be equal to the DataPort passed in
the arguments.
Finally, the actually processing stage is provided by overriding the
virtual method process in ProcessElement. This method should look at
the input values from the input DataPorts (provided that they have all
been connected) and so derive the output values to set to output DataPorts.
Success or otherwise is reported back in the return code.