Changes between Version 5 and Version 6 of BoltImpl
- Timestamp:
- Jun 19, 2008, 1:14:36 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BoltImpl
v5 v6 81 81 * !BoltSelect 82 82 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. 83 Each !BoltUnit implements an abstract interface (see below). 93 84 94 85 === Course state === … … 109 100 === !BoltIter === 110 101 111 This object is used withinthe Bolt scheduler.102 This object is the central data structure of the Bolt scheduler. 112 103 It includes: 113 104 114 '''top''':: the root of the course structure.105 '''top''': the root of the course structure. 115 106 116 '''state''':: the course state (from the latest !BoltView record).107 '''state''': the course state (from the latest !BoltView record). 117 108 118 '''xset''':: the xset we're currently in, if any.109 '''xset''': the xset we're currently in, if any. 119 110 120 '''item''':: the current item111 '''item''': the current item 121 112 122 '''frac_done''':: fraction of course completed so far113 '''frac_done''': fraction of course completed so far 123 114 124 115 Its member functions are: 125 116 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 128 120 129 121 These are both implemented by calling walk() on the root unit. 122 123 === The interface of !BoltUnit === 124 125 !BoltUnit has an abstract function 126 {{{ 127 walk(&$iter, $incr, &$frac_done); 128 }}} 129 where $iter is a !BoltIter object (see below). 130 It is implemented in different ways in the different derived classes. 131 For !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().