Top Up Prev Next Bottom Contents Index Search

3.6 Class Runnable

The Runnable class is a sort of "mixin class" intended to be used with multiple inheritance to create runnable universes and wormholes. It is defined in the file Universe.h. Constructors:

Runnable(Target* tar, const char* ty, Galaxy* g); 
Runnable(const char* targetname, const char* dom, Galaxy* g);
void initTarget();
This function initializes target and/or generates the schedule.

int run(); 
This function causes the object to run, until the stopping condition is reached.

virtual void setStopTime(double stamp); 
This function sets stop time. The default implementation just calls the identical function in the target.

StringList displaySchedule(); 
Display schedule, if appropriate (some types of schedulers will return a string saying that compile-time scheduling is not performed, e.g. DE and DDF schedulers).

virtual ~Runnable(); 
The destructor deletes the Target.

A Runnable object has the following protected data members:

const char* type; 
Galaxy* galP;
As a rule, when used as one of the base classes for multiple inheritance, the galP pointer will point to the galaxy provided by the other half of the object.

A Runnable object has the private data member:

Target* target; 

Top Up Prev Next Bottom Contents Index Search
Copyright © 1990-1997, University of California. All rights reserved.