7 void Clock<Type>::setBreak(ClockOffset cycle, Type *obj) {
8 ClockListIt it = objects.begin();
9 while( it != objects.end() ) {
10 if( it->first >= cycle )
16 objects.insert( it, std::make_pair(cycle, obj) );
20 void Clock<Type>::setDividedBreak(ClockOffset prescaler, ClockOffset delta,
23 const ClockOffset mask = (prescaler - 1);
24 const ClockOffset rem = prescaler - (value & mask);
25 setBreak( value + rem + (delta - 1) * prescaler, obj );
29 void Clock<Type>::clearBreak(Type *obj) {
30 ClockListIt it = objects.begin();
31 while( it != objects.end() ) {
32 if( it->second == obj )
38 if( it != objects.end() )
43 void Clock<Type>::clearBreak(ClockOffset cycle) {
44 ClockListIt it = objects.begin();
45 while( it != objects.end() ) {
46 if( it->first >= cycle )
52 if( (it != objects.end()) && (it->first == cycle) )
57 void Clock<Type>::reassignBreak(ClockOffset oldCycle, ClockOffset newCycle,
60 ClockListIt it = objects.begin();
61 while( it != objects.end() ) {
62 if( it->first >= oldCycle )
68 if( (it != objects.end()) && (it->first == oldCycle) ) {
70 setBreak( newCycle, obj );
75 void Clock<Type>::reassignBreak(Type *obj, ClockOffset newCycle) {
77 setBreak( newCycle, obj );
81 void Clock<Type>::step() {
84 ClockListIt it = objects.begin();
85 while( it != objects.end() ) {
86 if( it->first > value )
89 Type *obj = it->second;
94 objects.erase( objects.begin(), it );
98 void Clock<Type>::clearAll() {
102 template <class Type>
103 void Clock<Type>::reassignBreakDelta(ClockOffset delta, Type *obj) {
105 setBreakDelta(delta, obj);