[Live-devel] Question about
BasicUsageEnvironment/BasicTaskScheduler
Ross Finlayson
finlayson at live.com
Sun Dec 26 12:46:01 PST 2004
>I downloaded the library source (from December 15th if I remember
>right). I have been going through the code trying to figure out how
>stuff works. I noticed that there is another version of
>BasicUsageEnvironment and BasicTaskScheduler: BasicUsageEnvironment0
>and BasicTaskSchedule0. I also noticed that only BasicTaskScheduler0
>has a definition for the function "doEventLoop". May I know why there
>are 2 versions? How are the 2 used?
"BasicTaskScheduler" is implemented using "BasicTaskScheduler0" (its parent
class). Note that "BasicTaskScheduler0" is an abstract class; you can use
it only by defining a subclass. Similarly, "BasicTaskScheduler0" is
implemented using "TaskScheduler" (its parent class), which is also an
abstract class.
The reason for implementing "BasicTaskScheduler" this way is to allow for
the possibility of defining a new "TaskScheduler" subclass that works
basically the same way, but using a different implementation of
"SingleStep()" (which "BasicTaskScheduler0" uses to implement
"doEventLoop()"). I.e.,
TaskScheduler (abstract)
BasicTaskScheduler0 (abstract; defines "doEventLoop()", using
"SingleStep()")
BasicTaskScheduler (concrete; defines "SingleStep()")
We had a customer that wanted to implement "SingleStep()" slightly
differently, and the best way to do this was to have him define a new
subclass of "BasicTaskScheduler0" to do this.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list