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.
Block
s 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 Block
s 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.