7 extern "C" int printf(const char *...);
11 class RWSlistIterator {
14 RWSlistIterator(RWSlist& s) { }
16 if (ptr1 != (RWSlistIterator*)this)
18 if (ptr2 != &(*this).slist)
21 if (0) printf("at %x %x\n", (RWSlistIterator*)this, &(*this).slist);
28 class RWSlistCollectables : public RWSlist {
30 RWSlistCollectables() { }
31 RWSlistCollectables(RWCollectable* a) { }
36 class RWSlistCollectablesIterator : public RWIterator, public RWSlistIterator {
38 RWSlistCollectablesIterator(RWSlistCollectables& s) : RWSlistIterator(s) { }
41 class Sim_Event_Manager {
43 RWSlistCollectables scheduled_events_;
44 RWSlistCollectablesIterator last_posted_event_position_;
49 Sim_Event_Manager::Sim_Event_Manager ()
50 :last_posted_event_position_(scheduled_events_)
54 void Sim_Event_Manager::post_event () {
55 ptr1 = (RWSlistIterator*)&last_posted_event_position_;
56 ptr2 = &((RWSlistIterator*)&last_posted_event_position_)->slist;
57 if (0) printf("at %x %x\n", (RWSlistIterator*)&last_posted_event_position_,
58 &((RWSlistIterator*)&last_posted_event_position_)->slist);
59 if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
61 if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
63 if (0) printf("at %x ?%x\n", (RWSlistIterator*)&last_posted_event_position_,
64 &((RWSlistIterator&)last_posted_event_position_).slist);
65 if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
67 if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
69 last_posted_event_position_.toLast();
72 int main(int argc, char **argv) {
73 Sim_Event_Manager foo;