Changes between Version 5 and Version 6 of BoltImpl


Ignore:
Timestamp:
Jun 19, 2008, 1:14:36 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoltImpl

    v5 v6  
    8181   * !BoltSelect
    8282
    83 !BoltUnit has an abstract function
    84 {{{
    85 walk(&$iter, $incr, &$frac_done);
    86 }}}
    87 where $iter is a !BoltIter object (see below).
    88 This does the following:
    89 
    90  * Add a unit state structure for this unit to $iter->state.
    91  *
    92 It is implemented in different ways in the different derived classes.
     83Each !BoltUnit implements an abstract interface (see below).
    9384
    9485=== Course state ===
     
    109100=== !BoltIter ===
    110101
    111 This object is used within the Bolt scheduler.
     102This object is the central data structure of the Bolt scheduler.
    112103It includes:
    113104
    114  '''top''':: the root of the course structure.
     105'''top''': the root of the course structure.
    115106
    116  '''state''':: the course state (from the latest !BoltView record).
     107'''state''': the course state (from the latest !BoltView record).
    117108
    118  '''xset''':: the xset we're currently in, if any.
     109'''xset''': the xset we're currently in, if any.
    119110
    120  '''item''':: the current item
     111'''item''': the current item
    121112
    122  '''frac_done''':: fraction of course completed so far
     113'''frac_done''': fraction of course completed so far
    123114
    124115Its member functions are:
    125116
    126  '''at()''':: get current item and fraction done
    127  '''next()''':: move to next item
     117'''at()''': get current item and fraction done
     118
     119'''next()''': move to next item
    128120
    129121These are both implemented by calling walk() on the root unit.
     122
     123=== The interface of !BoltUnit ===
     124
     125!BoltUnit has an abstract function
     126{{{
     127walk(&$iter, $incr, &$frac_done);
     128}}}
     129where $iter is a !BoltIter object (see below).
     130It is implemented in different ways in the different derived classes.
     131For !BoltSet it does the following:
     132
     133 * If there's no unit state record in the course state, set an initial state.
     134 * Otherwise, look up the current child unit, first by name, then by array index.
     135 * Add or replace a unit state record in the $iter->state
     136 * If child is a !BoltItem, set $iter->item; otherwise call child->walk().