Signal class overview
Signal is an abstract class from which the Generator and Filter classes are derived.
It is used to define basic properties common to all Generator and
Filter objects. For example, the name of the signal object,
debugging functions, and the sampling rate are all handled by this
class. Also, it can be used to dynamically resolve various derived
functions when using a generic Signal pointer. You do not create
instances of this class directly, but rather use the derived
functions in Generator or Filter objects.
There are three functions critical to the organization of
Signal objects. These three functions are undefined in the
Signal class and must be defined in a derived class. The functions
are:
- action
Generates the next value that will be returned when the
output function is called.
If there are input signals connected to the signal object, then
it is assumed that they have already been properly updated.
- output
Returns the current value of the signal.
Calling action will update the value returned by
output.
- tick
A recusive function that will first ask any upstream signals to
run their action function, and will then call
the output function to get the signal values from
the upstream signals. Note that Generator signals cannot
have input signals, while Filter signals may. Also note
that the Action
class usually should be used to handle this function.