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

ProcessBase

This is the base class for all simulation components and its main task is to provide the connection mechanisms between elements. It provides both shared implementation for some features (mostly the inter-connection behaviour), and virtual member functions that must be implemented by the derived classes. Some useful information methods are also provided for debugging.


There are a few methods that the user needs to know about. Firstly those related to connecting input and output ports as seen by the steering program. These are connectInput, which requests the named input port of an object to be connected to a DataPort, and getOutput which asks for a pointer to a named output. There are actually two arguments to identify the port in both cases. The first is a name, and the second a number for cases where there are more than one input/output of the same name in that object. The number defaults to zero if not provided for ease of use with unique ports.


Methods which the user needs to know about for writing their own ProcessBase derived classes are registerOutput and inputValid. These methods provide the derived classes with a way to describe their inputs and outputs. Outputs are contained by an object, so a derived constructor can use registerOutput to simply advertise their location and names. The inputValid method is a virtual method which has to be over-ridden by derived classes to check if an input request is valid, and if so record internally where that input is coming from.


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