Top Up Prev Next Bottom Contents Index Search

3.2 Class Star


Class Star represents the basic executable atomic version of Block. It is derived from Block . Stars have an associated Target , an index value, and an indication of whether or not there is internal state. The default constructor sets the target pointer to NULL, sets the internal state flag to TRUE, and sets the index value to -1.

3.2.1 Star public members

int run(); 
Execute the Star. This method also interfaces to the SimControl class to provide for control over simulations. All derived classes that override this method must invoke Star::run.

StringList print(int verbose = 0) const; 
Print out info on the star.

Star& asStar(); 
const Star& asStar() const;
These simply return a reference to this, overriding Block::asStar.

int index() const; 
Return the index value for this star. Index values are a feature that assists with certain schedulers; the idea is to assign a numeric index to each star at any level of a particular Universe or Galaxy.

virtual void setTarget(Target* t); 
Set the target associated with this star.

void noInternalState(); 
Declare that this star has no internal state (This function may change to protected in future Ptolemy releases).

int hasInternalState(); 
Return TRUE if this star has internal state, FALSE if it doesn't. Useful in parallel scheduling.

3.2.2 Star protected members

virtual void go(); 
This is a method that is intended to be overridden to provide the principal action of executing this block. It is protected and is intended to be called from the run() member function. The separation is so that actions common to a domain can be provided in the run function, leaving the writer of a functional block to only implement go().



Top Up Prev Next Bottom Contents Index Search

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