This is a simple pull request that extends the functionality of sources.
With this change, a source description constructor can optionally take the parent source as an input argument. This allows sources to modify themselves depending on the parent.
An example use case is to only allow creation of Cell sources under Mouse objects that have no default values. In the Cell constructor, one would check each property of the mouse object against an empty string (using parent.getProperty()), and throw an error if one is found.
This change should be fully backwards compatible, since the number of input arguments for the constructor is checked before passing the parent as an argument.
This is a simple pull request that extends the functionality of sources.
With this change, a source description constructor can optionally take the parent source as an input argument. This allows sources to modify themselves depending on the parent.
An example use case is to only allow creation of
Cell
sources underMouse
objects that have no default values. In theCell
constructor, one would check each property of themouse
object against an empty string (usingparent.getProperty()
), and throw an error if one is found.This change should be fully backwards compatible, since the number of input arguments for the constructor is checked before passing the parent as an argument.