Top Up Prev Next Bottom Contents Index Search

6.5 Block state and name scoping hierarchy

Recall, that when we initialize a Galaxy for clustering, we flatten the original user-specified hierarchy. Before this action, we extract the important information in the hierarchy using the Scope class. In this section we detail this class. The details in this section, however, are not necessary to understand clustering in Ptolemy.

Blocks inherit states from their parent. The Scope class makes it possible for a Target or Scheduler to change the Block hierarchy by saving the inherited states in the user-specified hierarchy. The scoping hierarchy was first released in Ptolemy 0.6, and is only created when the static method Scope::createScope(Galaxy&) is invoked. Currently, the only code that uses the scoping hierarchy is the Cluster class.

The Scope class manages its memory. Once a Scope is created, it will not be deleted until all Blocks within the given Scope are deleted. The Scope class is privately derived from Galaxy. To turn on scoping a programmer simply calls the static method:

static Scope* Scope::createScope(Galaxy&)

This method constructs a parallel tree corresponding to each Galaxy and copies the StateList and name() for each level.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.