Checks for Recursive and Duplicate Galaxy Definitions

Several new checks for errors and possible errors have been added.
  • Ptolemy will now detect a recursive galaxy definition and issue an error message, rather than thrashing and eventually coredumping as it used to. This is implemented by a test for recursive invocation of KnownBlock::clone or KnownBlock::makeNew; therefore it will trigger when the recursive definition is used, not when it is made. An error report is produced with Error::abortRun, and NULL is returned as though the block didn't exist. The NULL return tends to lead to additional, extraneous error messages afterwards, but it beats the heck out of the previous behavior when you've accidentally created a self-referential galaxy.
  • KnownBlock keeps track of the definition source of each known block, and issues warning messages (not fatal errors) if it changes. The conditions detected by this test are: Previously, the system would just silently use the new definition of the block type, which could lead to quite mystifying behavior in a schematic "that was working a moment ago". It is hoped that the warning message will reduce confusion. (A better solution would be to name block types using more than just the last component of their path names. The warning should be viewed as a stopgap measure until we are prepared to break backwards compatibility in that fashion.)

    Some of the Ptolemy demos use identically named subgalaxies, which means that this warning will trigger here and there if you run all the demos in sequence. Just click "OK" to continue.


  • Last updated 04/18/97, comments to ptolemy@ptolemy.eecs.berkeley.edu.